Overview
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. Signal, Errno and SysProcAttr are not yet available in
golang.org/x/sys and must still be referenced from the syscall package. See
for more information.
Index
- Variables
- func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error)
- func Acct(path string) (err error)
- func AttachLsf(fd int, i []SockFilter) error
- func BindToDevice(fd int, device string) (err error)
- func ByteSliceFromString(s string) ([]byte, error)
- func Chmod(path string, mode uint32) (err error)
- func Chroot(path string) (err error)
- func Close(fd int) (err error)
- func CmsgLen(datalen int) int
- func Connect(fd int, sa Sockaddr) (err error)
- func DetachLsf(fd int) error
- func Dup2(oldfd int, newfd int) (err error)
- func Environ() []string
- func EpollCreate1(flag int) (fd int, err error)
- func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
- func Exit(code int)
- func Fallocate(fd int, mode uint32, off int64, len int64) (err error)
- func Fchmod(fd int, mode uint32) (err error)
- func Fchown(fd int, uid int, gid int) (err error)
- func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error
- func Flock(fd int, how int) (err error)
- func Fstat(fd int, stat *Stat_t) (err error)
- func Fsync(fd int) (err error)
- func Futimes(fd int, tv []Timeval) (err error)
- func Getcwd(buf []byte) (n int, err error)
- func Getegid() (egid int)
- func Geteuid() (euid int)
- func Getgroups() (gids []int, err error)
- func Getpgid(pid int) (pgid int, err error)
- func Getpid() (pid int)
- func Getpriority(which int, who int) (prio int, err error)
- func Getrusage(who int, rusage *Rusage) (err error)
- func GetsockoptInt(fd, level, opt int) (value int, err error)
- func Gettimeofday(tv *Timeval) (err error)
- func Getwd() (wd string, err error)
- func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)
- func InotifyInit1(flags int) (fd int, err error)
- func Ioperm(from int, num int, on int) (err error)
- func Kill(pid int, sig Signal) (err error)
- func Lchown(path string, uid int, gid int) (err error)
- func Listen(s int, n int) (err error)
- func LsfSocket(ifindex, proto int) (int, error)
- func Madvise(b []byte, advice int) (err error)
- func Mkdirat(dirfd int, path string, mode uint32) (err error)
- func Mknod(path string, mode uint32, dev int) (err error)
- func Mlock(b []byte) (err error)
- func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error)
- func Mprotect(b []byte, prot int) (err error)
- func Munlockall() (err error)
- func Nanosleep(time Timespec, leftover Timespec) (err error)
- func Open(path string, mode int, perm uint32) (fd int, err error)
- func ParseNetlinkMessage(b []byte) ([]NetlinkMessage, error)
- func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error)
- func Pause() (err error)
- func Pipe2(p []int, flags int) (err error)
- func Pread(fd int, p []byte, offset int64) (n int, err error)
- func PtraceCont(pid int, signal int) (err error)
- func PtraceGetEventMsg(pid int) (msg uint, err error)
- func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error)
- func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error)
- func PtraceSetOptions(pid int, options int) (err error)
- func PtraceSingleStep(pid int) (err error)
- func Pwrite(fd int, p []byte, offset int64) (n int, err error)
- func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
- func ReadDirent(fd int, buf []byte) (n int, err error)
- func Reboot(cmd int) (err error)
- func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error)
- func Rename(oldpath string, newpath string) (err error)
- func Rmdir(path string) error
- func Select(nfd int, r FdSet, w FdSet, e FdSet, timeout Timeval) (n int, err error)
- func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error)
- func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error)
- func SetNonblock(fd int, nonblocking bool) (err error)
- func Setenv(key, value string) error
- func Setfsuid(uid int) (err error)
- func Setgroups(gids []int) (err error)
- func Setpgid(pid int, pgid int) (err error)
- func Setregid(rgid int, egid int) (err error)
- func Setresuid(ruid int, euid int, suid int) (err error)
- func Setrlimit(resource int, rlim *Rlimit) (err error)
- func SetsockoptByte(fd, level, opt int, value byte) (err error)
- func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error)
- func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error)
- func SetsockoptInt(fd, level, opt int, value int) (err error)
- func SetsockoptString(fd, level, opt int, s string) (err error)
- func Settimeofday(tv *Timeval) (err error)
- func Setxattr(path string, attr string, data []byte, flags int) (err error)
- func SlicePtrFromStrings(ss []string) ([]*byte, error)
- func Socketpair(domain, typ, proto int) (fd [2]int, err error)
- func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error)
- func Statfs(path string, buf *Statfs_t) (err error)
- func StringByteSlice(s string) []byte
- func Symlink(oldpath string, newpath string) (err error)
- func SyncFileRange(fd int, off int64, n int64, flags int) (err error)
- func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
- func Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
- func Times(tms *Tms) (ticks uintptr, err error)
- func TimevalToNsec(tv Timeval) int64
- func Umask(mask int) (oldmask int)
- func UnixCredentials(ucred *Ucred) []byte
- func Unlink(path string) error
- func Unmount(target string, flags int) (err error)
- func Unshare(flags int) (err error)
- func Utime(path string, buf *Utimbuf) (err error)
- func UtimesNano(path string, ts []Timespec) (err error)
- type Cmsghdr
- type Conn
- type Dirent
- type Errno
- type FdSet
- type Fsid
- type IfInfomsg
- type Inet6Pktinfo
- type Iovec
- type Linger
- type NetlinkRouteAttr
- type NlAttr
- type NlMsghdr
- type PtraceRegs
- type RawSockaddr
- type RawSockaddrInet4
- type RawSockaddrLinklayer
- type RawSockaddrUnix
- type RtAttr
- type RtMsg
- type Rusage
- type SockFilter
- type Sockaddr
- type SockaddrInet6
- type SockaddrNetlink
- type SocketControlMessage
- type Statfs_t
- type SysProcIDMap
- type TCPInfo
- type Time_t
- type Timespec
- type Timeval
- type Timex
- type Ucred
- type Utimbuf
- type WaitStatus
dirent.go env_unix.go exec_unix.go lsf_linux.go net.go setuidgid_linux.go sockcmsg_unix.go syscall.go syscall_linux_amd64.go timestruct.go zsyscall_linux_amd64.go ztypes_linux_amd64.go
Constants
const ( E2BIG = (0x7) EACCES = Errno(0xd) EADDRINUSE = (0x62) EADDRNOTAVAIL = Errno(0x63) EADV = (0x44) EAFNOSUPPORT = Errno(0x61) EAGAIN = (0xb) EALREADY = Errno(0x72) EBADE = (0x34) EBADF = Errno(0x9) EBADFD = (0x4d) EBADMSG = Errno(0x4a) EBADR = (0x35) EBADRQC = Errno(0x38) EBADSLT = (0x39) EBFONT = Errno(0x3b) EBUSY = (0x10) ECANCELED = Errno(0x7d) ECHILD = (0xa) ECHRNG = Errno(0x2c) ECOMM = (0x46) ECONNABORTED = Errno(0x67) ECONNREFUSED = (0x6f) ECONNRESET = Errno(0x68) EDEADLK = (0x23) EDEADLOCK = Errno(0x23) EDESTADDRREQ = (0x59) EDOM = Errno(0x21) EDOTDOT = (0x49) EDQUOT = Errno(0x7a) EEXIST = (0x11) EFAULT = Errno(0xe) EFBIG = (0x1b) EHOSTDOWN = Errno(0x70) EHOSTUNREACH = (0x71) EIDRM = Errno(0x2b) EILSEQ = (0x54) EINPROGRESS = Errno(0x73) EINTR = (0x4) EINVAL = Errno(0x16) EIO = (0x5) EISCONN = Errno(0x6a) EISDIR = (0x15) EISNAM = Errno(0x78) EKEYEXPIRED = (0x7f) EKEYREJECTED = Errno(0x81) EKEYREVOKED = (0x80) EL2HLT = Errno(0x33) EL2NSYNC = (0x2d) EL3HLT = Errno(0x2e) EL3RST = (0x2f) ELIBACC = Errno(0x4f) ELIBBAD = (0x50) ELIBEXEC = Errno(0x53) ELIBMAX = (0x52) ELIBSCN = Errno(0x51) ELNRNG = (0x30) ELOOP = Errno(0x28) EMEDIUMTYPE = (0x7c) EMFILE = Errno(0x18) EMLINK = (0x1f) EMSGSIZE = Errno(0x5a) EMULTIHOP = (0x48) ENAMETOOLONG = Errno(0x24) ENAVAIL = (0x77) ENETDOWN = Errno(0x64) ENETRESET = (0x66) ENETUNREACH = Errno(0x65) ENFILE = (0x17) ENOANO = Errno(0x37) ENOBUFS = (0x69) ENOCSI = Errno(0x32) ENODATA = (0x3d) ENODEV = Errno(0x13) ENOENT = (0x2) ENOEXEC = Errno(0x8) ENOKEY = (0x7e) ENOLCK = Errno(0x25) ENOLINK = (0x43) ENOMEDIUM = Errno(0x7b) ENOMEM = (0xc) ENOMSG = Errno(0x2a) ENONET = (0x40) ENOPKG = Errno(0x41) ENOPROTOOPT = (0x5c) ENOSPC = Errno(0x1c) ENOSR = (0x3f) ENOSTR = Errno(0x3c) ENOSYS = (0x26) ENOTBLK = Errno(0xf) ENOTCONN = (0x6b) ENOTDIR = Errno(0x14) ENOTEMPTY = (0x27) ENOTNAM = Errno(0x76) ENOTRECOVERABLE = (0x83) ENOTSOCK = Errno(0x58) ENOTSUP = (0x5f) ENOTTY = Errno(0x19) ENOTUNIQ = (0x4c) ENXIO = Errno(0x6) EOPNOTSUPP = (0x5f) EOVERFLOW = Errno(0x4b) EOWNERDEAD = (0x82) EPERM = Errno(0x1) EPFNOSUPPORT = (0x60) EPIPE = Errno(0x20) EPROTO = (0x47) EPROTONOSUPPORT = Errno(0x5d) EPROTOTYPE = (0x5b) ERANGE = Errno(0x22) EREMCHG = (0x4e) EREMOTE = Errno(0x42) EREMOTEIO = (0x79) ERESTART = Errno(0x55) ERFKILL = (0x84) EROFS = Errno(0x1e) ESHUTDOWN = (0x6c) ESOCKTNOSUPPORT = Errno(0x5e) ESPIPE = (0x1d) ESRCH = Errno(0x3) ESRMNT = (0x45) ESTALE = Errno(0x74) ESTRPIPE = (0x56) ETIME = Errno(0x3e) ETIMEDOUT = (0x6e) ETOOMANYREFS = Errno(0x6d) ETXTBSY = (0x1a) EUCLEAN = Errno(0x75) EUNATCH = (0x31) EUSERS = Errno(0x57) EWOULDBLOCK = (0xb) EXDEV = Errno(0x12) EXFULL = (0x36) )
Errors
const ( SIGABRT = Signal(0x6) SIGALRM = (0xe) SIGBUS = Signal(0x7) SIGCHLD = (0x11) SIGCLD = Signal(0x11) SIGCONT = (0x12) SIGFPE = Signal(0x8) SIGHUP = (0x1) SIGILL = Signal(0x4) SIGINT = (0x2) SIGIO = Signal(0x1d) SIGIOT = (0x6) SIGKILL = Signal(0x9) SIGPIPE = (0xd) SIGPOLL = Signal(0x1d) SIGPROF = (0x1b) SIGPWR = Signal(0x1e) SIGQUIT = (0x3) SIGSEGV = Signal(0xb) SIGSTKFLT = (0x10) SIGSTOP = Signal(0x13) SIGSYS = (0x1f) SIGTERM = Signal(0xf) SIGTRAP = (0x5) SIGTSTP = Signal(0x14) SIGTTIN = (0x15) SIGTTOU = Signal(0x16) SIGUNUSED = (0x1f) SIGURG = Signal(0x17) SIGUSR1 = (0xa) SIGUSR2 = Signal(0xc) SIGVTALRM = (0x1a) SIGWINCH = Signal(0x1c) SIGXCPU = (0x18) SIGXFSZ = Signal(0x19) )
Signals
const ( SYS_READ = 0 SYS_WRITE = 1 SYS_OPEN = 2 SYS_CLOSE = 3 SYS_STAT = 4 SYS_FSTAT = 5 SYS_LSTAT = 6 SYS_POLL = 7 SYS_LSEEK = 8 SYS_MMAP = 9 SYS_MPROTECT = 10 SYS_MUNMAP = 11 SYS_BRK = 12 SYS_RT_SIGACTION = 13 SYS_RT_SIGPROCMASK = 14 SYS_RT_SIGRETURN = 15 SYS_IOCTL = 16 SYS_PREAD64 = 17 SYS_PWRITE64 = 18 SYS_READV = 19 SYS_WRITEV = 20 SYS_ACCESS = 21 SYS_PIPE = 22 SYS_SELECT = 23 SYS_SCHED_YIELD = 24 SYS_MREMAP = 25 SYS_MSYNC = 26 SYS_MINCORE = 27 SYS_MADVISE = 28 SYS_SHMGET = 29 SYS_SHMAT = 30 SYS_SHMCTL = 31 SYS_DUP = 32 SYS_DUP2 = 33 SYS_PAUSE = 34 SYS_NANOSLEEP = 35 SYS_GETITIMER = 36 SYS_ALARM = 37 SYS_SETITIMER = 38 SYS_GETPID = 39 SYS_SENDFILE = 40 SYS_SOCKET = 41 SYS_CONNECT = 42 SYS_ACCEPT = 43 SYS_SENDTO = 44 SYS_RECVFROM = 45 SYS_SENDMSG = 46 SYS_RECVMSG = 47 SYS_SHUTDOWN = 48 SYS_BIND = 49 SYS_LISTEN = 50 SYS_GETSOCKNAME = 51 SYS_GETPEERNAME = 52 SYS_SOCKETPAIR = 53 SYS_SETSOCKOPT = 54 SYS_GETSOCKOPT = 55 SYS_CLONE = 56 SYS_FORK = 57 SYS_VFORK = 58 SYS_EXECVE = 59 SYS_EXIT = 60 SYS_WAIT4 = 61 SYS_KILL = 62 SYS_UNAME = 63 SYS_SEMGET = 64 SYS_SEMOP = 65 SYS_SEMCTL = 66 SYS_SHMDT = 67 SYS_MSGGET = 68 SYS_MSGSND = 69 SYS_MSGRCV = 70 SYS_MSGCTL = 71 SYS_FCNTL = 72 SYS_FLOCK = 73 SYS_FSYNC = 74 SYS_FDATASYNC = 75 SYS_TRUNCATE = 76 SYS_FTRUNCATE = 77 SYS_GETDENTS = 78 SYS_GETCWD = 79 SYS_CHDIR = 80 SYS_FCHDIR = 81 SYS_RENAME = 82 SYS_MKDIR = 83 SYS_RMDIR = 84 SYS_CREAT = 85 SYS_LINK = 86 SYS_UNLINK = 87 SYS_SYMLINK = 88 SYS_READLINK = 89 SYS_CHMOD = 90 SYS_FCHMOD = 91 SYS_CHOWN = 92 SYS_FCHOWN = 93 SYS_LCHOWN = 94 SYS_UMASK = 95 SYS_GETTIMEOFDAY = 96 SYS_GETRLIMIT = 97 SYS_GETRUSAGE = 98 SYS_SYSINFO = 99 SYS_TIMES = 100 SYS_PTRACE = 101 SYS_GETUID = 102 SYS_SYSLOG = 103 SYS_GETGID = 104 SYS_SETUID = 105 SYS_SETGID = 106 SYS_GETEUID = 107 SYS_GETEGID = 108 SYS_SETPGID = 109 SYS_GETPPID = 110 SYS_GETPGRP = 111 SYS_SETSID = 112 SYS_SETREUID = 113 SYS_SETREGID = 114 SYS_GETGROUPS = 115 SYS_SETGROUPS = 116 SYS_SETRESUID = 117 SYS_GETRESUID = 118 SYS_SETRESGID = 119 SYS_GETRESGID = 120 SYS_GETPGID = 121 SYS_SETFSUID = 122 SYS_SETFSGID = 123 SYS_GETSID = 124 SYS_CAPGET = 125 SYS_CAPSET = 126 SYS_RT_SIGPENDING = 127 SYS_RT_SIGTIMEDWAIT = 128 SYS_RT_SIGQUEUEINFO = 129 SYS_RT_SIGSUSPEND = 130 SYS_SIGALTSTACK = 131 SYS_UTIME = 132 SYS_MKNOD = 133 SYS_USELIB = 134 SYS_PERSONALITY = 135 SYS_USTAT = 136 SYS_STATFS = 137 SYS_FSTATFS = 138 SYS_SYSFS = 139 SYS_GETPRIORITY = 140 SYS_SETPRIORITY = 141 SYS_SCHED_SETPARAM = 142 SYS_SCHED_GETPARAM = 143 SYS_SCHED_SETSCHEDULER = 144 SYS_SCHED_GETSCHEDULER = 145 SYS_SCHED_GET_PRIORITY_MAX = 146 SYS_SCHED_GET_PRIORITY_MIN = 147 SYS_SCHED_RR_GET_INTERVAL = 148 SYS_MLOCK = 149 SYS_MUNLOCK = 150 SYS_MLOCKALL = 151 SYS_MUNLOCKALL = 152 SYS_VHANGUP = 153 SYS_MODIFY_LDT = 154 SYS_PIVOT_ROOT = 155 SYS__SYSCTL = 156 SYS_PRCTL = 157 SYS_ARCH_PRCTL = 158 SYS_ADJTIMEX = 159 SYS_SETRLIMIT = 160 SYS_CHROOT = 161 SYS_SYNC = 162 SYS_ACCT = 163 SYS_SETTIMEOFDAY = 164 SYS_MOUNT = 165 SYS_UMOUNT2 = 166 SYS_SWAPON = 167 SYS_SWAPOFF = 168 SYS_REBOOT = 169 SYS_SETHOSTNAME = 170 SYS_SETDOMAINNAME = 171 SYS_IOPL = 172 SYS_IOPERM = 173 SYS_CREATE_MODULE = 174 SYS_INIT_MODULE = 175 SYS_DELETE_MODULE = 176 SYS_GET_KERNEL_SYMS = 177 SYS_QUERY_MODULE = 178 SYS_QUOTACTL = 179 SYS_NFSSERVCTL = 180 SYS_GETPMSG = 181 SYS_PUTPMSG = 182 SYS_AFS_SYSCALL = 183 SYS_TUXCALL = 184 SYS_SECURITY = 185 SYS_GETTID = 186 SYS_READAHEAD = 187 SYS_SETXATTR = 188 SYS_LSETXATTR = 189 SYS_FSETXATTR = 190 SYS_GETXATTR = 191 SYS_LGETXATTR = 192 SYS_FGETXATTR = 193 SYS_LISTXATTR = 194 SYS_LLISTXATTR = 195 SYS_FLISTXATTR = 196 SYS_REMOVEXATTR = 197 SYS_LREMOVEXATTR = 198 SYS_FREMOVEXATTR = 199 SYS_TKILL = 200 SYS_TIME = 201 SYS_FUTEX = 202 SYS_SCHED_SETAFFINITY = 203 SYS_SCHED_GETAFFINITY = 204 SYS_SET_THREAD_AREA = 205 SYS_IO_SETUP = 206 SYS_IO_DESTROY = 207 SYS_IO_GETEVENTS = 208 SYS_IO_SUBMIT = 209 SYS_IO_CANCEL = 210 SYS_GET_THREAD_AREA = 211 SYS_LOOKUP_DCOOKIE = 212 SYS_EPOLL_CREATE = 213 SYS_EPOLL_CTL_OLD = 214 SYS_EPOLL_WAIT_OLD = 215 SYS_REMAP_FILE_PAGES = 216 SYS_GETDENTS64 = 217 SYS_SET_TID_ADDRESS = 218 SYS_RESTART_SYSCALL = 219 SYS_SEMTIMEDOP = 220 SYS_FADVISE64 = 221 SYS_TIMER_CREATE = 222 SYS_TIMER_SETTIME = 223 SYS_TIMER_GETTIME = 224 SYS_TIMER_GETOVERRUN = 225 SYS_TIMER_DELETE = 226 SYS_CLOCK_SETTIME = 227 SYS_CLOCK_GETTIME = 228 SYS_CLOCK_GETRES = 229 SYS_CLOCK_NANOSLEEP = 230 SYS_EXIT_GROUP = 231 SYS_EPOLL_WAIT = 232 SYS_EPOLL_CTL = 233 SYS_TGKILL = 234 SYS_UTIMES = 235 SYS_VSERVER = 236 SYS_MBIND = 237 SYS_SET_MEMPOLICY = 238 SYS_GET_MEMPOLICY = 239 SYS_MQ_OPEN = 240 SYS_MQ_UNLINK = 241 SYS_MQ_TIMEDSEND = 242 SYS_MQ_TIMEDRECEIVE = 243 SYS_MQ_NOTIFY = 244 SYS_MQ_GETSETATTR = 245 SYS_KEXEC_LOAD = 246 SYS_WAITID = 247 SYS_ADD_KEY = 248 SYS_REQUEST_KEY = 249 SYS_KEYCTL = 250 SYS_IOPRIO_SET = 251 SYS_IOPRIO_GET = 252 SYS_INOTIFY_INIT = 253 SYS_INOTIFY_ADD_WATCH = 254 SYS_INOTIFY_RM_WATCH = 255 SYS_MIGRATE_PAGES = 256 SYS_OPENAT = 257 SYS_MKDIRAT = 258 SYS_MKNODAT = 259 SYS_FCHOWNAT = 260 SYS_FUTIMESAT = 261 SYS_NEWFSTATAT = 262 SYS_UNLINKAT = 263 SYS_RENAMEAT = 264 SYS_LINKAT = 265 SYS_SYMLINKAT = 266 SYS_READLINKAT = 267 SYS_FCHMODAT = 268 SYS_FACCESSAT = 269 SYS_PSELECT6 = 270 SYS_PPOLL = 271 SYS_UNSHARE = 272 SYS_SET_ROBUST_LIST = 273 SYS_GET_ROBUST_LIST = 274 SYS_SPLICE = 275 SYS_TEE = 276 SYS_SYNC_FILE_RANGE = 277 SYS_VMSPLICE = 278 SYS_MOVE_PAGES = 279 SYS_UTIMENSAT = 280 SYS_EPOLL_PWAIT = 281 SYS_SIGNALFD = 282 SYS_TIMERFD_CREATE = 283 SYS_EVENTFD = 284 SYS_FALLOCATE = 285 SYS_TIMERFD_SETTIME = 286 SYS_TIMERFD_GETTIME = 287 SYS_ACCEPT4 = 288 SYS_SIGNALFD4 = 289 SYS_EVENTFD2 = 290 SYS_EPOLL_CREATE1 = 291 SYS_DUP3 = 292 SYS_PIPE2 = 293 SYS_INOTIFY_INIT1 = 294 SYS_PREADV = 295 SYS_PWRITEV = 296 SYS_RT_TGSIGQUEUEINFO = 297 SYS_PERF_EVENT_OPEN = 298 SYS_RECVMMSG = 299 SYS_FANOTIFY_INIT = 300 SYS_FANOTIFY_MARK = 301 SYS_PRLIMIT64 = 302 )
const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x70 SizeofSockaddrUnix = 0x6e SizeofSockaddrLinklayer = 0x14 SizeofSockaddrNetlink = 0xc SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 SizeofInet4Pktinfo = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 )
const ( IFA_UNSPEC = 0x0 IFA_ADDRESS = 0x1 IFA_LOCAL = 0x2 IFA_LABEL = 0x3 IFA_BROADCAST = 0x4 IFA_ANYCAST = 0x5 IFA_CACHEINFO = 0x6 IFA_MULTICAST = 0x7 IFLA_UNSPEC = 0x0 IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 IFLA_STATS = 0x7 IFLA_COST = 0x8 IFLA_PRIORITY = 0x9 IFLA_MASTER = 0xa IFLA_WIRELESS = 0xb IFLA_PROTINFO = 0xc IFLA_TXQLEN = 0xd IFLA_MAP = 0xe IFLA_WEIGHT = 0xf IFLA_OPERSTATE = 0x10 IFLA_LINKMODE = 0x11 IFLA_LINKINFO = 0x12 IFLA_NET_NS_PID = 0x13 IFLA_IFALIAS = 0x14 IFLA_MAX = 0x1d RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd RT_SCOPE_HOST = 0xfe RT_SCOPE_NOWHERE = 0xff RT_TABLE_UNSPEC = 0x0 RT_TABLE_COMPAT = 0xfc RT_TABLE_DEFAULT = 0xfd RT_TABLE_MAIN = 0xfe RT_TABLE_LOCAL = 0xff RT_TABLE_MAX = 0xffffffff RTA_UNSPEC = 0x0 RTA_DST = 0x1 RTA_SRC = 0x2 RTA_IIF = 0x3 RTA_OIF = 0x4 RTA_GATEWAY = 0x5 RTA_PRIORITY = 0x6 RTA_PREFSRC = 0x7 RTA_METRICS = 0x8 RTA_MULTIPATH = 0x9 RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 RTN_BROADCAST = 0x3 RTN_ANYCAST = 0x4 RTN_MULTICAST = 0x5 RTN_BLACKHOLE = 0x6 RTN_UNREACHABLE = 0x7 RTN_PROHIBIT = 0x8 RTN_THROW = 0x9 RTN_NAT = 0xa RTN_XRESOLVE = 0xb RTNLGRP_NONE = 0x0 RTNLGRP_LINK = 0x1 RTNLGRP_NOTIFY = 0x2 RTNLGRP_NEIGH = 0x3 RTNLGRP_TC = 0x4 RTNLGRP_IPV4_IFADDR = 0x5 RTNLGRP_IPV4_MROUTE = 0x6 RTNLGRP_IPV4_ROUTE = 0x7 RTNLGRP_IPV4_RULE = 0x8 RTNLGRP_IPV6_IFADDR = 0x9 RTNLGRP_IPV6_MROUTE = 0xa RTNLGRP_IPV6_ROUTE = 0xb RTNLGRP_IPV6_IFINFO = 0xc RTNLGRP_IPV6_PREFIX = 0x12 RTNLGRP_IPV6_RULE = 0x13 RTNLGRP_ND_USEROPT = 0x14 SizeofNlMsghdr = 0x10 SizeofNlMsgerr = 0x14 SizeofRtGenmsg = 0x1 SizeofNlAttr = 0x4 SizeofRtAttr = 0x4 SizeofIfInfomsg = 0x10 SizeofIfAddrmsg = 0x8 SizeofRtMsg = 0xc SizeofRtNexthop = 0x8 )
const ( SizeofSockFilter = 0x8 SizeofSockFprog = 0x10 )
const ( VINTR = 0x0 VQUIT = 0x1 VERASE = 0x2 VKILL = 0x3 VEOF = 0x4 VTIME = 0x5 VMIN = 0x6 VSWTC = 0x7 VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VEOL = 0xb VREPRINT = 0xc VDISCARD = 0xd VWERASE = 0xe VLNEXT = 0xf VEOL2 = 0x10 IGNBRK = 0x1 BRKINT = 0x2 IGNPAR = 0x4 PARMRK = 0x8 INPCK = 0x10 ISTRIP = 0x20 INLCR = 0x40 IGNCR = 0x80 ICRNL = 0x100 IUCLC = 0x200 IXON = 0x400 IXANY = 0x800 IXOFF = 0x1000 IMAXBEL = 0x2000 IUTF8 = 0x4000 OPOST = 0x1 OLCUC = 0x2 ONLCR = 0x4 OCRNL = 0x8 ONOCR = 0x10 ONLRET = 0x20 OFILL = 0x40 OFDEL = 0x80 B0 = 0x0 B50 = 0x1 B75 = 0x2 B110 = 0x3 B134 = 0x4 B150 = 0x5 B200 = 0x6 B300 = 0x7 B600 = 0x8 B1200 = 0x9 B1800 = 0xa B2400 = 0xb B4800 = 0xc B9600 = 0xd B19200 = 0xe B38400 = 0xf CSIZE = 0x30 CS5 = 0x0 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSTOPB = 0x40 CREAD = 0x80 PARENB = 0x100 PARODD = 0x200 HUPCL = 0x400 CLOCAL = 0x800 B57600 = 0x1001 B115200 = 0x1002 B230400 = 0x1003 B460800 = 0x1004 B500000 = 0x1005 B576000 = 0x1006 B921600 = 0x1007 B1000000 = 0x1008 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f ISIG = 0x1 ICANON = 0x2 XCASE = 0x4 ECHO = 0x8 ECHOE = 0x10 ECHOK = 0x20 ECHONL = 0x40 NOFLSH = 0x80 TOSTOP = 0x100 ECHOCTL = 0x200 ECHOPRT = 0x400 ECHOKE = 0x800 FLUSHO = 0x1000 PENDIN = 0x4000 IEXTEN = 0x8000 TCGETS = 0x5401 TCSETS = 0x5402 )
const ImplementsGetwd =
const (
PathMax = 0x1000
)
const SizeofInotifyEvent = 0x10
Variables
var ( Stdin = 0 Stdout = 1 Stderr = 2 )
var ForkLock sync.
var SocketDisableIPv6 bool
For testing: clients can set this flag to force creation of IPv6 sockets to
return EAFNOSUPPORT.
func
¶
func Accept(fd ) (nfd int, sa , err error)
func
¶
func Accept4(fd , flags int) (nfd , sa Sockaddr, err )
func Access
func Access(path string, mode ) (err error)
func
¶
func Acct(path ) (err error)
func
¶
func Adjtimex(buf *) (state int, err )
func AttachLsf
func AttachLsf(fd int, i []) error
Deprecated: Use golang.org/x/net/bpf instead.
func
¶
func Bind(fd , sa Sockaddr) (err )
func BindToDevice
func BindToDevice(fd int, device ) (err error)
BindToDevice binds the socket associated with fd to device.
func
¶
func BytePtrFromString(s ) (*byte, )
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).
func ByteSliceFromString
func ByteSliceFromString(s string) ([], error)
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).
func
¶
func Chdir(path ) (err error)
func
¶
func Chmod(path , mode uint32) (err )
func Chown
func Chown(path string, uid , gid int) (err )
func Chroot
func Chroot(path string) (err )
func Clearenv
func Clearenv()
func Close
func Close(fd int) (err )
func CloseOnExec
func CloseOnExec(fd int)
func
¶
func CmsgLen(datalen ) int
CmsgLen returns the value to store in the Len field of the Cmsghdr structure,
taking into account any necessary alignment.
func
¶
func CmsgSpace(datalen ) int
CmsgSpace returns the number of bytes an ancillary element with payload of the
passed data length occupies.
func
¶
func Connect(fd , sa Sockaddr) (err )
func Creat
func Creat(path string, mode ) (fd int, err )
func DetachLsf
func DetachLsf(fd int)
Deprecated: Use golang.org/x/net/bpf instead.
func Dup
func Dup(oldfd int) (fd , err error)
func
¶
func Dup2(oldfd , newfd int) (err )
func Dup3
func Dup3(oldfd int, newfd , flags int) (err )
func Environ
func Environ() []string
func
¶
func EpollCreate(size ) (fd int, err )
func EpollCreate1
func EpollCreate1(flag int) (fd , err error)
func
¶
func EpollCtl(epfd , op int, fd , event *EpollEvent) (err )
func EpollWait
func EpollWait(epfd int, events [], msec int) (n , err error)
func
¶
func Exec(argv0 , argv []string, envv []) (err error)
Exec invokes the execve(2) system call.
func
¶
func Exit(code )
func Faccessat
func Faccessat(dirfd int, path , mode uint32, flags ) (err error)
func
¶
func Fallocate(fd , mode uint32, off , len int64) (err )
func Fchdir
func Fchdir(fd int) (err )
func Fchmod
func Fchmod(fd int, mode ) (err error)
func
¶
func Fchmodat(dirfd , path string, mode , flags int) (err )
func Fchown
func Fchown(fd int, uid , gid int) (err )
func Fchownat
func Fchownat(dirfd int, path , uid int, gid , flags int) (err )
func FcntlFlock
func FcntlFlock(fd uintptr, cmd , lk *Flock_t)
FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW
command.
func Fdatasync
func Fdatasync(fd int) (err )
func Flock
func Flock(fd int, how ) (err error)
func
¶
func ForkExec(argv0 , argv []string, attr *) (pid int, err )
Combination of fork and exec, careful to be thread safe.
func Fstat
func Fstat(fd int, stat *) (err error)
func
¶
func Fstatfs(fd , buf *Statfs_t) (err )
func Fsync
func Fsync(fd int) (err )
func Ftruncate
func Ftruncate(fd int, length ) (err error)
func
¶
func Futimes(fd , tv []Timeval) (err )
func Futimesat
func Futimesat(dirfd int, path , tv []Timeval) (err )
func Getcwd
func Getcwd(buf []byte) (n , err error)
func
¶
func Getdents(fd , buf []byte) (n , err error)
func
¶
func Getegid() (egid )
func Getenv
func Getenv(key string) (value , found bool)
func
¶
func Geteuid() (euid )
func Getgid
func Getgid() (gid int)
func
¶
func Getgroups() (gids [], err error)
func
¶
func Getpagesize()
func Getpgid
func Getpgid(pid int) (pgid , err error)
func
¶
func Getpgrp() (pid )
func Getpid
func Getpid() (pid int)
func
¶
func Getppid() (ppid )
func Getpriority
func Getpriority(which int, who ) (prio int, err )
func Getrlimit
func Getrlimit(resource int, rlim *) (err error)
func
¶
func Getrusage(who , rusage *Rusage) (err )
func GetsockoptInet4Addr
func GetsockoptInet4Addr(fd, level, opt int) (value [4], err error)
func
¶
func GetsockoptInt(fd, level, opt ) (value int, err )
func Gettid
func Gettid() (tid int)
func
¶
func Gettimeofday(tv *) (err error)
func
¶
func Getuid() (uid )
func Getwd
func Getwd() (wd string, err )
func Getxattr
func Getxattr(path string, attr , dest []byte) (sz , err error)
func
¶
func InotifyAddWatch(fd , pathname string, mask ) (watchdesc int, err )
func InotifyInit
func InotifyInit() (fd int, err )
func InotifyInit1
func InotifyInit1(flags int) (fd , err error)
func
¶
func InotifyRmWatch(fd , watchdesc uint32) (success , err error)
func
¶
func Ioperm(from , num int, on ) (err error)
func
¶
func Iopl(level ) (err error)
func
¶
func Kill(pid , sig Signal) (err )
func Klogctl
func Klogctl(typ int, buf []) (n int, err )
func Lchown
func Lchown(path string, uid , gid int) (err )
func Link
func Link(oldpath string, newpath ) (err error)
func
¶
func Listen(s , n int) (err )
func Listxattr
func Listxattr(path string, dest []) (sz int, err )
func LsfSocket
func LsfSocket(ifindex, proto int) (, error)
Deprecated: Use golang.org/x/net/bpf instead.
func
¶
func Lstat(path , stat *Stat_t) (err )
func Madvise
func Madvise(b []byte, advice ) (err error)
func
¶
func Mkdir(path , mode uint32) (err )
func Mkdirat
func Mkdirat(dirfd int, path , mode uint32) (err )
func Mkfifo
func Mkfifo(path string, mode ) (err error)
func
¶
func Mknod(path , mode uint32, dev ) (err error)
func
¶
func Mknodat(dirfd , path string, mode , dev int) (err )
func Mlock(b []byte) (err )
func Mlockall
func Mlockall(flags int) (err )
func Mmap
func Mmap(fd int, offset , length int, prot , flags int) (data [], err error)
func
¶
func Mount(source , target string, fstype , flags uintptr, data ) (err error)
func
¶
func Mprotect(b [], prot int) (err )
func Munlock
func Munlock(b []byte) (err )
func Munlockall
func Munlockall() (err error)
func
¶
func
¶
func Nanosleep(time *, leftover *Timespec) (err )
func NetlinkRIB
func NetlinkRIB(proto, family int) ([], error)
NetlinkRIB returns routing information base, as known as RIB, which consists of
network facility information, states and parameters.
func
¶
func Open(path , mode int, perm ) (fd int, err )
func Openat
func Openat(dirfd int, path , flags int, mode ) (fd int, err )
func ParseDirent
func ParseDirent(buf []byte, max , names []string) (consumed , count int, newnames [])
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.
func ParseNetlinkMessage
func ParseNetlinkMessage(b []byte) ([], error)
ParseNetlinkMessage parses b as an array of netlink messages and returns the
slice containing the NetlinkMessage structures.
func
¶
func ParseNetlinkRouteAttr(m *) ([]NetlinkRouteAttr, )
ParseNetlinkRouteAttr parses m’s payload as an array of netlink route attributes
and returns the slice containing the NetlinkRouteAttr structures.
func ParseSocketControlMessage
func ParseSocketControlMessage(b []byte) ([], error)
ParseSocketControlMessage parses b as an array of socket control messages.
func
¶
func ParseUnixRights(m *) ([]int, )
ParseUnixRights decodes a socket control message that contains an integer array
of open file descriptors from another process.
func Pause
func Pause() (err error)
func
¶
func Pipe(p []) (err error)
func
¶
func Pipe2(p [], flags int) (err )
func PivotRoot
func PivotRoot(newroot string, putold ) (err error)
func
¶
func Pread(fd , p []byte, offset ) (n int, err )
func PtraceAttach
func PtraceAttach(pid int) (err )
func PtraceCont
func PtraceCont(pid int, signal ) (err error)
func
¶
func PtraceDetach(pid ) (err error)
func
¶
func PtraceGetEventMsg(pid ) (msg uint, err )
func PtraceGetRegs
func PtraceGetRegs(pid int, regsout *) (err error)
func
¶
func PtracePeekData(pid , addr uintptr, out []) (count int, err )
func PtracePeekText
func PtracePeekText(pid int, addr , out []byte) (count , err error)
func
¶
func PtracePokeData(pid , addr uintptr, data []) (count int, err )
func PtracePokeText
func PtracePokeText(pid int, addr , data []byte) (count , err error)
func
¶
func PtraceSetOptions(pid , options int) (err )
func PtraceSetRegs
func PtraceSetRegs(pid int, regs *) (err error)
func
¶
func PtraceSingleStep(pid ) (err error)
func
¶
func PtraceSyscall(pid , signal int) (err )
func Pwrite
func Pwrite(fd int, p [], offset int64) (n , err error)
func
¶
func RawSyscall(trap, a1, a2, a3 ) (r1, r2 uintptr, err )
func RawSyscall6
func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 , err Errno)
func
¶
func Read(fd , p []byte) (n , err error)
func
¶
func ReadDirent(fd , buf []byte) (n , err error)
func
¶
func Readlink(path , buf []byte) (n , err error)
func
¶
func Reboot(cmd ) (err error)
func
¶
func Recvfrom(fd , p []byte, flags ) (n int, from , err error)
func
¶
func Recvmsg(fd , p, oob []byte, flags ) (n, oobn int, recvflags , from Sockaddr, err )
func Removexattr
func Removexattr(path string, attr ) (err error)
func
¶
func Rename(oldpath , newpath string) (err )
func Renameat
func Renameat(olddirfd int, oldpath , newdirfd int, newpath ) (err error)
func
¶
func Rmdir(path ) error
func
¶
func Seek(fd , offset int64, whence ) (off int64, err )
func Select
func Select(nfd int, r *, w *FdSet, e *, timeout *Timeval) (n , err error)
func
¶
func Sendfile(outfd , infd int, offset *, count int) (written , err error)
func
¶
func Sendmsg(fd , p, oob []byte, to , flags int) (err )
func SendmsgN
func SendmsgN(fd int, p, oob [], to Sockaddr, flags ) (n int, err )
func Sendto
func Sendto(fd int, p [], flags int, to ) (err error)
func
¶
func SetLsfPromisc(name , m bool)
Deprecated: Use golang.org/x/net/bpf instead.
func SetNonblock
func SetNonblock(fd int, nonblocking ) (err error)
func
¶
func Setdomainname(p []) (err error)
func
¶
func Setenv(key, value ) error
func
¶
func Setfsgid(gid ) (err error)
func
¶
func Setfsuid(uid ) (err error)
func
¶
func Setgid(gid ) (err error)
func
¶
func Setgroups(gids []) (err error)
func
¶
func Sethostname(p []) (err error)
func
¶
func Setpgid(pid , pgid int) (err )
func Setpriority
func Setpriority(which int, who , prio int) (err )
func Setregid
func Setregid(rgid int, egid ) (err error)
func
¶
func Setresgid(rgid , egid int, sgid ) (err error)
func
¶
func Setresuid(ruid , euid int, suid ) (err error)
func
¶
func Setreuid(ruid , euid int) (err )
func Setrlimit
func Setrlimit(resource int, rlim *) (err error)
func
¶
func Setsid() (pid , err error)
func
¶
func SetsockoptByte(fd, level, opt , value byte) (err )
func SetsockoptICMPv6Filter
func SetsockoptICMPv6Filter(fd, level, opt int, filter *) error
func
¶
func SetsockoptIPMreq(fd, level, opt , mreq *IPMreq) (err )
func SetsockoptIPMreqn
func SetsockoptIPMreqn(fd, level, opt int, mreq *) (err error)
func
¶
func SetsockoptIPv6Mreq(fd, level, opt , mreq *IPv6Mreq) (err )
func SetsockoptInet4Addr
func SetsockoptInet4Addr(fd, level, opt int, value [4]) (err error)
func
¶
func SetsockoptInt(fd, level, opt , value int) (err )
func SetsockoptLinger
func SetsockoptLinger(fd, level, opt int, l *) (err error)
func
¶
func SetsockoptString(fd, level, opt , s string) (err )
func SetsockoptTimeval
func SetsockoptTimeval(fd, level, opt int, tv *) (err error)
func
¶
func Settimeofday(tv *) (err error)
func
¶
func Setuid(uid ) (err error)
func
¶
func Setxattr(path , attr string, data [], flags int) (err )
func Shutdown
func Shutdown(fd int, how ) (err error)
func
¶
func SlicePtrFromStrings(ss []) ([]*byte, )
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).
func Socket
func Socket(domain, typ, proto int) (fd , err error)
func
¶
func Socketpair(domain, typ, proto ) (fd [2]int, err )
func Splice
func Splice(rfd int, roff *, wfd int, woff *, len int, flags ) (n int64, err )
func StartProcess
func StartProcess(argv0 string, argv [], attr *ProcAttr) (pid , handle uintptr, err )
StartProcess wraps ForkExec for package os.
func Stat
func Stat(path string, stat *) (err error)
func
¶
func Statfs(path , buf *Statfs_t) (err )
func StringBytePtr
func StringBytePtr(s string) *
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.
func StringByteSlice
func StringByteSlice(s string) []
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.
func StringSlicePtr
func StringSlicePtr(ss []string) []*
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.
func Symlink
func Symlink(oldpath string, newpath ) (err error)
func Sync()
func
¶
func SyncFileRange(fd , off int64, n , flags int) (err )
func Syscall
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 , err Errno)
func
¶
func Syscall6(trap, a1, a2, a3, a4, a5, a6 ) (r1, r2 uintptr, err )
func Sysinfo
func Sysinfo(info *Sysinfo_t) (err )
func Tee
func Tee(rfd int, wfd , len int, flags ) (n int64, err )
func Tgkill
func Tgkill(tgid int, tid , sig Signal) (err )
func Times
func Times(tms *Tms) (ticks , err error)
func
¶
func TimespecToNsec(ts ) int64
TimespecToNsec converts a Timespec value into a number of nanoseconds since the
Unix epoch.
func
¶
func TimevalToNsec(tv ) int64
TimevalToNsec converts a Timeval value into a number of nanoseconds since the
Unix epoch.
func
¶
func Truncate(path , length int64) (err )
func Umask
func Umask(mask int) (oldmask )
func Uname
func Uname(buf *Utsname) (err )
func UnixCredentials
func UnixCredentials(ucred *Ucred) []
UnixCredentials encodes credentials into a socket control message for sending to
another process. This can be used for authentication.
func UnixRights
func UnixRights(fds ...int) []
UnixRights encodes a set of open file descriptors into a socket control message
for sending to another process.
func Unlink
func Unlink(path string)
func Unlinkat
func Unlinkat(dirfd int, path ) error
func
¶
func Unmount(target , flags int) (err )
func Unsetenv
func Unsetenv(key string)
func Unshare
func Unshare(flags int) (err )
func Ustat
func Ustat(dev int, ubuf *) (err error)
func
¶
func Utime(path , buf *Utimbuf) (err )
func Utimes
func Utimes(path string, tv []) (err error)
func
¶
func
¶
func Wait4(pid , wstatus *WaitStatus, options , rusage *Rusage) (wpid , err error)
func
¶
func Write(fd , p []byte) (n , err error)
type
¶
type Cmsghdr struct { Len Level int32 Type }
func (*Cmsghdr) SetLen
func (cmsg *Cmsghdr) SetLen(length )
type Conn
type Conn interface { // SyscallConn returns a raw network connection. SyscallConn() (RawConn, ) }
Conn is implemented by some types in the net package to provide access to the
underlying file descriptor or handle.
type Credential
type Credential struct { Uid uint32 // User ID. Gid // Group ID. Groups []uint32 // Supplementary group IDs. NoSetGroups // If true, don't set supplementary groups }
Credential holds user and group identities to be assumed by a child process
started by StartProcess.
type Dirent
type Dirent struct { Ino uint64 Off Reclen uint16 Type Name [256]int8 Pad_cgo_0 [5] }
type EpollEvent
type EpollEvent struct { Events uint32 Fd Pad int32 }
type
¶
type Errno
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
}
func (Errno) Error
func (e Errno) Error()
func (Errno) Temporary
func (e Errno) Temporary()
func (Errno) Timeout
func (e Errno) Timeout()
type FdSet
type FdSet struct { Bits [16]int64 }
type
¶
type Flock_t struct { Type Whence int16 Pad_cgo_0 [4] Start int64 Len Pid int32 Pad_cgo_1 [4] }
type Fsid
type Fsid struct { X__val [2]int32 }
type
¶
type ICMPv6Filter struct { Data [8] }
func GetsockoptICMPv6Filter
func GetsockoptICMPv6Filter(fd, level, opt int) (*, error)
type
¶
type IPMreq struct { Multiaddr [4] /* in_addr */ Interface [4]byte /* in_addr */ }
func
¶
func GetsockoptIPMreq(fd, level, opt ) (*IPMreq, )
type IPMreqn
type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4] /* in_addr */ Ifindex int32 }
func
¶
func GetsockoptIPMreqn(fd, level, opt ) (*IPMreqn, )
type IPv6MTUInfo
type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu }
func GetsockoptIPv6MTUInfo
func GetsockoptIPv6MTUInfo(fd, level, opt int) (*, error)
type
¶
type IPv6Mreq struct { Multiaddr [16] /* in6_addr */ Interface uint32 }
func
¶
func GetsockoptIPv6Mreq(fd, level, opt ) (*IPv6Mreq, )
type IfAddrmsg
type IfAddrmsg struct { Family uint8 Prefixlen Flags uint8 Scope Index uint32 }
type
¶
type IfInfomsg struct { Family X__ifi_pad uint8 Type Index int32 Flags Change uint32 }
type
¶
type Inet4Pktinfo struct { Ifindex Spec_dst [4]byte /* in_addr */ Addr [4] /* in_addr */ }
type Inet6Pktinfo
type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex }
type InotifyEvent
type InotifyEvent struct { Wd int32 Mask Cookie uint32 Len Name [0]uint8 }
type
¶
type Iovec struct { Base * Len uint64 }
func (*Iovec)
¶
func (iov *) SetLen(length int)
type
¶
type Linger struct { Onoff Linger int32 }
type
¶
type Msghdr struct { Name * Namelen uint32 Pad_cgo_0 [4] Iov *Iovec Iovlen Control *byte Controllen Flags int32 Pad_cgo_1 [4] }
func (*Msghdr) SetControllen
func (msghdr *Msghdr) SetControllen(length )
type NetlinkMessage
type NetlinkMessage struct { Header NlMsghdr Data [] }
NetlinkMessage represents a netlink message.
type NetlinkRouteAttr
type NetlinkRouteAttr struct { Attr RtAttr Value [] }
NetlinkRouteAttr represents a netlink route attribute.
type NetlinkRouteRequest
type NetlinkRouteRequest struct { Header NlMsghdr Data }
NetlinkRouteRequest represents a request message to receive routing and link
states from the kernel.
type NlAttr
type NlAttr struct { Len uint16 Type }
type NlMsgerr
type NlMsgerr struct { Error int32 Msg }
type NlMsghdr
type NlMsghdr struct { Len uint32 Type Flags uint16 Seq Pid uint32 }
type
¶
type ProcAttr struct { Dir // Current working directory. Env []string // Environment. Files [] // File descriptors. Sys *SysProcAttr }
ProcAttr holds attributes that will be applied to a new process started by
StartProcess.
type
¶
type PtraceRegs struct { R15 R14 uint64 R13 R12 uint64 Rbp Rbx uint64 R11 R10 uint64 R9 R8 uint64 Rax Rcx uint64 Rdx Rsi uint64 Rdi Orig_rax uint64 Rip Cs uint64 Eflags Rsp uint64 Ss Fs_base uint64 Gs_base Ds uint64 Es Fs uint64 Gs }
func (r *PtraceRegs) PC()
func (*PtraceRegs) SetPC
func (r *PtraceRegs) SetPC(pc )
type RawConn
type RawConn interface { // Control invokes f on the underlying connection's file // descriptor or handle. // The file descriptor fd is guaranteed to remain valid while // f executes but not after f returns. Control(f func(fd uintptr)) // Read invokes f on the underlying connection's file // descriptor or handle; f is expected to try to read from the // file descriptor. // If f returns true, Read returns. Otherwise Read blocks // waiting for the connection to be ready for reading and // tries again repeatedly. // The file descriptor is guaranteed to remain valid while f // executes but not after f returns. Read(f func(fd uintptr) (done )) error // Write is like Read but for writing. Write(f func(fd ) (done bool)) }
A RawConn is a raw network connection.
type RawSockaddr
type RawSockaddr struct { Family uint16 Data [14] }
type RawSockaddrAny
type RawSockaddrAny struct { Addr RawSockaddr Pad [96] }
type RawSockaddrInet4
type RawSockaddrInet4 struct { Family uint16 Port Addr [4]byte /* in_addr */ Zero [8] }
type RawSockaddrInet6
type RawSockaddrInet6 struct { Family uint16 Port Flowinfo uint32 Addr [16] /* in6_addr */ Scope_id uint32 }
type
¶
type RawSockaddrLinklayer struct { Family Protocol uint16 Ifindex Hatype uint16 Pkttype Halen uint8 Addr [8] }
type RawSockaddrNetlink
type RawSockaddrNetlink struct { Family uint16 Pad Pid uint32 Groups }
type RawSockaddrUnix
type RawSockaddrUnix struct { Family uint16 Path [108] }
type Rlimit
type Rlimit struct { Cur uint64 Max }
type RtAttr
type RtAttr struct { Len uint16 Type }
type RtGenmsg
type RtGenmsg struct { Family uint8 }
type
¶
type RtMsg struct { Family Dst_len uint8 Src_len Tos uint8 Table Protocol uint8 Scope Type uint8 Flags }
type RtNexthop
type RtNexthop struct { Len uint16 Flags Hops uint8 Ifindex }
type Rusage
type Rusage struct { Utime Timeval Stime Maxrss int64 Ixrss Idrss int64 Isrss Minflt int64 Majflt Nswap int64 Inblock Oublock int64 Msgsnd Msgrcv int64 Nsignals Nvcsw int64 Nivcsw }
type Signal
type Signal int
A Signal is a number describing a process signal. It implements the os.Signal
interface.
func (Signal)
¶
func (s ) Signal()
func (Signal) String
func (s Signal) String()
type SockFilter
type SockFilter struct { Code uint16 Jt Jf uint8 K }
func LsfJump
func LsfJump(code, k, jt, jf int) *
Deprecated: Use golang.org/x/net/bpf instead.
func LsfStmt
func LsfStmt(code, k int) *
Deprecated: Use golang.org/x/net/bpf instead.
type SockFprog
type SockFprog struct { Len uint16 Pad_cgo_0 [6] Filter *SockFilter }
type
¶
type Sockaddr interface {
// contains filtered or unexported methods
}
func
¶
func Getpeername(fd ) (sa Sockaddr, err )
func Getsockname
func Getsockname(fd int) (sa , err error)
type
¶
type SockaddrInet4 struct { Port Addr [4]byte // contains filtered or unexported fields }
type
¶
type SockaddrInet6 struct { Port ZoneId uint32 Addr [16] // contains filtered or unexported fields }
type SockaddrLinklayer
type SockaddrLinklayer struct { Protocol uint16 Ifindex Hatype uint16 Pkttype Halen uint8 Addr [8] // contains filtered or unexported fields }
type SockaddrNetlink
type SockaddrNetlink struct { Family uint16 Pad Pid uint32 Groups // contains filtered or unexported fields }
type SockaddrUnix
type SockaddrUnix struct { Name string // contains filtered or unexported fields }
type
¶
type SocketControlMessage struct { Header Data []byte }
SocketControlMessage represents a socket control message.
type
¶
type Stat_t struct { Dev Ino uint64 Nlink Mode uint32 Uid Gid uint32 X__pad0 Rdev uint64 Size Blksize int64 Blocks Atim Timespec Mtim Ctim Timespec X__unused [3] }
type Statfs_t
type Statfs_t struct { Type int64 Bsize Blocks uint64 Bfree Bavail uint64 Files Ffree uint64 Fsid Namelen int64 Frsize Flags int64 Spare [4] }
type SysProcAttr
type SysProcAttr struct { Chroot string // Chroot. Credential * // Credential. Ptrace bool // Enable tracing. Setsid // Create session. Setpgid bool // Set process group ID to Pgid, or, if Pgid == 0, to new pid. Setctty // Set controlling terminal to fd Ctty (only meaningful if Setsid is set) Noctty bool // Detach fd 0 from controlling terminal Ctty // Controlling TTY fd Foreground bool // Place child's process group in foreground. (Implies Setpgid. Uses Ctty as fd of controlling TTY) Pgid // Child's process group ID if Setpgid. Pdeathsig Signal // Signal that the process will get when its parent dies (Linux only) Cloneflags // Flags for clone calls (Linux only) Unshareflags uintptr // Flags for unshare calls (Linux only) UidMappings [] // User ID mappings for user namespaces. GidMappings []SysProcIDMap // Group ID mappings for user namespaces. // GidMappingsEnableSetgroups enabling setgroups syscall. // If false, then setgroups syscall will be disabled for the child process. // This parameter is no-op if GidMappings == nil. Otherwise for unprivileged // users this should be set to false for mappings work. GidMappingsEnableSetgroups AmbientCaps []uintptr // Ambient capabilities (Linux only) }
type
¶
type SysProcIDMap struct { ContainerID // Container ID. HostID int // Host ID. Size // Size. }
SysProcIDMap holds Container ID to Host ID mappings used for User Namespaces in
Linux. See user_namespaces(7).
type Sysinfo_t
type Sysinfo_t struct { Uptime int64 Loads [3] Totalram uint64 Freeram Sharedram uint64 Bufferram Totalswap uint64 Freeswap Procs uint16 Pad Pad_cgo_0 [4]byte Totalhigh Freehigh uint64 Unit X_f [0]byte Pad_cgo_1 [4] }
type TCPInfo
type TCPInfo struct { State uint8 Ca_state Retransmits uint8 Probes Backoff uint8 Options Pad_cgo_0 [2]byte Rto Ato uint32 Snd_mss Rcv_mss uint32 Unacked Sacked uint32 Lost Retrans uint32 Fackets Last_data_sent uint32 Last_ack_sent Last_data_recv uint32 Last_ack_recv Pmtu uint32 Rcv_ssthresh Rtt uint32 Rttvar Snd_ssthresh uint32 Snd_cwnd Advmss uint32 Reordering Rcv_rtt uint32 Rcv_space Total_retrans uint32 }
type
¶
type Termios struct { Iflag Oflag uint32 Cflag Lflag uint32 Line Cc [32]uint8 Pad_cgo_0 [3] Ispeed uint32 Ospeed }
type Time_t
type Time_t int64
func
¶
func Time(t *) (tt Time_t, err )
type Timespec
type Timespec struct { Sec int64 Nsec }
func NsecToTimespec
func NsecToTimespec(nsec int64)
NsecToTimespec takes a number of nanoseconds since the Unix epoch and returns
the corresponding Timespec value.
func (*Timespec) Nano
func (ts *Timespec) Nano()
Nano returns ts as the number of nanoseconds elapsed since the Unix epoch.
func (*Timespec) Unix
func (ts *Timespec) Unix() (sec , nsec int64)
Unix returns ts as the number of seconds and nanoseconds elapsed since the Unix
epoch.
type
¶
type Timeval struct { Sec Usec int64 }
func NsecToTimeval(nsec ) Timeval
NsecToTimeval takes a number of nanoseconds since the Unix epoch and returns the
corresponding Timeval value.
func (*Timeval)
¶
func (tv *) Nano() int64
Nano returns tv as the number of nanoseconds elapsed since the Unix epoch.
func (*Timeval)
¶
func (tv *) Unix() (sec int64, nsec )
Unix returns tv as the number of seconds and nanoseconds elapsed since the Unix
epoch.
type Timex
type Timex struct { Modes uint32 Pad_cgo_0 [4] Offset int64 Freq Maxerror int64 Esterror Status int32 Pad_cgo_1 [4] Constant int64 Precision Tolerance int64 Time Tick int64 Ppsfreq Jitter int64 Shift Pad_cgo_2 [4]byte Stabil Jitcnt int64 Calcnt Errcnt int64 Stbcnt Tai int32 Pad_cgo_3 [44] }
type Tms
type Tms struct { Utime int64 Stime Cutime int64 Cstime }
type Ucred
type Ucred struct { Pid int32 Uid Gid uint32 }
func
¶
func GetsockoptUcred(fd, level, opt ) (*Ucred, )
func ParseUnixCredentials
func ParseUnixCredentials(m *SocketControlMessage) (*, error)
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.
type
¶
type Ustat_t struct { Tfree Pad_cgo_0 [4]byte Tinode Fname [6]int8 Fpack [6] Pad_cgo_1 [4]byte }
type
¶
type Utimbuf struct { Actime Modtime int64 }
type
¶
type Utsname struct { Sysname [65] Nodename [65]int8 Release [65] Version [65]int8 Machine [65] Domainname [65]int8 }
type WaitStatus
func (WaitStatus) Continued
func (w WaitStatus) Continued()
func (WaitStatus) CoreDump
func (w WaitStatus) CoreDump()
func (WaitStatus) ExitStatus
func (w WaitStatus) ExitStatus()
func (WaitStatus) Exited
func (w WaitStatus) Exited()
func (WaitStatus) Signal
func (w WaitStatus) Signal()
func (WaitStatus) Signaled
func (w WaitStatus) Signaled()
func (WaitStatus) StopSignal
func (w WaitStatus) StopSignal()
func (w WaitStatus) Stopped()
func (WaitStatus) TrapCause
func (w WaitStatus) TrapCause()