code
stringlengths
10
1.34M
language
stringclasses
1 value
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bytes" "expvar" "flag" "fmt" "io" "log" "net/http" "os" "strconv" ) // hello world, the web server var helloRequests = expvar....
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP client implementation. See RFC 2616. // // This is the low-level Transport implementation of RoundTripper. // The high-level interface is in client.go....
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP client. See RFC 2616. // // This is the high-level Client interface. // The low-level implementation is in transport.go. package http import ( "enco...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "bytes" "encoding/binary" ) // Content-type sniffing algorithm. // References in this file refer to this draft specification: // ht...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "bytes" "fmt" "strconv" "strings" "time" ) // This implementation is done according to RFC 6265: // // http://tools.ietf.org/htm...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP file system request handler package http import ( "errors" "fmt" "io" "mime" "os" "path" "path/filepath" "strconv" "strings" "time" "unicod...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package httptest provides utilities for HTTP testing. package httptest import ( "bytes" "net/http" ) // ResponseRecorder is an implementation of http.Res...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Implementation of Server package httptest import ( "crypto/tls" "flag" "fmt" "net" "net/http" "os" ) // A Server is an HTTP server listening on a sy...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package pprof serves via its HTTP server runtime profiling data // in the format expected by the pprof visualization tool. // For more information about ppr...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The wire protocol for HTTP's "chunked" Transfer-Encoding. // This code is duplicated in httputil/chunked.go. // Please make any changes in both files. pack...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "bufio" "bytes" "errors" "fmt" "io" "io/ioutil" "net/textproto" "strconv" "strings" ) // transferWriter inspects the fields of ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP server. See RFC 2616. // TODO(rsc): // logging package http import ( "bufio" "bytes" "crypto/rand" "crypto/tls" "errors" "fmt" "io" "io/iout...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package fcgi // This file implements FastCGI from the perspective of a child process. import ( "errors" "fmt" "io" "net" "net/http" "net/http/cgi" "os"...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package fcgi implements the FastCGI protocol. // Currently only the responder role is supported. // The protocol is defined at http://www.fastcgi.com/drupal/...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package httputil provides HTTP utility functions, complementing the // more common ones in the net/http package. package httputil import ( "bufio" "errors...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package httputil import ( "bytes" "errors" "fmt" "io" "io/ioutil" "net" "net/http" "strings" ) // One of the copies, say from b to r2, could be avoide...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The wire protocol for HTTP's "chunked" Transfer-Encoding. // This code is a duplicate of ../chunked.go with these edits: // s/newChunked/NewChunked/g // s/p...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP reverse proxy handler package httputil import ( "io" "log" "net" "net/http" "net/url" "strings" "sync" "time" ) // ReverseProxy is an HTTP Ha...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http // HTTP status codes, defined in RFC 2616. const ( StatusContinue = 100 StatusSwitchingProtocols = 101 StatusOK = ...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "fmt" "io" "net/textproto" "sort" "strings" ) // A Header represents the key-value pairs in an HTTP header. type Header map[string...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements CGI from the perspective of a child // process. package cgi import ( "bufio" "crypto/tls" "errors" "fmt" "io" "io/ioutil" "net"...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements the host side of CGI (being the webserver // parent process). // Package cgi implements CGI (Common Gateway Interface) as specified // ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // HTTP Request reading and parsing. package http import ( "bufio" "bytes" "crypto/tls" "encoding/base64" "errors" "fmt" "io" "io/ioutil" "mime" "mi...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http // This file deals with lexical matters of HTTP func isSeparator(c byte) bool { switch c { case '(', ')', '<', '>', '@', ',', ';', ':', '\\', '...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "fmt" "io" ) // fileTransport implements RoundTripper for the 'file' protocol. type fileTransport struct { fh fileHandler } // NewFi...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package http provides HTTP client and server implementations. Get, Head, Post, and PostForm make HTTP requests: resp, err := http.Get("http://example.com/...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // TCP for Plan 9 package net import ( "os" ) // TCPConn is an implementation of the Conn interface // for TCP network connections. type TCPConn struct { ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Waiting for FDs via kqueue/kevent. package net import ( "errors" "os" "syscall" ) type pollster struct { kq int eventbuf [10]syscall.Kevent_t ...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "errors" "io" ) // Pipe creates a synchronous, in-memory, full duplex // network connection; both ends implement the Conn interface. /...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Read static host/IP entries from /etc/hosts. package net import ( "sync" "time" ) const cacheMaxAge = 5 * time.Minute // hostsPath points to the file w...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Waiting for FDs via kqueue/kevent. package net import ( "os" "syscall" ) type pollster struct { kq int eventbuf [10]syscall.Kevent_t events [...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build openbsd // Stub cgo routines for systems that do not use cgo to do network lookups. package net func cgoLookupHost(name string) (addrs []string, e...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Waiting for FDs via kqueue/kevent. package net import ( "os" "syscall" ) type pollster struct { kq int eventbuf [10]syscall.Kevent_t events [...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux openbsd windows // (Raw) IP sockets package net import ( "errors" "os" "syscall" ) func sockaddrToIP(sa syscall.Sockaddr)...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Simple file i/o and string manipulation, to avoid // depending on strconv and bufio and strings. package net import ( "io" "os" ) type file struct { fi...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // (Raw) IP sockets package net // IPAddr represents the address of a IP end point. type IPAddr struct { IP IP } // Network returns the address's network n...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux openbsd windows // TCP sockets package net import ( "io" "os" "syscall" ) // BUG(rsc): On OpenBSD, listening on the "tcp"...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "errors" "os" ) func query(filename, query string, bufSize int) (res []string, err error) { file, err := os.OpenFile(filename, os.O_R...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "bytes" "fmt" "math/rand" "sort" ) // DNSError represents a DNS lookup error. type DNSError struct { Err string // description...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification package net import ( "bytes" "errors" "fmt" ) // A HardwareAddr represents a physical hardware address. type Hardware...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package net provides a portable interface to Unix networks sockets, // including TCP/IP, UDP, domain name resolution, and Unix domain sockets. package net /...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification for Linux package net import ( "fmt" "os" "syscall" "unsafe" ) // If the ifindex is zero, interfaceTable returns map...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification for Windows package net import ( "os" "syscall" "unsafe" ) func bytePtrToString(p *uint8) string { a := (*[10000]uin...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build plan9 // Network interface identification package net // If the ifindex is zero, interfaceTable returns mappings of all // network interfaces. Ot...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Network interface identification for FreeBSD package net import ( "os" "syscall" ) // If the ifindex is zero, interfaceMulticastAddrTable returns // ad...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package dict implements the Dictionary Server Protocol // as defined in RFC 2229. package dict import ( "net/textproto" "strconv" "strings" ) // A Clie...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "io" "os" "runtime" "sync" "syscall" "time" "unsafe" ) type InvalidConnError struct{} func (e *InvalidConnError) Error() string ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux openbsd windows package net import "syscall" // Should we try to use the IPv4 socket interface if we're // only dealing with ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net /* #include <netdb.h> */ import "C" func cgoAddrInfoMask() C.int { return C.AI_CANONNAME | C.AI_V4MAPPED | C.AI_ALL }
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Sockets for Linux package net import ( "syscall" ) func setKernelSpecificSockopt(s, f int) { // Allow reuse of recently-used addresses. syscall.Setsoc...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // DNS packet assembly. See RFC 1035. // // This is intended to support name resolution during net.Dial. // It doesn't have to be blazing fast. // // Rather th...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // UDP for Plan 9 package net import ( "errors" "os" ) // UDPConn is the implementation of the Conn and PacketConn // interfaces for UDP network connectio...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux openbsd package net import ( "io" "os" "sync" "syscall" "time" ) // Network file descriptor. type netFD struct { // lock...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "os" "syscall" ) func FileConn(f *os.File) (c Conn, err error) { // TODO: Implement this return nil, os.NewSyscallError("FileConn", s...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Unix domain sockets stubs for Plan 9 package net import ( "os" ) // UnixConn is an implementation of the Conn interface // for connections to Unix domai...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // IP address manipulations // // IPv4 addresses are 4 bytes; IPv6 addresses are 16 bytes. // An IPv4 address can be converted to an IPv6 address by // adding a...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Unix domain sockets package net // UnixAddr represents the address of a Unix domain socket end point. type UnixAddr struct { Name string Net string } ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package path implements utility routines for manipulating slash-separated // filename paths. package path import ( "strings" ) // Clean returns the shorte...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package filepath implements utility routines for manipulating filename paths // in a way compatible with the target operating system-defined file paths. pack...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filepath import ( "errors" "os" "sort" "strings" "unicode/utf8" ) var ErrBadPattern = errors.New("syntax error in pattern") // Match returns tru...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux openbsd package filepath import "strings" // IsAbs returns true if the path is absolute. func IsAbs(path string) bool { retur...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filepath import "strings" // IsAbs returns true if the path is absolute. func IsAbs(path string) bool { return strings.HasPrefix(path, "/") || string...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filepath import ( "strings" ) func isSlash(c uint8) bool { return c == '\\' || c == '/' } // IsAbs returns true if the path is absolute. func IsAbs...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package path import ( "errors" "strings" "unicode/utf8" ) var ErrBadPattern = errors.New("syntax error in pattern") // Match returns true if name matches ...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package utf16 implements encoding and decoding of UTF-16 sequences. package utf16 import "unicode" const ( // 0xd800-0xdc00 encodes the high 10 bits of a...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package unicode provides data and functions to test some properties of // Unicode code points. package unicode const ( MaxRune = '\U0010FFFF' // Ma...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package utf8 implements functions and constants to support text encoded in // UTF-8. This package calls a Unicode character a rune for brevity. package utf8 ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package utf8 import "errors" // String wraps a regular string with a small structure that provides more // efficient indexing by code point index, as opposed ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // TODO: This file contains the special casing rules for Turkish and Azeri only. // It should encompass all the languages with special casing rules // and be ge...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unicode // IsDigit reports whether the rune is a decimal digit. func IsDigit(r rune) bool { if r <= MaxLatin1 { return '0' <= r && r <= '9' } retu...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unicode // Bit masks for each code point under U+0100, for fast lookup. const ( pC = 1 << iota // a control character. pP // a punctuat...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Unicode table generator. // Data read from the web. package main import ( "bufio" "flag" "fmt" "io" "log" "net/http" "os" "path/filepath" "regexp"...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Input to cgo. GOARCH=amd64 cgo -cdefs defs.go >amd64/defs.h GOARCH=386 cgo -cdefs defs.go >386/defs.h */ package runtime /* #include <sys/types.h> #includ...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package cgo contains runtime support for code generated by the cgo tool. See the documentation for the cgo command for details on using cgo. */ package cgo...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package runtime // Sigrecv returns a bitmask of signals that have arrived since the last call to Sigrecv. // It blocks until at least one signal arrives. func ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Input to cgo. GOARCH=amd64 cgo -cdefs defs.go >amd64/defs.h GOARCH=386 cgo -cdefs defs.go >386/defs.h */ package runtime /* #include <sys/types.h> #includ...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Software IEEE754 64-bit floating point. // Only referred to (and thus linked in) by arm port // and by gotest in this directory. package runtime const ( ...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package pprof writes runtime profiling data in the format expected // by the pprof visualization tool. // For more information about pprof, see // http://co...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Input to cgo. GOARCH=amd64 cgo -cdefs defs.go >amd64/defs.h GOARCH=386 cgo -cdefs defs.go >386/defs.h */ package runtime /* #define __DARWIN_UNIX03 0 #inc...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package runtime import "unsafe" type MemStatsType struct { // General statistics. // Not locked during update; approximate. Alloc uint64 // bytes allo...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package runtime // Breakpoint() executes a breakpoint trap. func Breakpoint() // LockOSThread wires the calling goroutine to its current operating system thre...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package runtime // The Error interface identifies a run time error. type Error interface { error // RuntimeError is a no-op function but // serves to disti...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Input to cgo. GOARCH=amd64 cgo -cdefs defs.go >amd64/defs.h GOARCH=386 cgo -cdefs defs.go >386/defs.h */ package runtime /* #include <signal.h> #include <...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* * Runtime type representation. * * The following files know the exact layout of these * data structures and must be kept in sync with this file: * * .....
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* * Input to cgo -cdefs GOARCH=386 cgo -cdefs defs2.go >386/defs.h The asm header tricks we have to use for Linux on amd64 (see defs.c and defs1.c) don't wo...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Input to cgo -cdefs GOARCH=amd64 cgo -cdefs defs.go defs1.go >amd64/defs.h */ package runtime /* #include <ucontext.h> #include <fcntl.h> */ import "C" c...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Input to cgo -cdefs GOARCH=amd64 cgo -cdefs defs.go defs1.go >amd64/defs.h */ package runtime /* // Linux glibc and Linux kernel define different and conf...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Input to cgo. On a Debian Lenny arm linux distribution: cgo -cdefs defs_arm.c >arm/defs.h */ package runtime /* #cgo CFLAGS: -I/usr/src/linux-headers-2.6....
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package runtime contains operations that interact with Go's runtime system, such as functions to control goroutines. It also includes the low-level type in...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux openbsd // Socket control messages package syscall import ( "unsafe" ) // Round the length of a raw sockaddr up to align it...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Fork, exec, wait, etc. package syscall import ( "sync" "unsafe" ) // Lock synchronizing creation of new file descriptors with fork. // // We want the ch...
Go
// Copyright 2009,2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Darwin system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates s...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd openbsd // Berkeley packet filter for BSD variants package syscall import ( "unsafe" ) func BpfStmt(code, k int) *BpfInsn { retu...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package syscall func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimesp...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package syscall func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimesp...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package syscall
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Input to cgo -godefs. See also mkerrors.sh and mkall.sh */ // +build ignore // +godefs map struct_in_addr [4]byte /* in_addr */ // +godefs map struct_in6_...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package syscall const ARCH = "arm"
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package syscall const ( // Windows errors. ERROR_FILE_NOT_FOUND Errno = 2 ERROR_PATH_NOT_FOUND Errno = 3 ERROR_ACCESS_DENIED Errno = 5 ER...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Linux system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system ...
Go