Documentation
¶
Overview ¶
This package contains an interface to the low-level operating system primitives. The details vary depending on the underlying system. Its primary use 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.
Index ¶
- Constants
- Variables
- func Access(path string, mode int) (errno int)
- func Acct(path string) (errno int)
- func Adjtimex(buf *Timex) (state int, errno int)
- func Bind(fd int, sa Sockaddr) (errno int)
- func Chdir(path string) (errno int)
- func Chmod(path string, mode int) (errno int)
- func Chown(path string, uid int, gid int) (errno int)
- func Chroot(path string) (errno int)
- func Close(fd int) (errno int)
- func CloseOnExec(fd int)
- func Connect(fd int, sa Sockaddr) (errno int)
- func Creat(path string, mode int) (fd int, errno int)
- func Dup(oldfd int) (fd int, errno int)
- func Dup2(oldfd int, newfd int) (fd int, errno int)
- func EpollCreate(size int) (fd int, errno int)
- func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int)
- func EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int)
- func Errstr(errno int) string
- func Exec(argv0 string, argv []string, envv []string) (err int)
- func Exit(code int)
- func Faccessat(dirfd int, path string, mode int, flags int) (errno int)
- func Fallocate(fd int, mode int, off int64, len int64) (errno int)
- func Fchdir(fd int) (errno int)
- func Fchmod(fd int, mode int) (errno int)
- func Fchmodat(dirfd int, path string, mode int, flags int) (errno int)
- func Fchown(fd int, uid int, gid int) (errno int)
- func Fchownat(dirfd int, path string, uid int, gid int, flags int) (errno int)
- func Fdatasync(fd int) (errno int)
- func ForkExec(argv0 string, argv []string, envv []string, dir string, fd []int) (pid int, err int)
- func Fstat(fd int, stat *Stat_t) (errno int)
- func Fstatfs(fd int, buf *Statfs_t) (errno int)
- func Fsync(fd int) (errno int)
- func Ftruncate(fd int, length int64) (errno int)
- func Futimesat(dirfd int, path string, tv []Timeval) (errno int)
- func Getcwd(buf []byte) (n int, errno int)
- func Getdents(fd int, buf []byte) (n int, errno int)
- func Getegid() (egid int)
- func Geteuid() (euid int)
- func Getgid() (gid int)
- func Getgroups() (gids []int, errno int)
- func Getpagesize() int
- func Getpgid(pid int) (pgid int, errno int)
- func Getpgrp() (pid int)
- func Getpid() (pid int)
- func Getppid() (ppid int)
- func Getrlimit(resource int, rlim *Rlimit) (errno int)
- func Getrusage(who int, rusage *Rusage) (errno int)
- func Gettid() (tid int)
- func Gettimeofday(tv *Timeval) (errno int)
- func Getuid() (uid int)
- func Getwd() (wd string, errno int)
- func Ioperm(from int, num int, on int) (errno int)
- func Iopl(level int) (errno int)
- func Kill(pid int, sig int) (errno int)
- func Klogctl(typ int, buf []byte) (n int, errno int)
- func Lchown(path string, uid int, gid int) (errno int)
- func Link(oldpath string, newpath string) (errno int)
- func Listen(s int, n int) (errno int)
- func Lstat(path string, stat *Stat_t) (errno int)
- func Mkdir(path string, mode int) (errno int)
- func Mkdirat(dirfd int, path string, mode int) (errno int)
- func Mknod(path string, mode int, dev int) (errno int)
- func Mknodat(dirfd int, path string, mode int, dev int) (errno int)
- func Nanosleep(time *Timespec, leftover *Timespec) (errno int)
- func Open(path string, mode int, perm int) (fd int, errno int)
- func Openat(dirfd int, path string, flags int, mode int) (fd int, errno int)
- func Pause() (errno int)
- func Pipe(p []int) (errno int)
- func PivotRoot(newroot string, putold string) (errno int)
- func Pread(fd int, p []byte, offset int64) (n int, errno int)
- func PtraceAttach(pid int) (errno int)
- func PtraceCont(pid int, signal int) (errno int)
- func PtraceDetach(pid int) (errno int)
- func PtraceForkExec(argv0 string, argv []string, envv []string, dir string, fd []int) (pid int, err int)
- func PtraceGetEventMsg(pid int) (msg uint, errno int)
- func PtraceGetRegs(pid int, regsout *PtraceRegs) (errno int)
- func PtracePeekData(pid int, addr uintptr, out []byte) (count int, errno int)
- func PtracePeekText(pid int, addr uintptr, out []byte) (count int, errno int)
- func PtracePokeData(pid int, addr uintptr, data []byte) (count int, errno int)
- func PtracePokeText(pid int, addr uintptr, data []byte) (count int, errno int)
- func PtraceSetOptions(pid int, options int) (errno int)
- func PtraceSetRegs(pid int, regs *PtraceRegs) (errno int)
- func PtraceSingleStep(pid int) (errno int)
- func Pwrite(fd int, p []byte, offset int64) (n int, errno int)
- func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
- func Read(fd int, p []byte) (n int, errno int)
- func Readlink(path string, buf []byte) (n int, errno int)
- func Rename(oldpath string, newpath string) (errno int)
- func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (errno int)
- func Rmdir(path string) (errno int)
- func Seek(fd int, offset int64, whence int) (off int64, errno int)
- func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int)
- func Sendto(fd int, p []byte, flags int, to Sockaddr) (errno int)
- func SetNonblock(fd int, nonblocking bool) (errno int)
- func Setdomainname(p []byte) (errno int)
- func Setfsgid(gid int) (errno int)
- func Setfsuid(uid int) (errno int)
- func Setgid(gid int) (errno int)
- func Setgroups(gids []int) (errno int)
- func Sethostname(p []byte) (errno int)
- func Setpgid(pid int, pgid int) (errno int)
- func Setregid(rgid int, egid int) (errno int)
- func Setresgid(rgid int, egid int, sgid int) (errno int)
- func Setresuid(ruid int, euid int, suid int) (errno int)
- func Setreuid(ruid int, euid int) (errno int)
- func Setrlimit(resource int, rlim *Rlimit) (errno int)
- func Setsid() (pid int)
- func SetsockoptInt(fd, level, opt int, value int) (errno int)
- func SetsockoptLinger(fd, level, opt int, l *Linger) (errno int)
- func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (errno int)
- func Settimeofday(tv *Timeval) (errno int)
- func Setuid(uid int) (errno int)
- func Shutdown(fd int, how int) (errno int)
- func Sleep(nsec int64) (errno int)
- func Socket(domain, typ, proto int) (fd, errno int)
- func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int)
- func Stat(path string, stat *Stat_t) (errno int)
- func Statfs(path string, buf *Statfs_t) (errno int)
- func StringArrayPtr(ss []string) []*byte
- func StringBytePtr(s string) *byte
- func StringByteSlice(s string) []byte
- func Symlink(oldpath string, newpath string) (errno int)
- func Sync()
- func SyncFileRange(fd int, off int64, n int64, flags int) (errno int)
- func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
- func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
- func Sysinfo(info *Sysinfo_t) (errno int)
- func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int)
- func Tgkill(tgid int, tid int, sig int) (errno int)
- func Times(tms *Tms) (ticks uintptr, errno int)
- func TimespecToNsec(ts Timespec) int64
- func TimevalToNsec(tv Timeval) int64
- func Truncate(path string, length int64) (errno int)
- func Umask(mask int) (oldmask int)
- func Uname(buf *Utsname) (errno int)
- func Unlink(path string) (errno int)
- func Unlinkat(dirfd int, path string) (errno int)
- func Unshare(flags int) (errno int)
- func Ustat(dev int, ubuf *Ustat_t) (errno int)
- func Utime(path string, buf *Utimbuf) (errno int)
- func Utimes(path string, tv []Timeval) (errno int)
- func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int)
- func Write(fd int, p []byte) (n int, errno int)
- type Cmsghdr
- type Dirent
- type EpollEvent
- type FdSet
- type Iovec
- type Linger
- type Msghdr
- type PtraceRegs
- type RawSockaddr
- type RawSockaddrAny
- type RawSockaddrInet4
- type RawSockaddrInet6
- type RawSockaddrUnix
- type Rlimit
- type Rusage
- type Sockaddr
- type SockaddrInet4
- type SockaddrInet6
- type SockaddrUnix
- type Stat_t
- type Statfs_t
- type Sysinfo_t
- type Time_t
- type Timespec
- type Timeval
- type Timex
- type Tms
- type Ustat_t
- type Utimbuf
- type Utsname
- type WaitStatus
- func (WaitStatus) Continued() bool
- func (WaitStatus) CoreDump() bool
- func (WaitStatus) ExitStatus() int
- func (WaitStatus) Exited() bool
- func (WaitStatus) Signal() int
- func (WaitStatus) Signaled() bool
- func (WaitStatus) StopSignal() int
- func (WaitStatus) Stopped() bool
- func (WaitStatus) TrapCause() int
Constants ¶
const ( F_SETFD = 1 + iota FD_CLOEXEC F_GETFL F_SETFL O_NONBLOCK SYS_FORK SYS_PTRACE SYS_CHDIR SYS_DUP2 SYS_FCNTL SYS_EXECVE PTRACE_TRACEME SYS_CLOSE SYS_WRITE SYS_EXIT SYS_READ EPIPE EINTR )
const ( AF_APPLETALK = 0x5 AF_ASH = 0x12 AF_ATMPVC = 0x8 AF_ATMSVC = 0x14 AF_AX25 = 0x3 AF_BLUETOOTH = 0x1f AF_BRIDGE = 0x7 AF_CAN = 0x1d AF_DECnet = 0xc AF_ECONET = 0x13 AF_FILE = 0x1 AF_IEEE802154 = 0x24 AF_INET = 0x2 AF_INET6 = 0xa AF_IPX = 0x4 AF_IRDA = 0x17 AF_ISDN = 0x22 AF_IUCV = 0x20 AF_KEY = 0xf AF_LLC = 0x1a AF_LOCAL = 0x1 AF_MAX = 0x25 AF_NETBEUI = 0xd AF_NETLINK = 0x10 AF_NETROM = 0x6 AF_PACKET = 0x11 AF_PHONET = 0x23 AF_PPPOX = 0x18 AF_RDS = 0x15 AF_ROSE = 0xb AF_ROUTE = 0x10 AF_RXRPC = 0x21 AF_SECURITY = 0xe AF_SNA = 0x16 AF_TIPC = 0x1e AF_UNIX = 0x1 AF_UNSPEC = 0 AF_WANPIPE = 0x19 AF_X25 = 0x9 E2BIG = 0x7 EACCES = 0xd EADDRINUSE = 0x62 EADDRNOTAVAIL = 0x63 EADV = 0x44 EAFNOSUPPORT = 0x61 EAGAIN = 0xb EALREADY = 0x72 EBADE = 0x34 EBADF = 0x9 EBADFD = 0x4d EBADMSG = 0x4a EBADR = 0x35 EBADRQC = 0x38 EBADSLT = 0x39 EBFONT = 0x3b EBUSY = 0x10 ECANCELED = 0x7d ECHILD = 0xa ECHRNG = 0x2c ECOMM = 0x46 ECONNABORTED = 0x67 ECONNREFUSED = 0x6f ECONNRESET = 0x68 EDEADLK = 0x23 EDEADLOCK = 0x23 EDESTADDRREQ = 0x59 EDOM = 0x21 EDOTDOT = 0x49 EDQUOT = 0x7a EEXIST = 0x11 EFAULT = 0xe EFBIG = 0x1b EHOSTDOWN = 0x70 EHOSTUNREACH = 0x71 EIDRM = 0x2b EILSEQ = 0x54 EINPROGRESS = 0x73 EINTR = 0x4 EINVAL = 0x16 EIO = 0x5 EISCONN = 0x6a EISDIR = 0x15 EISNAM = 0x78 EKEYEXPIRED = 0x7f EKEYREJECTED = 0x81 EKEYREVOKED = 0x80 EL2HLT = 0x33 EL2NSYNC = 0x2d EL3HLT = 0x2e EL3RST = 0x2f ELIBACC = 0x4f ELIBBAD = 0x50 ELIBEXEC = 0x53 ELIBMAX = 0x52 ELIBSCN = 0x51 ELNRNG = 0x30 ELOOP = 0x28 EMEDIUMTYPE = 0x7c EMFILE = 0x18 EMLINK = 0x1f EMSGSIZE = 0x5a EMULTIHOP = 0x48 ENAMETOOLONG = 0x24 ENAVAIL = 0x77 ENETDOWN = 0x64 ENETRESET = 0x66 ENETUNREACH = 0x65 ENFILE = 0x17 ENOANO = 0x37 ENOBUFS = 0x69 ENOCSI = 0x32 ENODATA = 0x3d ENODEV = 0x13 ENOENT = 0x2 ENOEXEC = 0x8 ENOKEY = 0x7e ENOLCK = 0x25 ENOLINK = 0x43 ENOMEDIUM = 0x7b ENOMEM = 0xc ENOMSG = 0x2a ENONET = 0x40 ENOPKG = 0x41 ENOPROTOOPT = 0x5c ENOSPC = 0x1c ENOSR = 0x3f ENOSTR = 0x3c ENOSYS = 0x26 ENOTBLK = 0xf ENOTCONN = 0x6b ENOTDIR = 0x14 ENOTEMPTY = 0x27 ENOTNAM = 0x76 ENOTRECOVERABLE = 0x83 ENOTSOCK = 0x58 ENOTSUP = 0x5f ENOTTY = 0x19 ENOTUNIQ = 0x4c ENXIO = 0x6 EOPNOTSUPP = 0x5f EOVERFLOW = 0x4b EOWNERDEAD = 0x82 EPERM = 0x1 EPFNOSUPPORT = 0x60 EPIPE = 0x20 EPOLLERR = 0x8 EPOLLET = -0x80000000 EPOLLHUP = 0x10 EPOLLIN = 0x1 EPOLLMSG = 0x400 EPOLLONESHOT = 0x40000000 EPOLLOUT = 0x4 EPOLLPRI = 0x2 EPOLLRDBAND = 0x80 EPOLLRDHUP = 0x2000 EPOLLRDNORM = 0x40 EPOLLWRBAND = 0x200 EPOLLWRNORM = 0x100 EPOLL_CLOEXEC = 0x80000 EPOLL_CTL_ADD = 0x1 EPOLL_CTL_DEL = 0x2 EPOLL_CTL_MOD = 0x3 EPOLL_NONBLOCK = 0x800 EPROTO = 0x47 EPROTONOSUPPORT = 0x5d EPROTOTYPE = 0x5b ERANGE = 0x22 EREMCHG = 0x4e EREMOTE = 0x42 EREMOTEIO = 0x79 ERESTART = 0x55 ERFKILL = 0x84 EROFS = 0x1e ESHUTDOWN = 0x6c ESOCKTNOSUPPORT = 0x5e ESPIPE = 0x1d ESRCH = 0x3 ESRMNT = 0x45 ESTALE = 0x74 ESTRPIPE = 0x56 ETIME = 0x3e ETIMEDOUT = 0x6e ETOOMANYREFS = 0x6d ETXTBSY = 0x1a EUCLEAN = 0x75 EUNATCH = 0x31 EUSERS = 0x57 EWOULDBLOCK = 0xb EXDEV = 0x12 EXFULL = 0x36 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 F_DUPFD = 0 F_DUPFD_CLOEXEC = 0x406 F_EXLCK = 0x4 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLEASE = 0x401 F_GETLK = 0x5 F_GETLK64 = 0x5 F_GETOWN = 0x9 F_GETSIG = 0xb F_LOCK = 0x1 F_NOTIFY = 0x402 F_OK = 0 F_RDLCK = 0 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLEASE = 0x400 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETOWN = 0x8 F_SETSIG = 0xa F_SHLCK = 0x8 F_TEST = 0x3 F_TLOCK = 0x2 F_ULOCK = 0 F_UNLCK = 0x2 F_WRLCK = 0x1 IPPROTO_AH = 0x33 IPPROTO_COMP = 0x6c IPPROTO_DCCP = 0x21 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_ESP = 0x32 IPPROTO_FRAGMENT = 0x2c IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0 IPPROTO_IPIP = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_MTP = 0x5c IPPROTO_NONE = 0x3b IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IP_ADD_MEMBERSHIP = 0x23 IP_ADD_SOURCE_MEMBERSHIP = 0x27 IP_BLOCK_SOURCE = 0x26 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DROP_MEMBERSHIP = 0x24 IP_DROP_SOURCE_MEMBERSHIP = 0x28 IP_HDRINCL = 0x3 IP_MAX_MEMBERSHIPS = 0x14 IP_MSFILTER = 0x29 IP_MTU_DISCOVER = 0xa IP_MULTICAST_IF = 0x20 IP_MULTICAST_LOOP = 0x22 IP_MULTICAST_TTL = 0x21 IP_OPTIONS = 0x4 IP_PKTINFO = 0x8 IP_PKTOPTIONS = 0x9 IP_PMTUDISC = 0xa IP_PMTUDISC_DO = 0x2 IP_PMTUDISC_DONT = 0 IP_PMTUDISC_PROBE = 0x3 IP_PMTUDISC_WANT = 0x1 IP_RECVERR = 0xb IP_RECVOPTS = 0x6 IP_RECVRETOPTS = 0x7 IP_RECVTOS = 0xd IP_RECVTTL = 0xc IP_RETOPTS = 0x7 IP_ROUTER_ALERT = 0x5 IP_TOS = 0x1 IP_TTL = 0x2 IP_UNBLOCK_SOURCE = 0x25 NAME_MAX = 0xff O_ACCMODE = 0x3 O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x4000 O_DIRECTORY = 0x10000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x1000 O_LARGEFILE = 0 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x800 O_RDONLY = 0 O_RDWR = 0x2 O_RSYNC = 0x1000 O_SYNC = 0x1000 O_TRUNC = 0x200 O_WRONLY = 0x1 PTRACE_ARCH_PRCTL = 0x1e PTRACE_ATTACH = 0x10 PTRACE_BTS_CLEAR = 0x2c PTRACE_BTS_CONFIG = 0x28 PTRACE_BTS_DRAIN = 0x2d PTRACE_BTS_GET = 0x2b PTRACE_BTS_O_ALLOC = 0x8 PTRACE_BTS_O_SCHED = 0x2 PTRACE_BTS_O_SIGNAL = 0x4 PTRACE_BTS_O_TRACE = 0x1 PTRACE_BTS_SIZE = 0x2a PTRACE_BTS_STATUS = 0x29 PTRACE_CONT = 0x7 PTRACE_DETACH = 0x11 PTRACE_EVENT_CLONE = 0x3 PTRACE_EVENT_EXEC = 0x4 PTRACE_EVENT_EXIT = 0x6 PTRACE_EVENT_FORK = 0x1 PTRACE_EVENT_VFORK = 0x2 PTRACE_EVENT_VFORK_DONE = 0x5 PTRACE_GETEVENTMSG = 0x4201 PTRACE_GETFPREGS = 0xe PTRACE_GETFPXREGS = 0x12 PTRACE_GETREGS = 0xc PTRACE_GETSIGINFO = 0x4202 PTRACE_GET_THREAD_AREA = 0x19 PTRACE_KILL = 0x8 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_O_MASK = 0x7f PTRACE_O_TRACECLONE = 0x8 PTRACE_O_TRACEEXEC = 0x10 PTRACE_O_TRACEEXIT = 0x40 PTRACE_O_TRACEFORK = 0x2 PTRACE_O_TRACESYSGOOD = 0x1 PTRACE_O_TRACEVFORK = 0x4 PTRACE_O_TRACEVFORKDONE = 0x20 PTRACE_PEEKDATA = 0x2 PTRACE_PEEKTEXT = 0x1 PTRACE_PEEKUSR = 0x3 PTRACE_POKEDATA = 0x5 PTRACE_POKETEXT = 0x4 PTRACE_POKEUSR = 0x6 PTRACE_SETFPREGS = 0xf PTRACE_SETFPXREGS = 0x13 PTRACE_SETOPTIONS = 0x4200 PTRACE_SETREGS = 0xd PTRACE_SETSIGINFO = 0x4203 PTRACE_SET_THREAD_AREA = 0x1a PTRACE_SINGLEBLOCK = 0x21 PTRACE_SINGLESTEP = 0x9 PTRACE_SYSCALL = 0x18 PTRACE_SYSEMU = 0x1f PTRACE_SYSEMU_SINGLESTEP = 0x20 PTRACE_TRACEME = 0 SHUT_RD = 0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIGABRT = 0x6 SIGALRM = 0xe SIGBUS = 0x7 SIGCHLD = 0x11 SIGCLD = 0x11 SIGCONT = 0x12 SIGFPE = 0x8 SIGHUP = 0x1 SIGILL = 0x4 SIGINT = 0x2 SIGIO = 0x1d SIGIOT = 0x6 SIGKILL = 0x9 SIGPIPE = 0xd SIGPOLL = 0x1d SIGPROF = 0x1b SIGPWR = 0x1e SIGQUIT = 0x3 SIGSEGV = 0xb SIGSTKFLT = 0x10 SIGSTOP = 0x13 SIGSYS = 0x1f SIGTERM = 0xf SIGTRAP = 0x5 SIGTSTP = 0x14 SIGTTIN = 0x15 SIGTTOU = 0x16 SIGUNUSED = 0x1f SIGURG = 0x17 SIGUSR1 = 0xa SIGUSR2 = 0xc SIGVTALRM = 0x1a SIGWINCH = 0x1c SIGXCPU = 0x18 SIGXFSZ = 0x19 SOCK_CLOEXEC = 0x80000 SOCK_DCCP = 0x6 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_PACKET = 0xa SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_AAL = 0x109 SOL_ATM = 0x108 SOL_DECNET = 0x105 SOL_ICMPV6 = 0x3a SOL_IP = 0 SOL_IPV6 = 0x29 SOL_IRDA = 0x10a SOL_PACKET = 0x107 SOL_RAW = 0xff SOL_SOCKET = 0x1 SOL_TCP = 0x6 SOL_X25 = 0x106 SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1e SO_ATTACH_FILTER = 0x1a SO_BINDTODEVICE = 0x19 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_DEBUG = 0x1 SO_DETACH_FILTER = 0x1b SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_MARK = 0x24 SO_NO_CHECK = 0xb SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSSEC = 0x22 SO_PEERCRED = 0x11 SO_PEERNAME = 0x1c SO_PEERSEC = 0x1f SO_PRIORITY = 0xc SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVTIMEO = 0x14 SO_REUSEADDR = 0x2 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x13 SO_SNDTIMEO = 0x15 SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TCP_CONGESTION = 0xd TCP_CORK = 0x3 TCP_DEFER_ACCEPT = 0x9 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 TCP_KEEPINTVL = 0x5 TCP_LINGER2 = 0x8 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0xe TCP_MD5SIG_MAXKEYLEN = 0x50 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_QUICKACK = 0xc TCP_SYNCNT = 0x7 TCP_WINDOW_CLAMP = 0xa WALL = 0x40000000 WCLONE = 0x80000000 WCONTINUED = 0x8 WEXITED = 0x4 WNOHANG = 0x1 WNOTHREAD = 0x20000000 WNOWAIT = 0x1000000 WORDSIZE = 0x40 WSTOPPED = 0x2 WUNTRACED = 0x2 )
Constants
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 = 283 SYS_EVENTFD = 284 SYS_FALLOCATE = 285 )
const ( PathMax = 0x1000 SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x70 SizeofSockaddrUnix = 0x6e SizeofLinger = 0x8 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 )
Constants
const ImplementsGetwd = true
const OS = "linux"
const OS = "mingw"
Variables ¶
var ForkLock sync.RWMutex
var SocketDisableIPv6 bool
For testing: clients can set this flag to force creation of IPv6 sockets to return EAFNOSUPPORT.
Functions ¶
func CloseOnExec ¶
func CloseOnExec(fd int)
func EpollCreate ¶
func Getpagesize ¶
func Getpagesize() int
func Gettimeofday ¶
func PtraceAttach ¶
func PtraceCont ¶
func PtraceDetach ¶
func PtraceForkExec ¶
func PtraceForkExec(argv0 string, argv []string, envv []string, dir string, fd []int) (pid int, err int)
PtraceForkExec is like ForkExec, but starts the child in a traced state.
func PtraceGetEventMsg ¶
func PtraceGetRegs ¶
func PtraceGetRegs(pid int, regsout *PtraceRegs) (errno int)
func PtracePokeData ¶
func PtracePokeText ¶
func PtraceSetOptions ¶
func PtraceSetRegs ¶
func PtraceSetRegs(pid int, regs *PtraceRegs) (errno int)
func PtraceSingleStep ¶
func RawSyscall ¶
func SetNonblock ¶
func Setdomainname ¶
func Sethostname ¶
func SetsockoptInt ¶
func SetsockoptLinger ¶
func SetsockoptTimeval ¶
func Settimeofday ¶
func StringArrayPtr ¶
Convert array of string to array of NUL-terminated byte pointer.
func StringBytePtr ¶
StringBytePtr returns a pointer to a NUL-terminated array of bytes containing the text of s.
func StringByteSlice ¶
StringByteSlice returns a NUL-terminated slice of bytes containing the text of s.
func TimespecToNsec ¶
func TimevalToNsec ¶
Types ¶
type EpollEvent ¶
type PtraceRegs ¶
type PtraceRegs struct { R15 uint64 R14 uint64 R13 uint64 R12 uint64 Rbp uint64 Rbx uint64 R11 uint64 R10 uint64 R9 uint64 R8 uint64 Rax uint64 Rcx uint64 Rdx uint64 Rsi uint64 Rdi uint64 Orig_rax uint64 Rip uint64 Cs uint64 Eflags uint64 Rsp uint64 Ss uint64 Fs_base uint64 Gs_base uint64 Ds uint64 Es uint64 Fs uint64 Gs uint64 }
func (*PtraceRegs) PC ¶
func (r *PtraceRegs) PC() uint64
func (*PtraceRegs) SetPC ¶
func (r *PtraceRegs) SetPC(pc uint64)
type RawSockaddr ¶
type RawSockaddrAny ¶
type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 }
type RawSockaddrInet4 ¶
type RawSockaddrInet6 ¶
type RawSockaddrUnix ¶
type Sockaddr ¶
type Sockaddr interface {
// contains filtered or unexported methods
}
func Getpeername ¶
func Getsockname ¶
type SockaddrInet4 ¶
type SockaddrInet6 ¶
type SockaddrUnix ¶
type SockaddrUnix struct { Name string // contains filtered or unexported fields }
type Timespec ¶
func NsecToTimespec ¶
type Timeval ¶
func NsecToTimeval ¶
type Timex ¶
type Timex struct { Modes uint32 Pad0 [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Pad1 [4]byte Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Pad2 [4]byte Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Pad3 int32 Pad4 int32 Pad5 int32 Pad6 int32 Pad7 int32 Pad8 int32 Pad9 int32 Pad10 int32 Pad11 int32 Pad12 int32 Pad13 int32 Pad14 int32 }
type WaitStatus ¶
type WaitStatus uint32
func (WaitStatus) Continued ¶
func (WaitStatus) Continued() bool
func (WaitStatus) CoreDump ¶
func (WaitStatus) CoreDump() bool
func (WaitStatus) ExitStatus ¶
func (WaitStatus) ExitStatus() int
func (WaitStatus) Exited ¶
func (WaitStatus) Exited() bool
func (WaitStatus) Signal ¶
func (WaitStatus) Signal() int
func (WaitStatus) Signaled ¶
func (WaitStatus) Signaled() bool
func (WaitStatus) StopSignal ¶
func (WaitStatus) StopSignal() int
func (WaitStatus) Stopped ¶
func (WaitStatus) Stopped() bool
func (WaitStatus) TrapCause ¶
func (WaitStatus) TrapCause() int