import "syscall"
Package syscall contains an interface to the low-level operating system primitives. The details vary depending on the underlying system, and by default, godoc will display the syscall documentation for the current system. If you want godoc to display syscall documentation for another system, set $GOOS and $GOARCH to the desired system. For example, if you want to view documentation for freebsd/arm on linux/amd64, set $GOOS to freebsd and $GOARCH to arm. The primary use of syscall is inside other packages that provide a more portable interface to the system, such as "os", "time" and "net". Use those packages rather than this one if you can. For details of the functions and data types in this package consult the manuals for the appropriate operating system. These calls return err == nil to indicate success; otherwise err is an operating system error describing the failure. On most systems, that error has type syscall.Errno.
NOTE: This package is locked down. Code outside the standard Go repository should be migrated to use the corresponding package in the golang.org/x/sys repository. That is also where updates required by new systems or versions should be applied. See https://github.com/golang/go/blob/master/s/go1.4-syscall for more information.
dirent.go endian_little.go env_unix.go exec_linux.go exec_unix.go flock.go lsf_linux.go msan0.go netlink_linux.go setuidgid_linux.go sockcmsg_linux.go sockcmsg_unix.go str.go syscall.go syscall_linux.go syscall_linux_amd64.go syscall_unix.go timestruct.go zerrors_linux_amd64.go zsyscall_linux_amd64.go zsysnum_linux_amd64.go ztypes_linux_amd64.go
Errors
Signals
For testing: clients can set this flag to force creation of IPv6 sockets to return EAFNOSUPPORT.
Deprecated: Use golang.org/x/net/bpf instead.
BindToDevice binds the socket associated with fd to device.
BytePtrFromString returns a pointer to a NUL-terminated array of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL).
ByteSliceFromString returns a NUL-terminated slice of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL).
CmsgLen returns the value to store in the Len field of the Cmsghdr structure, taking into account any necessary alignment.
CmsgSpace returns the number of bytes an ancillary element with payload of the passed data length occupies.
Deprecated: Use golang.org/x/net/bpf instead.
Exec invokes the execve(2) system call.
FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
Combination of fork and exec, careful to be thread safe.
Deprecated: Use golang.org/x/net/bpf instead.
NetlinkRIB returns routing information base, as known as RIB, which consists of network facility information, states and parameters.
ParseDirent parses up to max directory entries in buf, appending the names to names. It returns the number of bytes consumed from buf, the number of entries added to names, and the new names slice.
ParseNetlinkMessage parses b as an array of netlink messages and returns the slice containing the NetlinkMessage structures.
ParseNetlinkRouteAttr parses m's payload as an array of netlink route attributes and returns the slice containing the NetlinkRouteAttr structures.
ParseSocketControlMessage parses b as an array of socket control messages.
ParseUnixRights decodes a socket control message that contains an integer array of open file descriptors from another process.
Deprecated: Use golang.org/x/net/bpf instead.
SlicePtrFromStrings converts a slice of strings to a slice of pointers to NUL-terminated byte arrays. If any string contains a NUL byte, it returns (nil, EINVAL).
StartProcess wraps ForkExec for package os.
StringBytePtr returns a pointer to a NUL-terminated array of bytes. If s contains a NUL byte this function panics instead of returning an error.
Deprecated: Use BytePtrFromString instead.
StringByteSlice converts a string to a NUL-terminated []byte, If s contains a NUL byte this function panics instead of returning an error.
Deprecated: Use ByteSliceFromString instead.
StringSlicePtr converts a slice of strings to a slice of pointers to NUL-terminated byte arrays. If any string contains a NUL byte this function panics instead of returning an error.
Deprecated: Use SlicePtrFromStrings instead.
TimespecToNsec converts a Timespec value into a number of nanoseconds since the Unix epoch.
TimevalToNsec converts a Timeval value into a number of nanoseconds since the Unix epoch.
UnixCredentials encodes credentials into a socket control message for sending to another process. This can be used for authentication.
UnixRights encodes a set of open file descriptors into a socket control message for sending to another process.
Credential holds user and group identities to be assumed by a child process started by StartProcess.
An Errno is an unsigned number describing an error condition. It implements the error interface. The zero Errno is by convention a non-error, so code to convert from Errno to error should use:
err = nil
if errno != 0 {
err = errno
}
NetlinkMessage represents a netlink message.
NetlinkRouteAttr represents a netlink route attribute.
NetlinkRouteRequest represents a request message to receive routing and link states from the kernel.
ProcAttr holds attributes that will be applied to a new process started by StartProcess.
A Signal is a number describing a process signal. It implements the os.Signal interface.
Deprecated: Use golang.org/x/net/bpf instead.
Deprecated: Use golang.org/x/net/bpf instead.
SocketControlMessage represents a socket control message.
SysProcIDMap holds Container ID to Host ID mappings used for User Namespaces in Linux. See user_namespaces(7).
NsecToTimespec takes a number of nanoseconds since the Unix epoch and returns the corresponding Timespec value.
NsecToTimeval takes a number of nanoseconds since the Unix epoch and returns the corresponding Timeval value.
ParseUnixCredentials decodes a socket control message that contains credentials in a Ucred structure. To receive such a message, the SO_PASSCRED option must be enabled on the socket.