diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-04-26 09:55:32 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-04-26 09:55:32 +0200 |
commit | 7b15ed9ef455b6b66c6b376898a88aef5d6a9970 (patch) | |
tree | 3ef530baa80cdf29436ba981f5783be6b4d2202b /src/pkg/syscall | |
parent | 50104cc32a498f7517a51c8dc93106c51c7a54b4 (diff) | |
download | golang-7b15ed9ef455b6b66c6b376898a88aef5d6a9970.tar.gz |
Imported Upstream version 2011.04.13upstream/2011.04.13
Diffstat (limited to 'src/pkg/syscall')
64 files changed, 5445 insertions, 2191 deletions
diff --git a/src/pkg/syscall/Makefile b/src/pkg/syscall/Makefile index 061b0056c..978bc94f8 100644 --- a/src/pkg/syscall/Makefile +++ b/src/pkg/syscall/Makefile @@ -32,6 +32,9 @@ GOFILES_linux=\ GOFILES_windows=\ exec_windows.go + +GOFILES_plan9=\ + exec_plan9.go OFILES=\ asm_$(GOOS)_$(GOARCH).$O\ diff --git a/src/pkg/syscall/asm_darwin_386.s b/src/pkg/syscall/asm_darwin_386.s index fffda6e20..20cd809c7 100644 --- a/src/pkg/syscall/asm_darwin_386.s +++ b/src/pkg/syscall/asm_darwin_386.s @@ -61,6 +61,36 @@ ok6: CALL runtime·exitsyscall(SB) RET +TEXT ·Syscall9(SB),7,$0 + CALL runtime·entersyscall(SB) + MOVL 4(SP), AX // syscall entry + // slide args down on top of system call number + LEAL 8(SP), SI + LEAL 4(SP), DI + CLD + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + INT $0x80 + JAE ok9 + MOVL $-1, 44(SP) // r1 + MOVL $-1, 48(SP) // r2 + MOVL AX, 52(SP) // errno + CALL runtime·exitsyscall(SB) + RET +ok9: + MOVL AX, 44(SP) // r1 + MOVL DX, 48(SP) // r2 + MOVL $0, 52(SP) // errno + CALL runtime·exitsyscall(SB) + RET + TEXT ·RawSyscall(SB),7,$0 MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -81,3 +111,27 @@ ok1: MOVL DX, 24(SP) // r2 MOVL $0, 28(SP) // errno RET + +TEXT ·RawSyscall6(SB),7,$0 + MOVL 4(SP), AX // syscall entry + // slide args down on top of system call number + LEAL 8(SP), SI + LEAL 4(SP), DI + CLD + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + INT $0x80 + JAE ok2 + MOVL $-1, 32(SP) // r1 + MOVL $-1, 36(SP) // r2 + MOVL AX, 40(SP) // errno + RET +ok2: + MOVL AX, 32(SP) // r1 + MOVL DX, 36(SP) // r2 + MOVL $0, 40(SP) // errno + RET diff --git a/src/pkg/syscall/asm_darwin_amd64.s b/src/pkg/syscall/asm_darwin_amd64.s index a9e2dfcca..1613622aa 100644 --- a/src/pkg/syscall/asm_darwin_amd64.s +++ b/src/pkg/syscall/asm_darwin_amd64.s @@ -78,3 +78,24 @@ ok1: MOVQ DX, 48(SP) // r2 MOVQ $0, 56(SP) // errno RET + +TEXT ·RawSyscall6(SB),7,$0 + MOVQ 16(SP), DI + MOVQ 24(SP), SI + MOVQ 32(SP), DX + MOVQ 40(SP), R10 + MOVQ 48(SP), R8 + MOVQ 56(SP), R9 + MOVQ 8(SP), AX // syscall entry + ADDQ $0x2000000, AX + SYSCALL + JCC ok2 + MOVQ $-1, 64(SP) // r1 + MOVQ $0, 72(SP) // r2 + MOVQ AX, 80(SP) // errno + RET +ok2: + MOVQ AX, 64(SP) // r1 + MOVQ DX, 72(SP) // r2 + MOVQ $0, 80(SP) // errno + RET diff --git a/src/pkg/syscall/asm_freebsd_386.s b/src/pkg/syscall/asm_freebsd_386.s index c652dcbd0..f2d4438a1 100644 --- a/src/pkg/syscall/asm_freebsd_386.s +++ b/src/pkg/syscall/asm_freebsd_386.s @@ -61,6 +61,36 @@ ok6: CALL runtime·exitsyscall(SB) RET +TEXT ·Syscall9(SB),7,$0 + CALL runtime·entersyscall(SB) + MOVL 4(SP), AX // syscall entry + // slide args down on top of system call number + LEAL 8(SP), SI + LEAL 4(SP), DI + CLD + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + INT $0x80 + JAE ok9 + MOVL $-1, 44(SP) // r1 + MOVL $-1, 48(SP) // r2 + MOVL AX, 52(SP) // errno + CALL runtime·exitsyscall(SB) + RET +ok9: + MOVL AX, 44(SP) // r1 + MOVL DX, 48(SP) // r2 + MOVL $0, 52(SP) // errno + CALL runtime·exitsyscall(SB) + RET + TEXT ·RawSyscall(SB),7,$0 MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -81,3 +111,27 @@ ok1: MOVL DX, 24(SP) // r2 MOVL $0, 28(SP) // errno RET + +TEXT ·RawSyscall6(SB),7,$0 + MOVL 4(SP), AX // syscall entry + // slide args down on top of system call number + LEAL 8(SP), SI + LEAL 4(SP), DI + CLD + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + INT $0x80 + JAE ok2 + MOVL $-1, 32(SP) // r1 + MOVL $-1, 36(SP) // r2 + MOVL AX, 40(SP) // errno + RET +ok2: + MOVL AX, 32(SP) // r1 + MOVL DX, 36(SP) // r2 + MOVL $0, 40(SP) // errno + RET diff --git a/src/pkg/syscall/asm_freebsd_amd64.s b/src/pkg/syscall/asm_freebsd_amd64.s index d70620a4e..022db697a 100644 --- a/src/pkg/syscall/asm_freebsd_amd64.s +++ b/src/pkg/syscall/asm_freebsd_amd64.s @@ -75,3 +75,23 @@ ok1: MOVQ DX, 48(SP) // r2 MOVQ $0, 56(SP) // errno RET + +TEXT ·RawSyscall6(SB),7,$0 + MOVQ 16(SP), DI + MOVQ 24(SP), SI + MOVQ 32(SP), DX + MOVQ 40(SP), R10 + MOVQ 48(SP), R8 + MOVQ 56(SP), R9 + MOVQ 8(SP), AX // syscall entry + SYSCALL + JCC ok2 + MOVQ $-1, 64(SP) // r1 + MOVQ $0, 72(SP) // r2 + MOVQ AX, 80(SP) // errno + RET +ok2: + MOVQ AX, 64(SP) // r1 + MOVQ DX, 72(SP) // r2 + MOVQ $0, 80(SP) // errno + RET diff --git a/src/pkg/syscall/asm_linux_386.s b/src/pkg/syscall/asm_linux_386.s index 68b5baa65..82f170b5b 100644 --- a/src/pkg/syscall/asm_linux_386.s +++ b/src/pkg/syscall/asm_linux_386.s @@ -34,7 +34,6 @@ ok: RET // func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); -// Actually Syscall5 but the rest of the code expects it to be named Syscall6. TEXT ·Syscall6(SB),7,$0 CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry @@ -43,7 +42,7 @@ TEXT ·Syscall6(SB),7,$0 MOVL 16(SP), DX MOVL 20(SP), SI MOVL 24(SP), DI - // 28(SP) is ignored + MOVL 28(SP), BP INT $0x80 CMPL AX, $0xfffff001 JLS ok6 @@ -82,6 +81,29 @@ ok1: MOVL $0, 28(SP) // errno RET +// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); +TEXT ·RawSyscall6(SB),7,$0 + MOVL 4(SP), AX // syscall entry + MOVL 8(SP), BX + MOVL 12(SP), CX + MOVL 16(SP), DX + MOVL 20(SP), SI + MOVL 24(SP), DI + MOVL 28(SP), BP + INT $0x80 + CMPL AX, $0xfffff001 + JLS ok2 + MOVL $-1, 32(SP) // r1 + MOVL $0, 36(SP) // r2 + NEGL AX + MOVL AX, 40(SP) // errno + RET +ok2: + MOVL AX, 32(SP) // r1 + MOVL DX, 36(SP) // r2 + MOVL $0, 40(SP) // errno + RET + #define SYS_SOCKETCALL 102 /* from zsysnum_linux_386.go */ // func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int) @@ -108,6 +130,27 @@ oksock: CALL runtime·exitsyscall(SB) RET +// func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int) +// Kernel interface gets call sub-number and pointer to a0. +TEXT ·rawsocketcall(SB),7,$0 + MOVL $SYS_SOCKETCALL, AX // syscall entry + MOVL 4(SP), BX // socket call number + LEAL 8(SP), CX // pointer to call arguments + MOVL $0, DX + MOVL $0, SI + MOVL $0, DI + INT $0x80 + CMPL AX, $0xfffff001 + JLS oksock1 + MOVL $-1, 32(SP) // n + NEGL AX + MOVL AX, 36(SP) // errno + RET +oksock1: + MOVL AX, 32(SP) // n + MOVL $0, 36(SP) // errno + RET + #define SYS__LLSEEK 140 /* from zsysnum_linux_386.go */ // func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) // Implemented in assembly to avoid allocation when diff --git a/src/pkg/syscall/asm_linux_amd64.s b/src/pkg/syscall/asm_linux_amd64.s index 20a5a4fb7..fdc233ca5 100644 --- a/src/pkg/syscall/asm_linux_amd64.s +++ b/src/pkg/syscall/asm_linux_amd64.s @@ -83,6 +83,28 @@ ok1: MOVQ $0, 56(SP) // errno RET +TEXT ·RawSyscall6(SB),7,$0 + MOVQ 16(SP), DI + MOVQ 24(SP), SI + MOVQ 32(SP), DX + MOVQ 40(SP), R10 + MOVQ 48(SP), R8 + MOVQ 56(SP), R9 + MOVQ 8(SP), AX // syscall entry + SYSCALL + CMPQ AX, $0xfffffffffffff001 + JLS ok2 + MOVQ $-1, 64(SP) // r1 + MOVQ $0, 72(SP) // r2 + NEGQ AX + MOVQ AX, 80(SP) // errno + RET +ok2: + MOVQ AX, 64(SP) // r1 + MOVQ DX, 72(SP) // r2 + MOVQ $0, 80(SP) // errno + RET + TEXT ·Gettimeofday(SB),7,$0 MOVQ 8(SP), DI MOVQ $0, SI diff --git a/src/pkg/syscall/asm_linux_arm.s b/src/pkg/syscall/asm_linux_arm.s index 04dbdb624..2651b7284 100644 --- a/src/pkg/syscall/asm_linux_arm.s +++ b/src/pkg/syscall/asm_linux_arm.s @@ -67,6 +67,34 @@ ok6: BL runtime·exitsyscall(SB) RET +// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); +// Actually RawSyscall5 but the rest of the code expects it to be named RawSyscall6. +TEXT ·RawSyscall6(SB),7,$0 + MOVW 4(SP), R7 // syscall entry + MOVW 8(SP), R0 + MOVW 12(SP), R1 + MOVW 16(SP), R2 + MOVW 20(SP), R3 + MOVW 24(SP), R4 + MOVW 28(SP), R5 + SWI $0 + MOVW $0xfffff001, R6 + CMP R6, R0 + BLS ok2 + MOVW $-1, R1 + MOVW R1, 32(SP) // r1 + MOVW $0, R2 + MOVW R2, 36(SP) // r2 + RSB $0, R0, R0 + MOVW R0, 40(SP) // errno + RET +ok2: + MOVW R0, 32(SP) // r1 + MOVW R1, 36(SP) // r2 + MOVW $0, R0 + MOVW R0, 40(SP) // errno + RET + #define SYS__LLSEEK 140 /* from zsysnum_linux_arm.go */ // func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) // Implemented in assembly to avoid allocation when diff --git a/src/pkg/syscall/asm_plan9_386.s b/src/pkg/syscall/asm_plan9_386.s new file mode 100644 index 000000000..86ebedccc --- /dev/null +++ b/src/pkg/syscall/asm_plan9_386.s @@ -0,0 +1,151 @@ +// 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. + +// +// System call support for 386, Plan 9 +// + +//func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err string) +//func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err string) +//func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) +//func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) + +// Trap # in AX, args on stack above caller pc. +TEXT ·Syscall(SB),7,$0 + CALL runtime·entersyscall(SB) + MOVL 4(SP), AX // syscall entry + // slide args down on top of system call number + LEAL 8(SP), SI + LEAL 4(SP), DI + CLD + MOVSL + MOVSL + MOVSL + INT $64 + MOVL AX, r1+20(SP) + MOVL $0, r2+24(SP) + CMPL AX, $-1 + JNE ok3 + + SUBL $8, SP + CALL syscall·errstr(SB) + MOVL SP, SI + ADDL $8, SP + JMP copyresult3 + +ok3: + LEAL runtime·emptystring(SB), SI + +copyresult3: + LEAL err+28(SP), DI + + CLD + MOVSL + MOVSL + + CALL runtime·exitsyscall(SB) + RET + +TEXT ·Syscall6(SB),7,$0 + CALL runtime·entersyscall(SB) + MOVL 4(SP), AX // syscall entry + // slide args down on top of system call number + LEAL 8(SP), SI + LEAL 4(SP), DI + CLD + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + INT $64 + MOVL AX, r1+32(SP) + MOVL $0, r2+36(SP) + CMPL AX, $-1 + JNE ok4 + + SUBL $8, SP + CALL syscall·errstr(SB) + MOVL SP, SI + ADDL $8, SP + JMP copyresult4 + +ok4: + LEAL runtime·emptystring(SB), SI + +copyresult4: + LEAL err+40(SP), DI + + CLD + MOVSL + MOVSL + + CALL runtime·exitsyscall(SB) + RET + +TEXT ·RawSyscall(SB),7,$0 + MOVL 4(SP), AX // syscall entry + // slide args down on top of system call number + LEAL 8(SP), SI + LEAL 4(SP), DI + CLD + MOVSL + MOVSL + MOVSL + INT $64 + MOVL AX, r1+20(SP) + MOVL AX, r2+24(SP) + MOVL AX, err+28(SP) + RET + +TEXT ·RawSyscall6(SB),7,$0 + MOVL 4(SP), AX // syscall entry + // slide args down on top of system call number + LEAL 8(SP), SI + LEAL 4(SP), DI + CLD + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + MOVSL + INT $64 + MOVL AX, r1+32(SP) + MOVL AX, r2+36(SP) + MOVL AX, err+40(SP) + RET + +#define SYS_SEEK 39 /* from zsysnum_plan9_386.go */ + +//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) +TEXT ·seek(SB),7,$0 + LEAL newoffset+24(SP), AX + MOVL AX, placeholder+4(SP) + + MOVL $SYS_SEEK, AX // syscall entry + INT $64 + + CMPL AX, $-1 + JNE ok6 + MOVL AX, 24(SP) // newoffset low + MOVL AX, 28(SP) // newoffset high + + SUBL $8, SP + CALL syscall·errstr(SB) + MOVL SP, SI + ADDL $8, SP + JMP copyresult6 + +ok6: + LEAL runtime·emptystring(SB), SI + +copyresult6: + LEAL err+32(SP), DI + + CLD + MOVSL + MOVSL + RET diff --git a/src/pkg/syscall/exec_plan9.go b/src/pkg/syscall/exec_plan9.go new file mode 100644 index 000000000..962b39b78 --- /dev/null +++ b/src/pkg/syscall/exec_plan9.go @@ -0,0 +1,521 @@ +// 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 child in a fork/exec sequence to inherit only the +// file descriptors we intend. To do that, we mark all file +// descriptors close-on-exec and then, in the child, explicitly +// unmark the ones we want the exec'ed program to keep. +// Unix doesn't make this easy: there is, in general, no way to +// allocate a new file descriptor close-on-exec. Instead you +// have to allocate the descriptor and then mark it close-on-exec. +// If a fork happens between those two events, the child's exec +// will inherit an unwanted file descriptor. +// +// This lock solves that race: the create new fd/mark close-on-exec +// operation is done holding ForkLock for reading, and the fork itself +// is done holding ForkLock for writing. At least, that's the idea. +// There are some complications. +// +// Some system calls that create new file descriptors can block +// for arbitrarily long times: open on a hung NFS server or named +// pipe, accept on a socket, and so on. We can't reasonably grab +// the lock across those operations. +// +// It is worse to inherit some file descriptors than others. +// If a non-malicious child accidentally inherits an open ordinary file, +// that's not a big deal. On the other hand, if a long-lived child +// accidentally inherits the write end of a pipe, then the reader +// of that pipe will not see EOF until that child exits, potentially +// causing the parent program to hang. This is a common problem +// in threaded C programs that use popen. +// +// Luckily, the file descriptors that are most important not to +// inherit are not the ones that can take an arbitrarily long time +// to create: pipe returns instantly, and the net package uses +// non-blocking I/O to accept on a listening socket. +// The rules for which file descriptor-creating operations use the +// ForkLock are as follows: +// +// 1) Pipe. Does not block. Use the ForkLock. +// 2) Socket. Does not block. Use the ForkLock. +// 3) Accept. If using non-blocking mode, use the ForkLock. +// Otherwise, live with the race. +// 4) Open. Can block. Use O_CLOEXEC if available (Linux). +// Otherwise, live with the race. +// 5) Dup. Does not block. Use the ForkLock. +// On Linux, could use fcntl F_DUPFD_CLOEXEC +// instead of the ForkLock, but only for dup(fd, -1). + +var ForkLock sync.RWMutex + +// Convert array of string to array +// of NUL-terminated byte pointer. +func StringArrayPtr(ss []string) []*byte { + bb := make([]*byte, len(ss)+1) + for i := 0; i < len(ss); i++ { + bb[i] = StringBytePtr(ss[i]) + } + bb[len(ss)] = nil + return bb +} + +// gbit16 reads a 16-bit numeric value from a 9P protocol message strored in b, +// returning the value and the remaining slice of b. +func gbit16(b []byte) (uint16, []byte) { + return uint16(b[0]) | uint16(b[1])<<8, b[2:] +} + +// gstring reads a string from a 9P protocol message strored in b, +// returning the value as a Go string and the remaining slice of b. +func gstring(b []byte) (string, []byte) { + n, b := gbit16(b) + return string(b[0:n]), b[n:] +} + +// readdirnames returns the names of files inside the directory represented by dirfd. +func readdirnames(dirfd int) (names []string, err Error) { + result := make([]string, 0, 100) + var buf [STATMAX]byte + + for { + n, e := Read(dirfd, buf[:]) + if e != nil { + return []string{}, e + } + if n == 0 { + break + } + + for i := 0; i < n; { + m, _ := gbit16(buf[i:]) + m += 2 + + if m < STATFIXLEN { + return []string{}, NewError("malformed stat buffer") + } + + name, _ := gstring(buf[i+41:]) + result = append(result, name) + + i += int(m) + } + } + return []string{}, nil +} + +// readdupdevice returns a list of currently opened fds (excluding stdin, stdout, stderr) from the dup device #d. +// ForkLock should be write locked before calling, so that no new fds would be created while the fd list is being read. +func readdupdevice() (fds []int, err Error) { + dupdevfd, err := Open("#d", O_RDONLY) + + if err != nil { + return + } + defer Close(dupdevfd) + + fileNames, err := readdirnames(dupdevfd) + if err != nil { + return + } + + fds = make([]int, 0, len(fileNames)>>1) + for _, fdstr := range fileNames { + if l := len(fdstr); l > 2 && fdstr[l-3] == 'c' && fdstr[l-2] == 't' && fdstr[l-1] == 'l' { + continue + } + + fd := int(atoi([]byte(fdstr))) + + if fd == 0 || fd == 1 || fd == 2 || fd == dupdevfd { + continue + } + + fds = append(fds, fd) + } + + return fds[0:len(fds)], nil +} + +var startupFds []int + +// Plan 9 does not allow clearing the OCEXEC flag +// from the underlying channel backing an open file descriptor, +// therefore we store a list of already opened file descriptors +// inside startupFds and skip them when manually closing descriptors +// not meant to be passed to a child exec. +func init() { + startupFds, _ = readdupdevice() +} + +// forkAndExecInChild forks the process, calling dup onto 0..len(fd) +// and finally invoking exec(argv0, argvv, envv) in the child. +// If a dup or exec fails, it writes the error string to pipe. +// (The pipe write end is close-on-exec so if exec succeeds, it will be closed.) +// +// In the child, this function must not acquire any locks, because +// they might have been locked at the time of the fork. This means +// no rescheduling, no malloc calls, and no new stack segments. +// The calls to RawSyscall are okay because they are assembly +// functions that do not grow the stack. +func forkAndExecInChild(argv0 *byte, argv []*byte, envv []envItem, chroot, dir *byte, attr *ProcAttr, fdsToClose []int, pipe int) (pid int, err Error) { + // Declare all variables at top in case any + // declarations require heap allocation (e.g., errbuf). + var ( + r1 uintptr + nextfd int + i int + clearenv int + envfd int + errbuf [ERRMAX]byte + ) + + // guard against side effects of shuffling fds below. + fd := append([]int(nil), attr.Files...) + + if envv != nil { + clearenv = RFCENVG + } + + // About to call fork. + // No more allocation or calls of non-assembly functions. + r1, _, _ = RawSyscall(SYS_RFORK, uintptr(RFPROC|RFFDG|RFREND|clearenv), 0, 0) + + if r1 != 0 { + if int(r1) == -1 { + return 0, NewError(errstr()) + } + // parent; return PID + return int(r1), nil + } + + // Fork succeeded, now in child. + + // Close fds we don't need. + for i = 0; i < len(fdsToClose); i++ { + r1, _, _ = RawSyscall(SYS_CLOSE, uintptr(fdsToClose[i]), 0, 0) + if int(r1) == -1 { + goto childerror + } + } + + if envv != nil { + // Write new environment variables. + for i = 0; i < len(envv); i++ { + r1, _, _ = RawSyscall(SYS_CREATE, uintptr(unsafe.Pointer(envv[i].name)), uintptr(O_WRONLY), uintptr(0666)) + + if int(r1) == -1 { + goto childerror + } + + envfd = int(r1) + + r1, _, _ = RawSyscall6(SYS_PWRITE, uintptr(envfd), uintptr(unsafe.Pointer(envv[i].value)), uintptr(envv[i].nvalue), + ^uintptr(0), ^uintptr(0), 0) + + if int(r1) == -1 || int(r1) != envv[i].nvalue { + goto childerror + } + + r1, _, _ = RawSyscall(SYS_CLOSE, uintptr(envfd), 0, 0) + + if int(r1) == -1 { + goto childerror + } + } + } + + // Chdir + if dir != nil { + r1, _, _ = RawSyscall(SYS_CHDIR, uintptr(unsafe.Pointer(dir)), 0, 0) + if int(r1) == -1 { + goto childerror + } + } + + // Pass 1: look for fd[i] < i and move those up above len(fd) + // so that pass 2 won't stomp on an fd it needs later. + nextfd = int(len(fd)) + if pipe < nextfd { + r1, _, _ = RawSyscall(SYS_DUP, uintptr(pipe), uintptr(nextfd), 0) + if int(r1) == -1 { + goto childerror + } + pipe = nextfd + nextfd++ + } + for i = 0; i < len(fd); i++ { + if fd[i] >= 0 && fd[i] < int(i) { + r1, _, _ = RawSyscall(SYS_DUP, uintptr(fd[i]), uintptr(nextfd), 0) + if int(r1) == -1 { + goto childerror + } + + fd[i] = nextfd + nextfd++ + if nextfd == pipe { // don't stomp on pipe + nextfd++ + } + } + } + + // Pass 2: dup fd[i] down onto i. + for i = 0; i < len(fd); i++ { + if fd[i] == -1 { + RawSyscall(SYS_CLOSE, uintptr(i), 0, 0) + continue + } + if fd[i] == int(i) { + continue + } + + r1, _, _ = RawSyscall(SYS_DUP, uintptr(fd[i]), uintptr(i), 0) + if int(r1) == -1 { + goto childerror + } + RawSyscall(SYS_CLOSE, uintptr(fd[i]), 0, 0) + } + + // Time to exec. + r1, _, _ = RawSyscall(SYS_EXEC, + uintptr(unsafe.Pointer(argv0)), + uintptr(unsafe.Pointer(&argv[0])), 0) + +childerror: + // send error string on pipe + RawSyscall(SYS_ERRSTR, uintptr(unsafe.Pointer(&errbuf[0])), uintptr(len(errbuf)), 0) + errbuf[len(errbuf)-1] = 0 + i = 0 + for i < len(errbuf) && errbuf[i] != 0 { + i++ + } + + RawSyscall6(SYS_PWRITE, uintptr(pipe), uintptr(unsafe.Pointer(&errbuf[0])), uintptr(i), + ^uintptr(0), ^uintptr(0), 0) + + for { + RawSyscall(SYS_EXITS, 0, 0, 0) + } + + // Calling panic is not actually safe, + // but the for loop above won't break + // and this shuts up the compiler. + panic("unreached") +} + +func cexecPipe(p []int) Error { + e := Pipe(p) + if e != nil { + return e + } + + fd, e := Open("#d/"+itoa(p[1]), O_CLOEXEC) + if e != nil { + Close(p[0]) + Close(p[1]) + return e + } + + Close(fd) + return nil +} + +type envItem struct { + name *byte + value *byte + nvalue int +} + +type ProcAttr struct { + Dir string // Current working directory. + Env []string // Environment. + Files []int // File descriptors. + Chroot string // Chroot. +} + +var zeroAttributes ProcAttr + + +func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err Error) { + var ( + p [2]int + n int + errbuf [ERRMAX]byte + wmsg Waitmsg + ) + + if attr == nil { + attr = &zeroAttributes + } + + p[0] = -1 + p[1] = -1 + + // Convert args to C form. + argv0p := StringBytePtr(argv0) + argvp := StringArrayPtr(argv) + + var chroot *byte + if attr.Chroot != "" { + chroot = StringBytePtr(attr.Chroot) + } + var dir *byte + if attr.Dir != "" { + dir = StringBytePtr(attr.Dir) + } + var envvParsed []envItem + if attr.Env != nil { + envvParsed = make([]envItem, 0, len(attr.Env)) + for _, v := range attr.Env { + i := 0 + for i < len(v) && v[i] != '=' { + i++ + } + + envvParsed = append(envvParsed, envItem{StringBytePtr("/env/" + v[:i]), StringBytePtr(v[i+1:]), len(v) - i}) + } + } + + // Acquire the fork lock to prevent other threads from creating new fds before we fork. + ForkLock.Lock() + + // get a list of open fds, excluding stdin,stdout and stderr that need to be closed in the child. + // no new fds can be created while we hold the ForkLock for writing. + openFds, e := readdupdevice() + + if e != nil { + ForkLock.Unlock() + return 0, e + } + + fdsToClose := make([]int, 0, len(openFds)) + // exclude fds opened from startup from the list of fds to be closed. + for _, fd := range openFds { + isReserved := false + for _, reservedFd := range startupFds { + if fd == reservedFd { + isReserved = true + break + } + } + + if !isReserved { + fdsToClose = append(fdsToClose, fd) + } + } + + // exclude fds requested by the caller from the list of fds to be closed. + for _, fd := range openFds { + isReserved := false + for _, reservedFd := range attr.Files { + if fd == reservedFd { + isReserved = true + break + } + } + + if !isReserved { + fdsToClose = append(fdsToClose, fd) + } + } + + // Allocate child status pipe close on exec. + e = cexecPipe(p[:]) + + if e != nil { + return 0, e + } + fdsToClose = append(fdsToClose, p[0]) + + // Kick off child. + pid, err = forkAndExecInChild(argv0p, argvp, envvParsed, chroot, dir, attr, fdsToClose, p[1]) + + if err != nil { + if p[0] >= 0 { + Close(p[0]) + Close(p[1]) + } + ForkLock.Unlock() + return 0, err + } + ForkLock.Unlock() + + // Read child error status from pipe. + Close(p[1]) + n, err = Read(p[0], errbuf[:]) + Close(p[0]) + + if err != nil || n != 0 { + if n != 0 { + err = NewError(string(errbuf[:])) + } + + // Child failed; wait for it to exit, to make sure + // the zombies don't accumulate. + for wmsg.Pid != pid { + Await(&wmsg) + } + return 0, err + } + + // Read got EOF, so pipe closed on exec, so exec succeeded. + return pid, nil +} + +// Combination of fork and exec, careful to be thread safe. +func ForkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err Error) { + return forkExec(argv0, argv, attr) +} + +// StartProcess wraps ForkExec for package os. +func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err Error) { + pid, err = forkExec(argv0, argv, attr) + return pid, 0, err +} + +// Ordinary exec. +func Exec(argv0 string, argv []string, envv []string) (err Error) { + if envv != nil { + r1, _, _ := RawSyscall(SYS_RFORK, RFCENVG, 0, 0) + if int(r1) == -1 { + return NewError(errstr()) + } + + for _, v := range envv { + i := 0 + for i < len(v) && v[i] != '=' { + i++ + } + + fd, e := Create("/env/"+v[:i], O_WRONLY, 0666) + if e != nil { + return e + } + + _, e = Write(fd, []byte(v[i+1:])) + if e != nil { + Close(fd) + return e + } + Close(fd) + } + } + + _, _, e := Syscall(SYS_EXEC, + uintptr(unsafe.Pointer(StringBytePtr(argv0))), + uintptr(unsafe.Pointer(&StringArrayPtr(argv)[0])), + 0) + + return NewError(e) +} diff --git a/src/pkg/syscall/exec_unix.go b/src/pkg/syscall/exec_unix.go index 2e09539ee..b6cb1baa2 100644 --- a/src/pkg/syscall/exec_unix.go +++ b/src/pkg/syscall/exec_unix.go @@ -96,13 +96,16 @@ func SetNonblock(fd int, nonblocking bool) (errno int) { // no rescheduling, no malloc calls, and no new stack segments. // The calls to RawSyscall are okay because they are assembly // functions that do not grow the stack. -func forkAndExecInChild(argv0 *byte, argv []*byte, envv []*byte, traceme bool, dir *byte, fd []int, pipe int) (pid int, err int) { +func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, pipe int) (pid int, err int) { // Declare all variables at top in case any // declarations require heap allocation (e.g., err1). var r1, r2, err1 uintptr var nextfd int var i int + // guard against side effects of shuffling fds below. + fd := append([]int(nil), attr.Files...) + darwin := OS == "darwin" // About to call fork. @@ -128,13 +131,50 @@ func forkAndExecInChild(argv0 *byte, argv []*byte, envv []*byte, traceme bool, d // Fork succeeded, now in child. // Enable tracing if requested. - if traceme { + if attr.Ptrace { _, _, err1 = RawSyscall(SYS_PTRACE, uintptr(PTRACE_TRACEME), 0, 0) if err1 != 0 { goto childerror } } + // Session ID + if attr.Setsid { + _, _, err1 = RawSyscall(SYS_SETSID, 0, 0, 0) + if err1 != 0 { + goto childerror + } + } + + // Chroot + if chroot != nil { + _, _, err1 = RawSyscall(SYS_CHROOT, uintptr(unsafe.Pointer(chroot)), 0, 0) + if err1 != 0 { + goto childerror + } + } + + // User and groups + if attr.Credential != nil { + ngroups := uintptr(len(attr.Credential.Groups)) + groups := uintptr(0) + if ngroups > 0 { + groups = uintptr(unsafe.Pointer(&attr.Credential.Groups[0])) + } + _, _, err1 = RawSyscall(SYS_SETGROUPS, ngroups, groups, 0) + if err1 != 0 { + goto childerror + } + _, _, err1 = RawSyscall(SYS_SETGID, uintptr(attr.Credential.Gid), 0, 0) + if err1 != 0 { + goto childerror + } + _, _, err1 = RawSyscall(SYS_SETUID, uintptr(attr.Credential.Uid), 0, 0) + if err1 != 0 { + goto childerror + } + } + // Chdir if dir != nil { _, _, err1 = RawSyscall(SYS_CHDIR, uintptr(unsafe.Pointer(dir)), 0, 0) @@ -220,28 +260,55 @@ childerror: panic("unreached") } -func forkExec(argv0 string, argv []string, envv []string, traceme bool, dir string, fd []int) (pid int, err int) { +type Credential struct { + Uid uint32 // User ID. + Gid uint32 // Group ID. + Groups []uint32 // Supplementary group IDs. +} + +type ProcAttr struct { + Setsid bool // Create session. + Ptrace bool // Enable tracing. + Dir string // Current working directory. + Env []string // Environment. + Files []int // File descriptors. + Chroot string // Chroot. + Credential *Credential // Credential. +} + +var zeroAttributes ProcAttr + +func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err int) { var p [2]int var n int var err1 uintptr var wstatus WaitStatus + if attr == nil { + attr = &zeroAttributes + } + p[0] = -1 p[1] = -1 // Convert args to C form. argv0p := StringBytePtr(argv0) argvp := StringArrayPtr(argv) - envvp := StringArrayPtr(envv) - var dirp *byte - if len(dir) > 0 { - dirp = StringBytePtr(dir) - } + envvp := StringArrayPtr(attr.Env) if OS == "freebsd" && len(argv[0]) > len(argv0) { argvp[0] = argv0p } + var chroot *byte + if attr.Chroot != "" { + chroot = StringBytePtr(attr.Chroot) + } + var dir *byte + if attr.Dir != "" { + dir = StringBytePtr(attr.Dir) + } + // Acquire the fork lock so that no other threads // create new fds that are not yet close-on-exec // before we fork. @@ -259,7 +326,7 @@ func forkExec(argv0 string, argv []string, envv []string, traceme bool, dir stri } // Kick off child. - pid, err = forkAndExecInChild(argv0p, argvp, envvp, traceme, dirp, fd, p[1]) + pid, err = forkAndExecInChild(argv0p, argvp, envvp, chroot, dir, attr, p[1]) if err != 0 { error: if p[0] >= 0 { @@ -297,13 +364,14 @@ func forkExec(argv0 string, argv []string, envv []string, traceme bool, dir stri } // Combination of fork and exec, careful to be thread safe. -func ForkExec(argv0 string, argv []string, envv []string, dir string, fd []int) (pid int, err int) { - return forkExec(argv0, argv, envv, false, dir, fd) +func ForkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err int) { + return forkExec(argv0, argv, attr) } -// PtraceForkExec is like ForkExec, but starts the child in a traced state. -func PtraceForkExec(argv0 string, argv []string, envv []string, dir string, fd []int) (pid int, err int) { - return forkExec(argv0, argv, envv, true, dir, fd) +// StartProcess wraps ForkExec for package os. +func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err int) { + pid, err = forkExec(argv0, argv, attr) + return pid, 0, err } // Ordinary exec. @@ -314,9 +382,3 @@ func Exec(argv0 string, argv []string, envv []string) (err int) { uintptr(unsafe.Pointer(&StringArrayPtr(envv)[0]))) return int(err1) } - -// StartProcess wraps ForkExec for package os. -func StartProcess(argv0 string, argv []string, envv []string, dir string, fd []int) (pid, handle int, err int) { - pid, err = forkExec(argv0, argv, envv, false, dir, fd) - return pid, 0, err -} diff --git a/src/pkg/syscall/exec_windows.go b/src/pkg/syscall/exec_windows.go index 73c3c8624..aeee191dd 100644 --- a/src/pkg/syscall/exec_windows.go +++ b/src/pkg/syscall/exec_windows.go @@ -11,48 +11,92 @@ import ( "utf16" ) -// Windows doesn't have a good concept of just Exec in the documented API. -// However, the kernel32 CreateProcess does a good job with -// ForkExec. - var ForkLock sync.RWMutex -// Joins an array of string with sep -// From the "strings" package. Modified. -func stringJoin(a []string, sep string, escape escapeFunc) string { - if len(a) == 0 { - return "" +// escape rewrites command line argument s as prescribed +// in http://msdn.microsoft.com/en-us/library/ms880421. +// This function returns "" (2 double quotes) if s is empty. +// Alternatively, these transformations are done: +// - every back slash (\) is doubled, but only if immediately +// followed by double quote ("); +// - every double quote (") is escaped by back slash (\); +// - finally, s is wrapped with double quotes (arg -> "arg"), +// but only if there is space or tab inside s. +func escape(s string) string { + if len(s) == 0 { + return "\"\"" } - if len(a) == 1 { - return a[0] + n := len(s) + hasSpace := false + for i := 0; i < len(s); i++ { + switch s[i] { + case '"', '\\': + n++ + case ' ', '\t': + hasSpace = true + } } - n := len(sep) * (len(a) - 1) - for i := 0; i < len(a); i++ { - a[i] = escape(a[i]) - n += len(a[i]) + if hasSpace { + n += 2 + } + if n == len(s) { + return s } - b := make([]byte, n) - bp := 0 - for i := 0; i < len(a); i++ { - s := a[i] - for j := 0; j < len(s); j++ { - b[bp] = s[j] - bp++ - } - if i+1 < len(a) { - s = sep - for j := 0; j < len(s); j++ { - b[bp] = s[j] - bp++ + qs := make([]byte, n) + j := 0 + if hasSpace { + qs[j] = '"' + j++ + } + slashes := 0 + for i := 0; i < len(s); i++ { + switch s[i] { + default: + slashes = 0 + qs[j] = s[i] + case '\\': + slashes++ + qs[j] = s[i] + case '"': + for ; slashes > 0; slashes-- { + qs[j] = '\\' + j++ } + qs[j] = '\\' + j++ + qs[j] = s[i] } + j++ } - return string(b) + if hasSpace { + for ; slashes > 0; slashes-- { + qs[j] = '\\' + j++ + } + qs[j] = '"' + j++ + } + return string(qs[:j]) +} + +// makeCmdLine builds a command line out of args by escaping "special" +// characters and joining the arguments with spaces. +func makeCmdLine(args []string) string { + var s string + for _, v := range args { + if s != "" { + s += " " + } + s += escape(v) + } + return s } -//Env block is a sequence of null terminated strings followed by a null. -//Last bytes are two unicode nulls, or four null bytes. +// createEnvBlock converts an array of environment strings into +// the representation required by CreateProcess: a sequence of NUL +// terminated strings followed by a nil. +// Last bytes are two UCS-2 NULs, or four NUL bytes. func createEnvBlock(envv []string) *uint16 { if len(envv) == 0 { return &utf16.Encode([]int("\x00\x00"))[0] @@ -76,69 +120,146 @@ func createEnvBlock(envv []string) *uint16 { return &utf16.Encode([]int(string(b)))[0] } -type escapeFunc func(s string) string - -//escapes quotes by " -> "" -//Also string -> "string" -func escapeAddQuotes(s string) string { - //normal ascii char, one byte wide - rune := byte('"') - l := len(s) - n := 0 - for i := 0; i < l; i++ { - if s[i] == rune { - n++ +func CloseOnExec(fd int) { + SetHandleInformation(int32(fd), HANDLE_FLAG_INHERIT, 0) +} + +func SetNonblock(fd int, nonblocking bool) (errno int) { + return 0 +} + +// getFullPath retrieves the full path of the specified file. +// Just a wrapper for Windows GetFullPathName api. +func getFullPath(name string) (path string, err int) { + p := StringToUTF16Ptr(name) + buf := make([]uint16, 100) + n, err := GetFullPathName(p, uint32(len(buf)), &buf[0], nil) + if err != 0 { + return "", err + } + if n > uint32(len(buf)) { + // Windows is asking for bigger buffer. + buf = make([]uint16, n) + n, err = GetFullPathName(p, uint32(len(buf)), &buf[0], nil) + if err != 0 { + return "", err + } + if n > uint32(len(buf)) { + return "", EINVAL } } - qs := make([]byte, l+n+2) + return UTF16ToString(buf[:n]), 0 +} - qs[0] = rune - j := 1 - for i := 0; i < l; i++ { - qs[i+j] = s[i] - if s[i] == rune { - j++ - qs[i+j] = rune - } +func isSlash(c uint8) bool { + return c == '\\' || c == '/' +} + +func normalizeDir(dir string) (name string, err int) { + ndir, err := getFullPath(dir) + if err != 0 { + return "", err + } + if len(ndir) > 2 && isSlash(ndir[0]) && isSlash(ndir[1]) { + // dir cannot have \\server\share\path form + return "", EINVAL } - qs[len(qs)-1] = rune - return string(qs) + return ndir, 0 } +func volToUpper(ch int) int { + if 'a' <= ch && ch <= 'z' { + ch += 'A' - 'a' + } + return ch +} -func CloseOnExec(fd int) { - SetHandleInformation(int32(fd), HANDLE_FLAG_INHERIT, 0) +func joinExeDirAndFName(dir, p string) (name string, err int) { + if len(p) == 0 { + return "", EINVAL + } + if len(p) > 2 && isSlash(p[0]) && isSlash(p[1]) { + // \\server\share\path form + return p, 0 + } + if len(p) > 1 && p[1] == ':' { + // has drive letter + if len(p) == 2 { + return "", EINVAL + } + if isSlash(p[2]) { + return p, 0 + } else { + d, err := normalizeDir(dir) + if err != 0 { + return "", err + } + if volToUpper(int(p[0])) == volToUpper(int(d[0])) { + return getFullPath(d + "\\" + p[2:]) + } else { + return getFullPath(p) + } + } + } else { + // no drive letter + d, err := normalizeDir(dir) + if err != 0 { + return "", err + } + if isSlash(p[0]) { + return getFullPath(d[:2] + p) + } else { + return getFullPath(d + "\\" + p) + } + } + // we shouldn't be here + return "", EINVAL } -func SetNonblock(fd int, nonblocking bool) (errno int) { - return 0 +type ProcAttr struct { + Dir string + Env []string + Files []int } +var zeroAttributes ProcAttr -// TODO(kardia): Add trace -//The command and arguments are passed via the Command line parameter. -func StartProcess(argv0 string, argv []string, envv []string, dir string, fd []int) (pid, handle int, err int) { - if len(fd) > 3 { +func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err int) { + if len(argv0) == 0 { + return 0, 0, EWINDOWS + } + if attr == nil { + attr = &zeroAttributes + } + if len(attr.Files) > 3 { return 0, 0, EWINDOWS } - //CreateProcess will throw an error if the dir is not set to a valid dir - // thus get the working dir if dir is empty. - if len(dir) == 0 { - if wd, ok := Getwd(); ok == 0 { - dir = wd + if len(attr.Dir) != 0 { + // StartProcess assumes that argv0 is relative to attr.Dir, + // because it implies Chdir(attr.Dir) before executing argv0. + // Windows CreateProcess assumes the opposite: it looks for + // argv0 relative to the current directory, and, only once the new + // process is started, it does Chdir(attr.Dir). We are adjusting + // for that difference here by making argv0 absolute. + var err int + argv0, err = joinExeDirAndFName(attr.Dir, argv0) + if err != 0 { + return 0, 0, err } } + argv0p := StringToUTF16Ptr(argv0) - startupInfo := new(StartupInfo) - processInfo := new(ProcessInformation) - - GetStartupInfo(startupInfo) + var argvp *uint16 + s := makeCmdLine(argv) + if len(s) != 0 { + argvp = StringToUTF16Ptr(s) + } - startupInfo.Flags = STARTF_USESTDHANDLES - startupInfo.StdInput = 0 - startupInfo.StdOutput = 0 - startupInfo.StdErr = 0 + var dirp *uint16 + if len(attr.Dir) != 0 { + dirp = StringToUTF16Ptr(attr.Dir) + } // Acquire the fork lock so that no other threads // create new fds that are not yet close-on-exec @@ -146,54 +267,35 @@ func StartProcess(argv0 string, argv []string, envv []string, dir string, fd []i ForkLock.Lock() defer ForkLock.Unlock() - var currentProc, _ = GetCurrentProcess() - if len(fd) > 0 && fd[0] > 0 { - err := DuplicateHandle(currentProc, int32(fd[0]), currentProc, &startupInfo.StdInput, 0, true, DUPLICATE_SAME_ACCESS) - if err != 0 { - return 0, 0, err + p, _ := GetCurrentProcess() + fd := make([]int32, len(attr.Files)) + for i := range attr.Files { + if attr.Files[i] > 0 { + err := DuplicateHandle(p, int32(attr.Files[i]), p, &fd[i], 0, true, DUPLICATE_SAME_ACCESS) + if err != 0 { + return 0, 0, err + } + defer CloseHandle(int32(fd[i])) } - defer CloseHandle(int32(startupInfo.StdInput)) } - if len(fd) > 1 && fd[1] > 0 { - err := DuplicateHandle(currentProc, int32(fd[1]), currentProc, &startupInfo.StdOutput, 0, true, DUPLICATE_SAME_ACCESS) - if err != 0 { - return 0, 0, err - } - defer CloseHandle(int32(startupInfo.StdOutput)) + si := new(StartupInfo) + GetStartupInfo(si) + si.Flags = STARTF_USESTDHANDLES + si.StdInput = fd[0] + si.StdOutput = fd[1] + si.StdErr = fd[2] + + pi := new(ProcessInformation) + + err = CreateProcess(argv0p, argvp, nil, nil, true, CREATE_UNICODE_ENVIRONMENT, createEnvBlock(attr.Env), dirp, si, pi) + if err != 0 { + return 0, 0, err } - if len(fd) > 2 && fd[2] > 0 { - err := DuplicateHandle(currentProc, int32(fd[2]), currentProc, &startupInfo.StdErr, 0, true, DUPLICATE_SAME_ACCESS) - if err != 0 { - return 0, 0, err - } - defer CloseHandle(int32(startupInfo.StdErr)) - } - if len(argv) == 0 { - argv = []string{""} - } - // argv0 must not be longer then 256 chars - // but the entire cmd line can have up to 32k chars (msdn) - err = CreateProcess( - nil, - StringToUTF16Ptr(escapeAddQuotes(argv0)+" "+stringJoin(argv[1:], " ", escapeAddQuotes)), - nil, //ptr to struct lpProcessAttributes - nil, //ptr to struct lpThreadAttributes - true, //bInheritHandles - CREATE_UNICODE_ENVIRONMENT, //Flags - createEnvBlock(envv), //env block, NULL uses parent env - StringToUTF16Ptr(dir), - startupInfo, - processInfo) - - if err == 0 { - pid = int(processInfo.ProcessId) - handle = int(processInfo.Process) - CloseHandle(processInfo.Thread) - } - return + defer CloseHandle(pi.Thread) + + return int(pi.ProcessId), int(pi.Process), 0 } -// Ordinary exec. func Exec(argv0 string, argv []string, envv []string) (err int) { return EWINDOWS } diff --git a/src/pkg/syscall/mkall.sh b/src/pkg/syscall/mkall.sh index a1f8ae2ff..a2e6c5d71 100755 --- a/src/pkg/syscall/mkall.sh +++ b/src/pkg/syscall/mkall.sh @@ -63,7 +63,7 @@ # # * zsyscall_${GOOS}_${GOARCH}.go # -# Generated by mksyscall.sh; see syscall_${GOOS}.go above. +# Generated by mksyscall.pl; see syscall_${GOOS}.go above. # # * zsysnum_${GOOS}_${GOARCH}.go # @@ -76,11 +76,18 @@ GOOSARCH="${GOOS}_${GOARCH}" # defaults -mksyscall="./mksyscall.sh" +mksyscall="./mksyscall.pl" mkerrors="./mkerrors.sh" run="sh" case "$1" in +-syscalls) + for i in zsyscall*go + do + sed 1q $i | sed 's;^// ;;' | sh | gofmt >_$i && mv _$i $i + done + exit 0 + ;; -n) run="cat" shift @@ -101,59 +108,56 @@ _* | *_ | _) ;; freebsd_386) mkerrors="$mkerrors -f -m32" - mksyscall="./mksyscall.sh -l32" - mksysnum="curl -s 'http://svn.freebsd.org/viewvc/base/head/sys/kern/syscalls.master?view=markup' | ./mksysnum_freebsd.sh" + mksyscall="./mksyscall.pl -l32" + mksysnum="curl -s 'http://svn.freebsd.org/viewvc/base/head/sys/kern/syscalls.master?view=markup' | ./mksysnum_freebsd.pl" mktypes="godefs -gsyscall -f-m32" ;; freebsd_amd64) mkerrors="$mkerrors -f -m64" - mksysnum="curl -s 'http://svn.freebsd.org/viewvc/base/head/sys/kern/syscalls.master?view=markup' | ./mksysnum_freebsd.sh" + mksysnum="curl -s 'http://svn.freebsd.org/viewvc/base/head/sys/kern/syscalls.master?view=markup' | ./mksysnum_freebsd.pl" mktypes="godefs -gsyscall -f-m64" ;; darwin_386) mkerrors="$mkerrors -f -m32" - mksyscall="./mksyscall.sh -l32" - mksysnum="./mksysnum_darwin.sh /home/rsc/pub/xnu-1228/bsd/kern/syscalls.master" + mksyscall="./mksyscall.pl -l32" + mksysnum="./mksysnum_darwin.pl /home/rsc/pub/xnu-1228/bsd/kern/syscalls.master" mktypes="godefs -gsyscall -f-m32" ;; darwin_amd64) mkerrors="$mkerrors -f -m64" - mksysnum="./mksysnum_darwin.sh /home/rsc/pub/xnu-1228/bsd/kern/syscalls.master" + mksysnum="./mksysnum_darwin.pl /home/rsc/pub/xnu-1228/bsd/kern/syscalls.master" mktypes="godefs -gsyscall -f-m64" mkerrors="./mkerrors.sh" ;; linux_386) mkerrors="$mkerrors -f -m32" - mksyscall="./mksyscall.sh -l32" - mksysnum="./mksysnum_linux.sh /usr/include/asm/unistd_32.h" + mksyscall="./mksyscall.pl -l32" + mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd_32.h" mktypes="godefs -gsyscall -f-m32" ;; linux_amd64) mkerrors="$mkerrors -f -m64" - mksysnum="./mksysnum_linux.sh /usr/include/asm/unistd_64.h" + mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd_64.h" mktypes="godefs -gsyscall -f-m64" ;; -nacl_386) - NACL="/home/rsc/pub/nacl/native_client" - NACLRUN="$NACL/src/trusted/service_runtime" - NACLSDK="$NACL/src/third_party/nacl_sdk/linux/sdk/nacl-sdk/nacl" - mksyscall="./mksyscall.sh -l32 -nacl" - mksysnum="./mksysnum_nacl.sh $NACLRUN/include/bits/nacl_syscalls.h" - mktypes="godefs -gsyscall -f-m32 -f-I$NACLSDK/include -f-I$NACL" - mkerrors="./mkerrors_nacl.sh $NACLRUN/include/sys/errno.h" - ;; linux_arm) mkerrors="$mkerrors" - mksyscall="./mksyscall.sh -b32" - mksysnum="./mksysnum_linux.sh /usr/include/asm/unistd.h" + mksyscall="./mksyscall.pl -b32" + mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd.h" mktypes="godefs -gsyscall" ;; windows_386) - mksyscall="./mksyscall_windows.sh -l32" + mksyscall="./mksyscall_windows.pl -l32" mksysnum= mktypes= mkerrors="./mkerrors_windows.sh -f -m32" ;; +plan9_386) + mkerrors= + mksyscall="./mksyscall.pl -l32 -plan9" + mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h" + mktypes="godefs -gsyscall -f -m32" + ;; *) echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 exit 1 diff --git a/src/pkg/syscall/mkerrors.sh b/src/pkg/syscall/mkerrors.sh index d40d1f6b3..68a16842a 100755 --- a/src/pkg/syscall/mkerrors.sh +++ b/src/pkg/syscall/mkerrors.sh @@ -26,10 +26,12 @@ includes_Linux=' #include <sys/inotify.h> #include <sys/ioctl.h> #include <sys/mman.h> +#include <sys/mount.h> #include <sys/stat.h> #include <linux/ptrace.h> #include <linux/wait.h> #include <linux/if_tun.h> +#include <linux/reboot.h> #include <net/if.h> #include <netpacket/packet.h> ' @@ -43,6 +45,7 @@ includes_Darwin=' #include <sys/socket.h> #include <sys/sockio.h> #include <sys/sysctl.h> +#include <sys/mman.h> #include <sys/wait.h> #include <net/if.h> #include <net/route.h> @@ -58,6 +61,7 @@ includes_FreeBSD=' #include <sys/sockio.h> #include <sys/sysctl.h> #include <sys/wait.h> +#include <net/bpf.h> #include <net/if.h> #include <net/route.h> #include <netinet/in.h> @@ -116,15 +120,21 @@ done $2 ~ /^E[A-Z0-9_]+$/ || $2 ~ /^SIG[^_]/ || $2 ~ /^IN_/ || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|EVFILT|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|IFF|NET_RT|RTM|RTF|RTV|RTA|RTAX|MCL)_/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|EVFILT|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV)_/ || $2 == "SOMAXCONN" || $2 == "NAME_MAX" || $2 == "IFNAMSIZ" || $2 == "CTL_NET" || $2 == "CTL_MAXNAME" || + $2 ~ /^(MS|MNT)_/ || $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || $2 ~ /^(O|F|FD|NAME|S|PTRACE)_/ || + $2 ~ /^LINUX_REBOOT_CMD_/ || + $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || $2 ~ /^SIOC/ || + $2 ~ /^(IFF|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ || + $2 ~ /^BIOC/ || + $2 ~ /^(BPF|DLT)_/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ {printf("\t$%s = %s,\n", $2, $2)} $2 ~ /^__WCOREFLAG$/ {next} diff --git a/src/pkg/syscall/mksyscall.sh b/src/pkg/syscall/mksyscall.pl index 0f8098098..ecf4abdd4 100755 --- a/src/pkg/syscall/mksyscall.sh +++ b/src/pkg/syscall/mksyscall.pl @@ -13,10 +13,17 @@ # the (x, y, z int) shorthand is not allowed. # * If the return parameter is an error number, it must be named errno. -$cmdline = "mksyscall.sh " . join(' ', @ARGV); +# A line beginning with //sysnb is like //sys, except that the +# goroutine will not be suspended during the execution of the system +# call. This must only be used for system calls which can never +# block, as otherwise the system call could cause all goroutines to +# hang. + +$cmdline = "mksyscall.pl " . join(' ', @ARGV); $errors = 0; $_32bit = ""; $nacl = 0; +$plan9 = 0; if($ARGV[0] eq "-b32") { $_32bit = "big-endian"; @@ -29,9 +36,13 @@ if($ARGV[0] eq "-nacl") { $nacl = 1; shift; } +if($ARGV[0] eq "-plan9") { + $plan9 = 1; + shift; +} if($ARGV[0] =~ /^-/) { - print STDERR "usage: mksyscall.sh [-b32 | -l32] [file ...]\n"; + print STDERR "usage: mksyscall.pl [-b32 | -l32] [file ...]\n"; exit 1; } @@ -61,17 +72,18 @@ while(<>) { s/\s+/ /g; s/^\s+//; s/\s+$//; - next if !/^\/\/sys /; + my $nonblock = /^\/\/sysnb /; + next if !/^\/\/sys / && !$nonblock; # Line must be of the form # func Open(path string, mode int, perm int) (fd int, errno int) # Split into name, in params, out params. - if(!/^\/\/sys (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(SYS_[A-Z0-9_]+))?$/) { + if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(SYS_[A-Z0-9_]+))?$/) { print STDERR "$ARGV:$.: malformed //sys declaration\n"; $errors = 1; next; } - my ($func, $in, $out, $sysname) = ($1, $2, $3, $4); + my ($func, $in, $out, $sysname) = ($2, $3, $4, $5); # Split argument lists on comma. my @in = parseparamlist($in); @@ -119,15 +131,23 @@ while(<>) { # Determine which form to use; pad args with zeros. my $asm = "Syscall"; + if ($nonblock) { + $asm = "RawSyscall"; + } if(@args <= 3) { while(@args < 3) { push @args, "0"; } } elsif(@args <= 6) { - $asm = "Syscall6"; + $asm .= "6"; while(@args < 6) { push @args, "0"; } + } elsif(@args <= 9) { + $asm .= "9"; + while(@args < 9) { + push @args, "0"; + } } else { print STDERR "$ARGV:$.: too many arguments to system call\n"; } @@ -150,9 +170,13 @@ while(<>) { my $p = $out[$i]; my ($name, $type) = parseparam($p); my $reg = ""; - if($name eq "errno") { + if($name eq "errno" && !$plan9) { $reg = "e1"; $ret[2] = $reg; + } elsif ($name eq "err" && $plan9) { + $ret[0] = "r0"; + $ret[2] = "e1"; + next; } else { $reg = sprintf("r%d", $i); $ret[$i] = $reg; @@ -181,6 +205,13 @@ while(<>) { $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n"; } $text .= $body; + + if ($plan9 && $ret[2] eq "e1") { + $text .= "\terr = nil\n"; + $text .= "\tif int(r0) == -1 {\n"; + $text .= "\t\terr = NewError(e1)\n"; + $text .= "\t}\n"; + } $text .= "\treturn\n"; $text .= "}\n\n"; diff --git a/src/pkg/syscall/mksyscall_windows.sh b/src/pkg/syscall/mksyscall_windows.pl index 3b1c9df85..d92ac3d28 100755 --- a/src/pkg/syscall/mksyscall_windows.sh +++ b/src/pkg/syscall/mksyscall_windows.pl @@ -23,7 +23,7 @@ # //sys LoadLibrary(libname string) (handle uint32, errno int) [failretval==-1] = LoadLibraryA # and is [failretval==0] by default. -$cmdline = "mksyscall_windows.sh " . join(' ', @ARGV); +$cmdline = "mksyscall_windows.pl " . join(' ', @ARGV); $errors = 0; $_32bit = ""; @@ -36,7 +36,7 @@ if($ARGV[0] eq "-b32") { } if($ARGV[0] =~ /^-/) { - print STDERR "usage: mksyscall_windows.sh [-b32 | -l32] [file ...]\n"; + print STDERR "usage: mksyscall_windows.pl [-b32 | -l32] [file ...]\n"; exit 1; } @@ -119,7 +119,14 @@ while(<>) { $vars .= sprintf "\t%s = getSysProcAddr(%s, \"%s\")\n", $sysvarname, $modvname, $sysname; # Go function header. - $text .= sprintf "func %s(%s) (%s) {\n", $func, join(', ', @in), join(', ', @out); + my $out = join(', ', @out); + if($out ne "") { + $out = " ($out)"; + } + if($text ne "") { + $text .= "\n" + } + $text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out; # Prepare arguments to Syscall. my @args = (); @@ -232,6 +239,7 @@ while(<>) { $failexpr = "$name $failcond"; } } + $failexpr =~ s/(=)([0-9A-Za-z\-+])/\1 \2/; # gofmt compatible if($name eq "errno") { # Set errno to "last error" only if returned value indicate failure $body .= "\tif $failexpr {\n"; @@ -259,7 +267,7 @@ while(<>) { } $text .= "\treturn\n"; - $text .= "}\n\n"; + $text .= "}\n"; } if($errors) { diff --git a/src/pkg/syscall/mksysnum_darwin.sh b/src/pkg/syscall/mksysnum_darwin.pl index 192e61a73..d078a1836 100755 --- a/src/pkg/syscall/mksysnum_darwin.sh +++ b/src/pkg/syscall/mksysnum_darwin.pl @@ -6,7 +6,7 @@ # Generate system call table for Darwin from master list # (for example, xnu-1228/bsd/kern/syscalls.master). -my $command = "mksysnum_darwin.sh " . join(' ', @ARGV); +my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); print <<EOF; // $command diff --git a/src/pkg/syscall/mksysnum_freebsd.sh b/src/pkg/syscall/mksysnum_freebsd.pl index e52835d49..03f7d9e25 100755 --- a/src/pkg/syscall/mksysnum_freebsd.sh +++ b/src/pkg/syscall/mksysnum_freebsd.pl @@ -6,7 +6,7 @@ # Generate system call table for FreeBSD from master list # (for example, /usr/src/sys/kern/syscalls.master). -my $command = "mksysnum_freebsd.sh " . join(' ', @ARGV); +my $command = "mksysnum_freebsd.pl " . join(' ', @ARGV); print <<EOF; // $command diff --git a/src/pkg/syscall/mksysnum_linux.sh b/src/pkg/syscall/mksysnum_linux.pl index 89ece8a91..e97c87f44 100755 --- a/src/pkg/syscall/mksysnum_linux.sh +++ b/src/pkg/syscall/mksysnum_linux.pl @@ -3,7 +3,7 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -my $command = "mksysnum_linux.sh ". join(' ', @ARGV); +my $command = "mksysnum_linux.pl ". join(' ', @ARGV); print <<EOF; // $command diff --git a/src/pkg/syscall/mksysnum_plan9.sh b/src/pkg/syscall/mksysnum_plan9.sh new file mode 100755 index 000000000..fc619f090 --- /dev/null +++ b/src/pkg/syscall/mksysnum_plan9.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# 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.# 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. + +COMMAND="mksysnum_plan9.sh $@" + +cat <<EOF +// $COMMAND +// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT + +package syscall + +const( +EOF + +SP='[ ]' # space or tab +sed "s/^#define${SP}\\([A-Z0-9_][A-Z0-9_]*\\)${SP}${SP}*\\([0-9][0-9]*\\)/SYS_\\1=\\2/g" \ + < $1 | grep -v SYS__ + +cat <<EOF +) +EOF diff --git a/src/pkg/syscall/str.go b/src/pkg/syscall/str.go index 12f0c7d60..0fce842e8 100644 --- a/src/pkg/syscall/str.go +++ b/src/pkg/syscall/str.go @@ -4,9 +4,9 @@ package syscall -func str(val int) string { // do it here rather than with fmt to avoid dependency +func itoa(val int) string { // do it here rather than with fmt to avoid dependency if val < 0 { - return "-" + str(-val) + return "-" + itoa(-val) } var buf [32]byte // big enough for int64 i := len(buf) - 1 diff --git a/src/pkg/syscall/syscall.go b/src/pkg/syscall/syscall.go index 96975376f..2a9ffd4af 100644 --- a/src/pkg/syscall/syscall.go +++ b/src/pkg/syscall/syscall.go @@ -13,6 +13,11 @@ // errno is an operating system error number describing the failure. package syscall +import ( + "sync" + "unsafe" +) + // StringByteSlice returns a NUL-terminated slice of bytes // containing the text of s. func StringByteSlice(s string) []byte { @@ -28,3 +33,63 @@ func StringBytePtr(s string) *byte { return &StringByteSlice(s)[0] } // Single-word zero for use when we need a valid pointer to 0 bytes. // See mksyscall.sh. var _zero uintptr + +// Mmap manager, for use by operating system-specific implementations. + +type mmapper struct { + sync.Mutex + active map[*byte][]byte // active mappings; key is last byte in mapping + mmap func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, int) + munmap func(addr uintptr, length uintptr) int +} + +func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, errno int) { + if length <= 0 { + return nil, EINVAL + } + + // Map the requested memory. + addr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset) + if errno != 0 { + return nil, errno + } + + // Slice memory layout + var sl = struct { + addr uintptr + len int + cap int + }{addr, length, length} + + // Use unsafe to turn sl into a []byte. + b := *(*[]byte)(unsafe.Pointer(&sl)) + + // Register mapping in m and return it. + p := &b[cap(b)-1] + m.Lock() + defer m.Unlock() + m.active[p] = b + return b, 0 +} + +func (m *mmapper) Munmap(data []byte) (errno int) { + if len(data) == 0 || len(data) != cap(data) { + return EINVAL + } + + // Find the base of the mapping. + p := &data[cap(data)-1] + m.Lock() + defer m.Unlock() + b := m.active[p] + if b == nil || &b[0] != &data[0] { + return EINVAL + } + + // Unmap the memory and update m. + if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != 0 { + return errno + } + m.active[p] = nil, false + return 0 +} diff --git a/src/pkg/syscall/syscall_bsd.go b/src/pkg/syscall/syscall_bsd.go index 1f5b2ba9a..9f1244f13 100644 --- a/src/pkg/syscall/syscall_bsd.go +++ b/src/pkg/syscall/syscall_bsd.go @@ -27,8 +27,8 @@ func Getwd() (string, int) { return "", ENOTSUP } * Wrapped */ -//sys getgroups(ngid int, gid *_Gid_t) (n int, errno int) -//sys setgroups(ngid int, gid *_Gid_t) (errno int) +//sysnb getgroups(ngid int, gid *_Gid_t) (n int, errno int) +//sysnb setgroups(ngid int, gid *_Gid_t) (errno int) func Getgroups() (gids []int, errno int) { n, err := getgroups(0, nil) @@ -68,6 +68,12 @@ func Setgroups(gids []int) (errno int) { return setgroups(len(a), &a[0]) } +func ReadDirent(fd int, buf []byte) (n int, errno int) { + // Final argument is (basep *uintptr) and the syscall doesn't take nil. + // TODO(rsc): Can we use a single global basep for all calls? + return Getdirentries(fd, buf, new(uintptr)) +} + // Wait status is 7 bits at bottom, either 0 (exited), // 0x7F (stopped), or a signal number that caused an exit. // The 0x80 bit is whether there was a core dump. @@ -130,7 +136,7 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, return } -//sys pipe() (r int, w int, errno int) +//sysnb pipe() (r int, w int, errno int) func Pipe(p []int) (errno int) { if len(p) != 2 { @@ -148,10 +154,11 @@ func Sleep(ns int64) (errno int) { //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) //sys bind(s int, addr uintptr, addrlen _Socklen) (errno int) //sys connect(s int, addr uintptr, addrlen _Socklen) (errno int) -//sys socket(domain int, typ int, proto int) (fd int, errno int) +//sysnb socket(domain int, typ int, proto int) (fd int, errno int) +//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) //sys setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) -//sys getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) -//sys getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) +//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) +//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) //sys Shutdown(s int, how int) (errno int) // For testing: clients can set this flag to force @@ -355,13 +362,20 @@ func Socket(domain, typ, proto int) (fd, errno int) { return } -//sys socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) +//sysnb socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) func Socketpair(domain, typ, proto int) (fd [2]int, errno int) { errno = socketpair(domain, typ, proto, &fd) return } +func GetsockoptInt(fd, level, opt int) (value, errno int) { + var n int32 + vallen := _Socklen(4) + errno = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), &vallen) + return int(n), errno +} + func SetsockoptInt(fd, level, opt int, value int) (errno int) { var n = int32(value) return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), 4) @@ -552,9 +566,24 @@ func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (errno int) { // TODO: wrap // Acct(name nil-string) (errno int) // Gethostuuid(uuid *byte, timeout *Timespec) (errno int) -// Getsockopt(s int, level int, name int, val *byte, vallen *int) (errno int) // Madvise(addr *byte, len int, behav int) (errno int) // Mprotect(addr *byte, len int, prot int) (errno int) // Msync(addr *byte, len int, flags int) (errno int) -// Munmap(addr *byte, len int) (errno int) // Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, errno int) + +//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) +//sys munmap(addr uintptr, length uintptr) (errno int) + +var mapper = &mmapper{ + active: make(map[*byte][]byte), + mmap: mmap, + munmap: munmap, +} + +func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, errno int) { + return mapper.Mmap(fd, offset, length, prot, flags) +} + +func Munmap(b []byte) (errno int) { + return mapper.Munmap(b) +} diff --git a/src/pkg/syscall/syscall_darwin.go b/src/pkg/syscall/syscall_darwin.go index 552c9c154..30b57cf55 100644 --- a/src/pkg/syscall/syscall_darwin.go +++ b/src/pkg/syscall/syscall_darwin.go @@ -12,6 +12,8 @@ package syscall +import "unsafe" + const OS = "darwin" type SockaddrDatalink struct { @@ -26,6 +28,34 @@ type SockaddrDatalink struct { raw RawSockaddrDatalink } +// ParseDirent parses up to max directory entries in buf, +// appending the names to names. It returns the number +// bytes consumed from buf, the number of entries added +// to names, and the new names slice. +func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { + origlen := len(buf) + for max != 0 && len(buf) > 0 { + dirent := (*Dirent)(unsafe.Pointer(&buf[0])) + if dirent.Reclen == 0 { + buf = nil + break + } + buf = buf[dirent.Reclen:] + if dirent.Ino == 0 { // File absent in directory. + continue + } + bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0])) + var name = string(bytes[0:dirent.Namlen]) + if name == "." || name == ".." { // Useless names + continue + } + max-- + count++ + names = append(names, name) + } + return origlen - len(buf), count, names +} + /* * Wrapped */ @@ -45,8 +75,8 @@ func Kill(pid int, signum int) (errno int) { return kill(pid, signum, 1) } //sys Chown(path string, uid int, gid int) (errno int) //sys Chroot(path string) (errno int) //sys Close(fd int) (errno int) -//sys Dup(fd int) (nfd int, errno int) -//sys Dup2(from int, to int) (errno int) +//sysnb Dup(fd int) (nfd int, errno int) +//sysnb Dup2(from int, to int) (errno int) //sys Exchangedata(path1 string, path2 string, options int) (errno int) //sys Exit(code int) //sys Fchdir(fd int) (errno int) @@ -61,20 +91,20 @@ func Kill(pid int, signum int) (errno int) { return kill(pid, signum, 1) } //sys Ftruncate(fd int, length int64) (errno int) //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) = SYS_GETDIRENTRIES64 //sys Getdtablesize() (size int) -//sys Getegid() (egid int) -//sys Geteuid() (uid int) +//sysnb Getegid() (egid int) +//sysnb Geteuid() (uid int) //sys Getfsstat(buf []Statfs_t, flags int) (n int, errno int) = SYS_GETFSSTAT64 -//sys Getgid() (gid int) -//sys Getpgid(pid int) (pgid int, errno int) -//sys Getpgrp() (pgrp int) -//sys Getpid() (pid int) -//sys Getppid() (ppid int) +//sysnb Getgid() (gid int) +//sysnb Getpgid(pid int) (pgid int, errno int) +//sysnb Getpgrp() (pgrp int) +//sysnb Getpid() (pid int) +//sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, errno int) -//sys Getrlimit(which int, lim *Rlimit) (errno int) -//sys Getrusage(who int, rusage *Rusage) (errno int) -//sys Getsid(pid int) (sid int, errno int) -//sys Getuid() (uid int) -//sys Issetugid() (tainted bool) +//sysnb Getrlimit(which int, lim *Rlimit) (errno int) +//sysnb Getrusage(who int, rusage *Rusage) (errno int) +//sysnb Getsid(pid int) (sid int, errno int) +//sysnb Getuid() (uid int) +//sysnb Issetugid() (tainted bool) //sys Kqueue() (fd int, errno int) //sys Lchown(path string, uid int, gid int) (errno int) //sys Link(path string, link string) (errno int) @@ -95,18 +125,18 @@ func Kill(pid int, signum int) (errno int) { return kill(pid, signum, 1) } //sys Seek(fd int, offset int64, whence int) (newoffset int64, errno int) = SYS_LSEEK //sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) //sys Setegid(egid int) (errno int) -//sys Seteuid(euid int) (errno int) -//sys Setgid(gid int) (errno int) +//sysnb Seteuid(euid int) (errno int) +//sysnb Setgid(gid int) (errno int) //sys Setlogin(name string) (errno int) -//sys Setpgid(pid int, pgid int) (errno int) +//sysnb Setpgid(pid int, pgid int) (errno int) //sys Setpriority(which int, who int, prio int) (errno int) //sys Setprivexec(flag int) (errno int) -//sys Setregid(rgid int, egid int) (errno int) -//sys Setreuid(ruid int, euid int) (errno int) -//sys Setrlimit(which int, lim *Rlimit) (errno int) -//sys Setsid() (pid int, errno int) -//sys Settimeofday(tp *Timeval) (errno int) -//sys Setuid(uid int) (errno int) +//sysnb Setregid(rgid int, egid int) (errno int) +//sysnb Setreuid(ruid int, euid int) (errno int) +//sysnb Setrlimit(which int, lim *Rlimit) (errno int) +//sysnb Setsid() (pid int, errno int) +//sysnb Settimeofday(tp *Timeval) (errno int) +//sysnb Setuid(uid int) (errno int) //sys Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64 //sys Statfs(path string, stat *Statfs_t) (errno int) = SYS_STATFS64 //sys Symlink(path string, link string) (errno int) diff --git a/src/pkg/syscall/syscall_darwin_386.go b/src/pkg/syscall/syscall_darwin_386.go index 3fd72efe3..5101ba6c7 100644 --- a/src/pkg/syscall/syscall_darwin_386.go +++ b/src/pkg/syscall/syscall_darwin_386.go @@ -23,7 +23,7 @@ func NsecToTimeval(nsec int64) (tv Timeval) { return } -//sys gettimeofday(tp *Timeval) (sec int32, usec int32, errno int) +//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, errno int) func Gettimeofday(tv *Timeval) (errno int) { // The tv passed to gettimeofday must be non-nil // but is otherwise unused. The answers come back @@ -39,3 +39,5 @@ func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Filter = int16(mode) k.Flags = uint16(flags) } + +func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr) // sic diff --git a/src/pkg/syscall/syscall_darwin_amd64.go b/src/pkg/syscall/syscall_darwin_amd64.go index df8d37588..acf7a5554 100644 --- a/src/pkg/syscall/syscall_darwin_amd64.go +++ b/src/pkg/syscall/syscall_darwin_amd64.go @@ -23,7 +23,7 @@ func NsecToTimeval(nsec int64) (tv Timeval) { return } -//sys gettimeofday(tp *Timeval) (sec int64, usec int32, errno int) +//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, errno int) func Gettimeofday(tv *Timeval) (errno int) { // The tv passed to gettimeofday must be non-nil // but is otherwise unused. The answers come back diff --git a/src/pkg/syscall/syscall_freebsd.go b/src/pkg/syscall/syscall_freebsd.go index ed310663a..242503dd7 100644 --- a/src/pkg/syscall/syscall_freebsd.go +++ b/src/pkg/syscall/syscall_freebsd.go @@ -12,6 +12,8 @@ package syscall +import "unsafe" + const OS = "freebsd" type SockaddrDatalink struct { @@ -26,6 +28,34 @@ type SockaddrDatalink struct { raw RawSockaddrDatalink } +// ParseDirent parses up to max directory entries in buf, +// appending the names to names. It returns the number +// bytes consumed from buf, the number of entries added +// to names, and the new names slice. +func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { + origlen := len(buf) + for max != 0 && len(buf) > 0 { + dirent := (*Dirent)(unsafe.Pointer(&buf[0])) + if dirent.Reclen == 0 { + buf = nil + break + } + buf = buf[dirent.Reclen:] + if dirent.Fileno == 0 { // File absent in directory. + continue + } + bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0])) + var name = string(bytes[0:dirent.Namlen]) + if name == "." || name == ".." { // Useless names + continue + } + max-- + count++ + names = append(names, name) + } + return origlen - len(buf), count, names +} + /* * Exposed directly */ @@ -37,8 +67,8 @@ type SockaddrDatalink struct { //sys Chown(path string, uid int, gid int) (errno int) //sys Chroot(path string) (errno int) //sys Close(fd int) (errno int) -//sys Dup(fd int) (nfd int, errno int) -//sys Dup2(from int, to int) (errno int) +//sysnb Dup(fd int) (nfd int, errno int) +//sysnb Dup2(from int, to int) (errno int) //sys Exit(code int) //sys Fchdir(fd int) (errno int) //sys Fchflags(path string, flags int) (errno int) @@ -52,20 +82,20 @@ type SockaddrDatalink struct { //sys Ftruncate(fd int, length int64) (errno int) //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) //sys Getdtablesize() (size int) -//sys Getegid() (egid int) -//sys Geteuid() (uid int) +//sysnb Getegid() (egid int) +//sysnb Geteuid() (uid int) //sys Getfsstat(buf []Statfs_t, flags int) (n int, errno int) -//sys Getgid() (gid int) -//sys Getpgid(pid int) (pgid int, errno int) -//sys Getpgrp() (pgrp int) -//sys Getpid() (pid int) -//sys Getppid() (ppid int) +//sysnb Getgid() (gid int) +//sysnb Getpgid(pid int) (pgid int, errno int) +//sysnb Getpgrp() (pgrp int) +//sysnb Getpid() (pid int) +//sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, errno int) -//sys Getrlimit(which int, lim *Rlimit) (errno int) -//sys Getrusage(who int, rusage *Rusage) (errno int) -//sys Getsid(pid int) (sid int, errno int) -//sys Gettimeofday(tv *Timeval) (errno int) -//sys Getuid() (uid int) +//sysnb Getrlimit(which int, lim *Rlimit) (errno int) +//sysnb Getrusage(who int, rusage *Rusage) (errno int) +//sysnb Getsid(pid int) (sid int, errno int) +//sysnb Gettimeofday(tv *Timeval) (errno int) +//sysnb Getuid() (uid int) //sys Issetugid() (tainted bool) //sys Kill(pid int, signum int) (errno int) //sys Kqueue() (fd int, errno int) @@ -88,18 +118,18 @@ type SockaddrDatalink struct { //sys Rmdir(path string) (errno int) //sys Seek(fd int, offset int64, whence int) (newoffset int64, errno int) = SYS_LSEEK //sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) -//sys Setegid(egid int) (errno int) -//sys Seteuid(euid int) (errno int) -//sys Setgid(gid int) (errno int) +//sysnb Setegid(egid int) (errno int) +//sysnb Seteuid(euid int) (errno int) +//sysnb Setgid(gid int) (errno int) //sys Setlogin(name string) (errno int) -//sys Setpgid(pid int, pgid int) (errno int) +//sysnb Setpgid(pid int, pgid int) (errno int) //sys Setpriority(which int, who int, prio int) (errno int) -//sys Setregid(rgid int, egid int) (errno int) -//sys Setreuid(ruid int, euid int) (errno int) -//sys Setrlimit(which int, lim *Rlimit) (errno int) -//sys Setsid() (pid int, errno int) -//sys Settimeofday(tp *Timeval) (errno int) -//sys Setuid(uid int) (errno int) +//sysnb Setregid(rgid int, egid int) (errno int) +//sysnb Setreuid(ruid int, euid int) (errno int) +//sysnb Setrlimit(which int, lim *Rlimit) (errno int) +//sysnb Setsid() (pid int, errno int) +//sysnb Settimeofday(tp *Timeval) (errno int) +//sysnb Setuid(uid int) (errno int) //sys Stat(path string, stat *Stat_t) (errno int) //sys Statfs(path string, stat *Statfs_t) (errno int) //sys Symlink(path string, link string) (errno int) diff --git a/src/pkg/syscall/syscall_freebsd_386.go b/src/pkg/syscall/syscall_freebsd_386.go index 0aa577ee6..d0fa506c7 100644 --- a/src/pkg/syscall/syscall_freebsd_386.go +++ b/src/pkg/syscall/syscall_freebsd_386.go @@ -28,3 +28,5 @@ func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Filter = int16(mode) k.Flags = uint16(flags) } + +func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr) // sic diff --git a/src/pkg/syscall/syscall_linux.go b/src/pkg/syscall/syscall_linux.go index 30ad89646..2b221bd60 100644 --- a/src/pkg/syscall/syscall_linux.go +++ b/src/pkg/syscall/syscall_linux.go @@ -29,7 +29,7 @@ func Openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int) return openat(dirfd, path, flags|O_LARGEFILE, mode) } -//sys pipe(p *[2]_C_int) (errno int) +//sysnb pipe(p *[2]_C_int) (errno int) func Pipe(p []int) (errno int) { if len(p) != 2 { return EINVAL @@ -60,7 +60,7 @@ func Futimesat(dirfd int, path string, tv []Timeval) (errno int) { func Futimes(fd int, tv []Timeval) (errno int) { // Believe it or not, this is the best we can do on Linux // (and is what glibc does). - return Utimes("/proc/self/fd/"+str(fd), tv) + return Utimes("/proc/self/fd/"+itoa(fd), tv) } const ImplementsGetwd = true @@ -415,6 +415,13 @@ func Socketpair(domain, typ, proto int) (fd [2]int, errno int) { return } +func GetsockoptInt(fd, level, opt int) (value, errno int) { + var n int32 + vallen := _Socklen(4) + errno = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), &vallen) + return int(n), errno +} + func SetsockoptInt(fd, level, opt int, value int) (errno int) { var n = int32(value) return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), 4) @@ -667,10 +674,48 @@ func PtraceAttach(pid int) (errno int) { return ptrace(PTRACE_ATTACH, pid, 0, 0) func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0) } +//sys reboot(magic1 uint, magic2 uint, cmd int, arg string) (errno int) +func Reboot(cmd int) (errno int) { + return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "") +} + +func clen(n []byte) int { + for i := 0; i < len(n); i++ { + if n[i] == 0 { + return i + } + } + return len(n) +} + +func ReadDirent(fd int, buf []byte) (n int, errno int) { + return Getdents(fd, buf) +} + +func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { + origlen := len(buf) + count = 0 + for max != 0 && len(buf) > 0 { + dirent := (*Dirent)(unsafe.Pointer(&buf[0])) + buf = buf[dirent.Reclen:] + if dirent.Ino == 0 { // File absent in directory. + continue + } + bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0])) + var name = string(bytes[0:clen(bytes[:])]) + if name == "." || name == ".." { // Useless names + continue + } + max-- + count++ + names = append(names, name) + } + return origlen - len(buf), count, names +} + // Sendto // Recvfrom // Socketpair -// Getsockopt /* * Direct access @@ -683,10 +728,10 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0) //sys Chroot(path string) (errno int) //sys Close(fd int) (errno int) //sys Creat(path string, mode uint32) (fd int, errno int) -//sys Dup(oldfd int) (fd int, errno int) -//sys Dup2(oldfd int, newfd int) (fd int, errno int) -//sys EpollCreate(size int) (fd int, errno int) -//sys EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) +//sysnb Dup(oldfd int) (fd int, errno int) +//sysnb Dup2(oldfd int, newfd int) (fd int, errno int) +//sysnb EpollCreate(size int) (fd int, errno int) +//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int) //sys Exit(code int) = SYS_EXIT_GROUP //sys Faccessat(dirfd int, path string, mode uint32, flags int) (errno int) @@ -699,24 +744,25 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0) //sys Fdatasync(fd int) (errno int) //sys Fsync(fd int) (errno int) //sys Getdents(fd int, buf []byte) (n int, errno int) = SYS_GETDENTS64 -//sys Getpgid(pid int) (pgid int, errno int) -//sys Getpgrp() (pid int) -//sys Getpid() (pid int) -//sys Getppid() (ppid int) -//sys Getrlimit(resource int, rlim *Rlimit) (errno int) -//sys Getrusage(who int, rusage *Rusage) (errno int) -//sys Gettid() (tid int) -//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int) -//sys InotifyInit() (fd int, errno int) -//sys InotifyInit1(flags int) (fd int, errno int) -//sys InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) -//sys Kill(pid int, sig int) (errno int) +//sysnb Getpgid(pid int) (pgid int, errno int) +//sysnb Getpgrp() (pid int) +//sysnb Getpid() (pid int) +//sysnb Getppid() (ppid int) +//sysnb Getrlimit(resource int, rlim *Rlimit) (errno int) +//sysnb Getrusage(who int, rusage *Rusage) (errno int) +//sysnb Gettid() (tid int) +//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int) +//sysnb InotifyInit() (fd int, errno int) +//sysnb InotifyInit1(flags int) (fd int, errno int) +//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) +//sysnb Kill(pid int, sig int) (errno int) //sys Klogctl(typ int, buf []byte) (n int, errno int) = SYS_SYSLOG //sys Link(oldpath string, newpath string) (errno int) //sys Mkdir(path string, mode uint32) (errno int) //sys Mkdirat(dirfd int, path string, mode uint32) (errno int) //sys Mknod(path string, mode uint32, dev int) (errno int) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (errno int) +//sys Mount(source string, target string, fstype string, flags int, data string) (errno int) //sys Nanosleep(time *Timespec, leftover *Timespec) (errno int) //sys Pause() (errno int) //sys PivotRoot(newroot string, putold string) (errno int) = SYS_PIVOT_ROOT @@ -727,21 +773,22 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0) //sys Rmdir(path string) (errno int) //sys Setdomainname(p []byte) (errno int) //sys Sethostname(p []byte) (errno int) -//sys Setpgid(pid int, pgid int) (errno int) -//sys Setrlimit(resource int, rlim *Rlimit) (errno int) -//sys Setsid() (pid int, errno int) -//sys Settimeofday(tv *Timeval) (errno int) -//sys Setuid(uid int) (errno int) +//sysnb Setpgid(pid int, pgid int) (errno int) +//sysnb Setrlimit(resource int, rlim *Rlimit) (errno int) +//sysnb Setsid() (pid int, errno int) +//sysnb Settimeofday(tv *Timeval) (errno int) +//sysnb Setuid(uid int) (errno int) //sys Symlink(oldpath string, newpath string) (errno int) //sys Sync() -//sys Sysinfo(info *Sysinfo_t) (errno int) +//sysnb Sysinfo(info *Sysinfo_t) (errno int) //sys Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) -//sys Tgkill(tgid int, tid int, sig int) (errno int) -//sys Times(tms *Tms) (ticks uintptr, errno int) -//sys Umask(mask int) (oldmask int) -//sys Uname(buf *Utsname) (errno int) +//sysnb Tgkill(tgid int, tid int, sig int) (errno int) +//sysnb Times(tms *Tms) (ticks uintptr, errno int) +//sysnb Umask(mask int) (oldmask int) +//sysnb Uname(buf *Utsname) (errno int) //sys Unlink(path string) (errno int) //sys Unlinkat(dirfd int, path string) (errno int) +//sys Unmount(target string, flags int) (errno int) = SYS_UMOUNT2 //sys Unshare(flags int) (errno int) //sys Ustat(dev int, ubuf *Ustat_t) (errno int) //sys Utime(path string, buf *Utimbuf) (errno int) @@ -750,6 +797,23 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0) //sys read(fd int, p *byte, np int) (n int, errno int) //sys write(fd int, p *byte, np int) (n int, errno int) +// mmap varies by architecture; see syscall_linux_*.go. +//sys munmap(addr uintptr, length uintptr) (errno int) + +var mapper = &mmapper{ + active: make(map[*byte][]byte), + mmap: mmap, + munmap: munmap, +} + +func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, errno int) { + return mapper.Mmap(fd, offset, length, prot, flags) +} + +func Munmap(b []byte) (errno int) { + return mapper.Munmap(b) +} + /* * Unimplemented */ @@ -842,7 +906,6 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0) // Quotactl // Readahead // Readv -// Reboot // RemapFilePages // Removexattr // RequestKey diff --git a/src/pkg/syscall/syscall_linux_386.go b/src/pkg/syscall/syscall_linux_386.go index 5bd3406de..2b6bdebf8 100644 --- a/src/pkg/syscall/syscall_linux_386.go +++ b/src/pkg/syscall/syscall_linux_386.go @@ -31,10 +31,10 @@ func NsecToTimeval(nsec int64) (tv Timeval) { //sys Fchown(fd int, uid int, gid int) (errno int) = SYS_FCHOWN32 //sys Fstat(fd int, stat *Stat_t) (errno int) = SYS_FSTAT64 //sys Ftruncate(fd int, length int64) (errno int) = SYS_FTRUNCATE64 -//sys Getegid() (egid int) = SYS_GETEGID32 -//sys Geteuid() (euid int) = SYS_GETEUID32 -//sys Getgid() (gid int) = SYS_GETGID32 -//sys Getuid() (uid int) = SYS_GETUID32 +//sysnb Getegid() (egid int) = SYS_GETEGID32 +//sysnb Geteuid() (euid int) = SYS_GETEUID32 +//sysnb Getgid() (gid int) = SYS_GETGID32 +//sysnb Getuid() (uid int) = SYS_GETUID32 //sys Ioperm(from int, num int, on int) (errno int) //sys Iopl(level int) (errno int) //sys Lchown(path string, uid int, gid int) (errno int) = SYS_LCHOWN32 @@ -43,26 +43,36 @@ func NsecToTimeval(nsec int64) (tv Timeval) { //sys Pwrite(fd int, p []byte, offset int64) (n int, errno int) = SYS_PWRITE64 //sys Setfsgid(gid int) (errno int) = SYS_SETFSGID32 //sys Setfsuid(uid int) (errno int) = SYS_SETFSUID32 -//sys Setgid(gid int) (errno int) = SYS_SETGID32 -//sys Setregid(rgid int, egid int) (errno int) = SYS_SETREGID32 -//sys Setresgid(rgid int, egid int, sgid int) (errno int) = SYS_SETRESGID32 -//sys Setresuid(ruid int, euid int, suid int) (errno int) = SYS_SETRESUID32 -//sys Setreuid(ruid int, euid int) (errno int) = SYS_SETREUID32 +//sysnb Setgid(gid int) (errno int) = SYS_SETGID32 +//sysnb Setregid(rgid int, egid int) (errno int) = SYS_SETREGID32 +//sysnb Setresgid(rgid int, egid int, sgid int) (errno int) = SYS_SETRESGID32 +//sysnb Setresuid(ruid int, euid int, suid int) (errno int) = SYS_SETRESUID32 +//sysnb Setreuid(ruid int, euid int) (errno int) = SYS_SETREUID32 //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, errno int) //sys Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64 //sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int) //sys Truncate(path string, length int64) (errno int) = SYS_TRUNCATE64 -//sys getgroups(n int, list *_Gid_t) (nn int, errno int) = SYS_GETGROUPS32 -//sys setgroups(n int, list *_Gid_t) (errno int) = SYS_SETGROUPS32 +//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int) = SYS_GETGROUPS32 +//sysnb setgroups(n int, list *_Gid_t) (errno int) = SYS_SETGROUPS32 //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) = SYS__NEWSELECT +//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, errno int) + +func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, errno int) { + page := uintptr(offset / 4096) + if offset != int64(page)*4096 { + return 0, EINVAL + } + return mmap2(addr, length, prot, flags, fd, page) +} + // Underlying system call writes to newoffset via pointer. // Implemented in assembly to avoid allocation. func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) // Vsyscalls on amd64. -//sys Gettimeofday(tv *Timeval) (errno int) -//sys Time(t *Time_t) (tt Time_t, errno int) +//sysnb Gettimeofday(tv *Timeval) (errno int) +//sysnb Time(t *Time_t) (tt Time_t, errno int) // On x86 Linux, all the socket calls go through an extra indirection, // I think because the 5-register system call interface can't handle @@ -93,6 +103,7 @@ const ( ) func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int) +func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int) func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) { fd, errno = socketcall(_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) @@ -100,17 +111,17 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) { } func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, errno = socketcall(_GETSOCKNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) + _, errno = rawsocketcall(_GETSOCKNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) return } func getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, errno = socketcall(_GETPEERNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) + _, errno = rawsocketcall(_GETPEERNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) return } func socketpair(domain int, typ int, flags int, fd *[2]int) (errno int) { - _, errno = socketcall(_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0) + _, errno = rawsocketcall(_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0) return } @@ -125,7 +136,12 @@ func connect(s int, addr uintptr, addrlen _Socklen) (errno int) { } func socket(domain int, typ int, proto int) (fd int, errno int) { - fd, errno = socketcall(_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0) + fd, errno = rawsocketcall(_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0) + return +} + +func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) { + _, errno = socketcall(_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) return } diff --git a/src/pkg/syscall/syscall_linux_amd64.go b/src/pkg/syscall/syscall_linux_amd64.go index ae108bd18..f2a4acfe9 100644 --- a/src/pkg/syscall/syscall_linux_amd64.go +++ b/src/pkg/syscall/syscall_linux_amd64.go @@ -9,10 +9,10 @@ package syscall //sys Fstat(fd int, stat *Stat_t) (errno int) //sys Fstatfs(fd int, buf *Statfs_t) (errno int) //sys Ftruncate(fd int, length int64) (errno int) -//sys Getegid() (egid int) -//sys Geteuid() (euid int) -//sys Getgid() (gid int) -//sys Getuid() (uid int) +//sysnb Getegid() (egid int) +//sysnb Geteuid() (euid int) +//sysnb Getgid() (gid int) +//sysnb Getuid() (uid int) //sys Ioperm(from int, num int, on int) (errno int) //sys Iopl(level int) (errno int) //sys Lchown(path string, uid int, gid int) (errno int) @@ -24,11 +24,11 @@ package syscall //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) //sys Setfsgid(gid int) (errno int) //sys Setfsuid(uid int) (errno int) -//sys Setgid(gid int) (errno int) -//sys Setregid(rgid int, egid int) (errno int) -//sys Setresgid(rgid int, egid int, sgid int) (errno int) -//sys Setresuid(ruid int, euid int, suid int) (errno int) -//sys Setreuid(ruid int, euid int) (errno int) +//sysnb Setgid(gid int) (errno int) +//sysnb Setregid(rgid int, egid int) (errno int) +//sysnb Setresgid(rgid int, egid int, sgid int) (errno int) +//sysnb Setresuid(ruid int, euid int, suid int) (errno int) +//sysnb Setreuid(ruid int, euid int) (errno int) //sys Shutdown(fd int, how int) (errno int) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) //sys Stat(path string, stat *Stat_t) (errno int) @@ -38,17 +38,19 @@ package syscall //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) //sys bind(s int, addr uintptr, addrlen _Socklen) (errno int) //sys connect(s int, addr uintptr, addrlen _Socklen) (errno int) -//sys getgroups(n int, list *_Gid_t) (nn int, errno int) -//sys setgroups(n int, list *_Gid_t) (errno int) +//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int) +//sysnb setgroups(n int, list *_Gid_t) (errno int) +//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) //sys setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) -//sys socket(domain int, typ int, proto int) (fd int, errno int) -//sys socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) -//sys getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) -//sys getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) +//sysnb socket(domain int, typ int, proto int) (fd int, errno int) +//sysnb socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) +//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) +//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) //sys sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) //sys sendmsg(s int, msg *Msghdr, flags int) (errno int) +//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, errno int) func Getpagesize() int { return 4096 } diff --git a/src/pkg/syscall/syscall_linux_arm.go b/src/pkg/syscall/syscall_linux_arm.go index 1fc7a7b18..6472c4db5 100644 --- a/src/pkg/syscall/syscall_linux_arm.go +++ b/src/pkg/syscall/syscall_linux_arm.go @@ -55,15 +55,16 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) //sys bind(s int, addr uintptr, addrlen _Socklen) (errno int) //sys connect(s int, addr uintptr, addrlen _Socklen) (errno int) -//sys getgroups(n int, list *_Gid_t) (nn int, errno int) = SYS_GETGROUPS32 -//sys setgroups(n int, list *_Gid_t) (errno int) = SYS_SETGROUPS32 +//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int) = SYS_GETGROUPS32 +//sysnb setgroups(n int, list *_Gid_t) (errno int) = SYS_SETGROUPS32 +//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) //sys setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) -//sys socket(domain int, typ int, proto int) (fd int, errno int) -//sys getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) -//sys getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) +//sysnb socket(domain int, typ int, proto int) (fd int, errno int) +//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) +//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) //sys sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) -//sys socketpair(domain int, typ int, flags int, fd *[2]int) (errno int) +//sysnb socketpair(domain int, typ int, flags int, fd *[2]int) (errno int) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) //sys sendmsg(s int, msg *Msghdr, flags int) (errno int) @@ -72,21 +73,21 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) //sys Fstat(fd int, stat *Stat_t) (errno int) = SYS_FSTAT64 //sys Fstatfs(fd int, buf *Statfs_t) (errno int) = SYS_FSTATFS64 //sys Ftruncate(fd int, length int64) (errno int) = SYS_FTRUNCATE64 -//sys Getegid() (egid int) -//sys Geteuid() (euid int) -//sys Getgid() (gid int) -//sys Getuid() (uid int) +//sysnb Getegid() (egid int) +//sysnb Geteuid() (euid int) +//sysnb Getgid() (gid int) +//sysnb Getuid() (uid int) //sys Lchown(path string, uid int, gid int) (errno int) //sys Listen(s int, n int) (errno int) //sys Lstat(path string, stat *Stat_t) (errno int) = SYS_LSTAT64 //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) = SYS__NEWSELECT //sys Setfsgid(gid int) (errno int) //sys Setfsuid(uid int) (errno int) -//sys Setgid(gid int) (errno int) -//sys Setregid(rgid int, egid int) (errno int) -//sys Setresgid(rgid int, egid int, sgid int) (errno int) -//sys Setresuid(ruid int, euid int, suid int) (errno int) -//sys Setreuid(ruid int, euid int) (errno int) +//sysnb Setgid(gid int) (errno int) +//sysnb Setregid(rgid int, egid int) (errno int) +//sysnb Setresgid(rgid int, egid int, sgid int) (errno int) +//sysnb Setresuid(ruid int, euid int, suid int) (errno int) +//sysnb Setreuid(ruid int, euid int) (errno int) //sys Shutdown(fd int, how int) (errno int) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, errno int) //sys Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64 @@ -94,8 +95,18 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) //sys Truncate(path string, length int64) (errno int) = SYS_TRUNCATE64 // Vsyscalls on amd64. -//sys Gettimeofday(tv *Timeval) (errno int) -//sys Time(t *Time_t) (tt Time_t, errno int) +//sysnb Gettimeofday(tv *Timeval) (errno int) +//sysnb Time(t *Time_t) (tt Time_t, errno int) + +//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, errno int) + +func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, errno int) { + page := uintptr(offset / 4096) + if offset != int64(page)*4096 { + return 0, EINVAL + } + return mmap2(addr, length, prot, flags, fd, page) +} // TODO(kaib): add support for tracing func (r *PtraceRegs) PC() uint64 { return 0 } diff --git a/src/pkg/syscall/syscall_plan9.go b/src/pkg/syscall/syscall_plan9.go new file mode 100644 index 000000000..831cbddb2 --- /dev/null +++ b/src/pkg/syscall/syscall_plan9.go @@ -0,0 +1,343 @@ +// 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. + +// Plan 9 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 call stubs. +// Note that sometimes we use a lowercase //sys name and +// wrap it in our own nicer implementation. + +package syscall + +import "unsafe" + +const OS = "plan9" + +const ImplementsGetwd = true + +// An Error can represent any printable error condition. +type Error interface { + String() string +} + +// ErrorString implements Error's String method by returning itself. +type ErrorString string + +func (e ErrorString) String() string { return string(e) } + +// NewError converts s to an ErrorString, which satisfies the Error interface. +func NewError(s string) Error { return ErrorString(s) } + +var ( + Stdin = 0 + Stdout = 1 + Stderr = 2 + + EISDIR Error = NewError("file is a directory") +) + +func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err string) +func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err string) +func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) +func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) + +func atoi(b []byte) (n uint) { + n = 0 + for i := 0; i < len(b); i++ { + n = n*10 + uint(b[i]-'0') + } + return +} + +func cstring(s []byte) string { + for i := range s { + if s[i] == 0 { + return string(s[0:i]) + } + } + return string(s) +} + +func errstr() string { + var buf [ERRMAX]byte + + RawSyscall(SYS_ERRSTR, uintptr(unsafe.Pointer(&buf[0])), uintptr(len(buf)), 0) + + buf[len(buf)-1] = 0 + return cstring(buf[:]) +} + +func Getpagesize() int { return 4096 } + +//sys exits(msg *byte) +func Exits(msg *string) { + if msg == nil { + exits(nil) + } + + exits(StringBytePtr(*msg)) +} + +func Exit(code int) { + if code == 0 { + Exits(nil) + } + + msg := itoa(code) + Exits(&msg) +} + +func readnum(path string) (uint, Error) { + var b [12]byte + + fd, e := Open(path, O_RDONLY) + if e != nil { + return 0, e + } + defer Close(fd) + + n, e := Pread(fd, b[:], 0) + + if e != nil { + return 0, e + } + + m := 0 + for ; m < n && b[m] == ' '; m++ { + } + + return atoi(b[m : n-1]), nil +} + +func Getpid() (pid int) { + n, _ := readnum("#c/pid") + return int(n) +} + +func Getppid() (ppid int) { + n, _ := readnum("#c/ppid") + return int(n) +} + + +func Read(fd int, p []byte) (n int, err Error) { + return Pread(fd, p, -1) +} + +func Write(fd int, p []byte) (n int, err Error) { + return Pwrite(fd, p, -1) +} + +func Getwd() (wd string, err Error) { + fd, e := Open(".", O_RDONLY) + + if e != nil { + return "", e + } + defer Close(fd) + + return Fd2path(fd) +} + +//sys fd2path(fd int, buf []byte) (err Error) +func Fd2path(fd int) (path string, err Error) { + var buf [512]byte + + e := fd2path(fd, buf[:]) + if e != nil { + return "", e + } + return cstring(buf[:]), nil +} + +//sys pipe(p *[2]_C_int) (err Error) +func Pipe(p []int) (err Error) { + if len(p) != 2 { + return NewError("bad arg in system call") + } + var pp [2]_C_int + err = pipe(&pp) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return +} + + +//sys sleep(millisecs int32) (err Error) +func Sleep(nsec int64) (err Error) { + return sleep(int32((nsec + 999) / 1e6)) // round up to microsecond +} + +// Underlying system call writes to newoffset via pointer. +// Implemented in assembly to avoid allocation. +func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) + +func Seek(fd int, offset int64, whence int) (newoffset int64, err Error) { + newoffset, e := seek(0, fd, offset, whence) + + err = nil + if newoffset == -1 { + err = NewError(e) + } + return +} + +func Mkdir(path string, mode uint32) (err Error) { + fd, err := Create(path, O_RDONLY, DMDIR|mode) + + if fd != -1 { + Close(fd) + } + + return +} + +type Waitmsg struct { + Pid int + Time [3]uint32 + Msg string +} + +//sys await(s []byte) (n int, err Error) +func Await(w *Waitmsg) (err Error) { + var buf [512]byte + var f [5][]byte + + n, err := await(buf[:]) + + if err != nil || w == nil { + return + } + + nf := 0 + p := 0 + for i := 0; i < n && nf < len(f)-1; i++ { + if buf[i] == ' ' { + f[nf] = buf[p:i] + p = i + 1 + nf++ + } + } + f[nf] = buf[p:] + nf++ + + if nf != len(f) { + return NewError("invalid wait message") + } + w.Pid = int(atoi(f[0])) + w.Time[0] = uint32(atoi(f[1])) + w.Time[1] = uint32(atoi(f[2])) + w.Time[2] = uint32(atoi(f[3])) + w.Msg = string(f[4]) + return +} + +func Unmount(name, old string) (err Error) { + oldp := uintptr(unsafe.Pointer(StringBytePtr(old))) + + var r0 uintptr + var e string + + // bind(2) man page: If name is zero, everything bound or mounted upon old is unbound or unmounted. + if name == "" { + r0, _, e = Syscall(SYS_UNMOUNT, _zero, oldp, 0) + } else { + r0, _, e = Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(name))), oldp, 0) + } + + err = nil + if int(r0) == -1 { + err = NewError(e) + } + return +} + +func Fchdir(fd int) (err Error) { + path, err := Fd2path(fd) + + if err != nil { + return + } + + return Chdir(path) +} + +type Timeval struct { + Sec int32 + Usec int32 +} + +func NsecToTimeval(nsec int64) (tv Timeval) { + nsec += 999 // round up to microsecond + tv.Usec = int32(nsec % 1e9 / 1e3) + tv.Sec = int32(nsec / 1e9) + return +} + +func DecodeBintime(b []byte) (nsec int64, err Error) { + if len(b) != 8 { + return -1, NewError("bad /dev/bintime format") + } + err = nil + nsec = int64(b[0])<<56 | + int64(b[1])<<48 | + int64(b[2])<<40 | + int64(b[3])<<32 | + int64(b[4])<<24 | + int64(b[5])<<16 | + int64(b[6])<<8 | + int64(b[7]) + return +} + +func Gettimeofday(tv *Timeval) (err Error) { + // TODO(paulzhol): + // avoid reopening a file descriptor for /dev/bintime on each call, + // use lower-level calls to avoid allocation. + + var b [8]byte + var nsec int64 + + fd, e := Open("/dev/bintime", O_RDONLY) + if e != nil { + return e + } + defer Close(fd) + + if _, e = Pread(fd, b[:], 0); e != nil { + return e + } + + if nsec, e = DecodeBintime(b[:]); e != nil { + return e + } + *tv = NsecToTimeval(nsec) + + return e +} + +func Getegid() (egid int) { return -1 } +func Geteuid() (euid int) { return -1 } +func Getgid() (gid int) { return -1 } +func Getuid() (uid int) { return -1 } + +func Getgroups() (gids []int, err Error) { + return make([]int, 0), nil +} + +//sys Dup(oldfd int, newfd int) (fd int, err Error) +//sys Open(path string, mode int) (fd int, err Error) +//sys Create(path string, mode int, perm uint32) (fd int, err Error) +//sys Remove(path string) (err Error) +//sys Pread(fd int, p []byte, offset int64) (n int, err Error) +//sys Pwrite(fd int, p []byte, offset int64) (n int, err Error) +//sys Close(fd int) (err Error) +//sys Chdir(path string) (err Error) +//sys Bind(name string, old string, flag int) (err Error) +//sys Mount(fd int, afd int, old string, flag int, aname string) (err Error) +//sys Stat(path string, edir []byte) (n int, err Error) +//sys Fstat(fd int, edir []byte) (n int, err Error) +//sys Wstat(path string, edir []byte) (err Error) +//sys Fwstat(fd int, edir []byte) (err Error) diff --git a/src/pkg/syscall/syscall_plan9_386.go b/src/pkg/syscall/syscall_plan9_386.go new file mode 100644 index 000000000..e82b540b4 --- /dev/null +++ b/src/pkg/syscall/syscall_plan9_386.go @@ -0,0 +1,5 @@ +// 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 diff --git a/src/pkg/syscall/syscall_unix.go b/src/pkg/syscall/syscall_unix.go index c01eca17a..a77e40bc6 100644 --- a/src/pkg/syscall/syscall_unix.go +++ b/src/pkg/syscall/syscall_unix.go @@ -13,10 +13,11 @@ var ( 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 RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) +func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) func Errstr(errno int) string { if errno < 0 || errno >= int(len(errors)) { - return "error " + str(errno) + return "error " + itoa(errno) } return errors[errno] } diff --git a/src/pkg/syscall/syscall_windows.go b/src/pkg/syscall/syscall_windows.go index 394e06442..4ac2154c8 100644 --- a/src/pkg/syscall/syscall_windows.go +++ b/src/pkg/syscall/syscall_windows.go @@ -135,7 +135,7 @@ func NewCallback(fn interface{}) uintptr //sys CreateIoCompletionPort(filehandle int32, cphandle int32, key uint32, threadcnt uint32) (handle int32, errno int) //sys GetQueuedCompletionStatus(cphandle int32, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (errno int) //sys CancelIo(s uint32) (errno int) -//sys CreateProcess(appName *int16, commandLine *uint16, procSecurity *int16, threadSecurity *int16, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (errno int) = CreateProcessW +//sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (errno int) = CreateProcessW //sys OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle uint32, errno int) //sys GetExitCodeProcess(handle uint32, exitcode *uint32) (errno int) //sys GetStartupInfo(startupInfo *StartupInfo) (errno int) = GetStartupInfoW @@ -160,6 +160,7 @@ func NewCallback(fn interface{}) uintptr //sys LocalFree(hmem uint32) (handle uint32, errno int) [failretval!=0] //sys SetHandleInformation(handle int32, mask uint32, flags uint32) (errno int) //sys FlushFileBuffers(handle int32) (errno int) +//sys GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, errno int) = kernel32.GetFullPathNameW // syscall interface implementation for other packages @@ -174,7 +175,7 @@ func Errstr(errno int) string { b := make([]uint16, 300) n, err := FormatMessage(flags, 0, uint32(errno), 0, b, nil) if err != 0 { - return "error " + str(errno) + " (FormatMessage failed with err=" + str(err) + ")" + return "error " + itoa(errno) + " (FormatMessage failed with err=" + itoa(err) + ")" } // trim terminating \r and \n for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { @@ -684,7 +685,7 @@ func (w WaitStatus) Continued() bool { return false } func (w WaitStatus) StopSignal() int { return -1 } -func (w WaitStatus) Signaled() bool { return true } +func (w WaitStatus) Signaled() bool { return false } func (w WaitStatus) TrapCause() int { return -1 } diff --git a/src/pkg/syscall/types_freebsd.c b/src/pkg/syscall/types_freebsd.c index 6fc814134..9d65683ef 100644 --- a/src/pkg/syscall/types_freebsd.c +++ b/src/pkg/syscall/types_freebsd.c @@ -26,6 +26,7 @@ Input to godefs. See also mkerrors.sh and mkall.sh #include <sys/types.h> #include <sys/un.h> #include <sys/wait.h> +#include <net/bpf.h> #include <net/if.h> #include <net/if_dl.h> #include <net/route.h> @@ -167,3 +168,23 @@ typedef struct if_data $IfData; typedef struct ifa_msghdr $IfaMsghdr; typedef struct rt_msghdr $RtMsghdr; typedef struct rt_metrics $RtMetrics; + +// Berkeley packet filter + +enum { + $SizeofBpfVersion = sizeof(struct bpf_version), + $SizeofBpfStat = sizeof(struct bpf_stat), + $SizeofBpfZbuf = sizeof(struct bpf_zbuf), + $SizeofBpfProgram = sizeof(struct bpf_program), + $SizeofBpfInsn = sizeof(struct bpf_insn), + $SizeofBpfHdr = sizeof(struct bpf_hdr), + $SizeofBpfZbufHeader = sizeof(struct bpf_zbuf_header), +}; + +typedef struct bpf_version $BpfVersion; +typedef struct bpf_stat $BpfStat; +typedef struct bpf_zbuf $BpfZbuf; +typedef struct bpf_program $BpfProgram; +typedef struct bpf_insn $BpfInsn; +typedef struct bpf_hdr $BpfHdr; +typedef struct bpf_zbuf_header $BpfZbufHeader; diff --git a/src/pkg/syscall/types_plan9.c b/src/pkg/syscall/types_plan9.c new file mode 100644 index 000000000..6308ce08b --- /dev/null +++ b/src/pkg/syscall/types_plan9.c @@ -0,0 +1,115 @@ +// 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 godefs. See also mkerrors.sh and mkall.sh +*/ + +typedef unsigned short ushort; +typedef unsigned char uchar; +typedef unsigned long ulong; +typedef unsigned int uint; +typedef long long vlong; +typedef unsigned long long uvlong; + +typedef int $_C_int; + +enum { + OREAD = 0, // open for read + OWRITE = 1, // write + ORDWR = 2, // read and write + + $O_RDONLY = OREAD, + $O_WRONLY = OWRITE, + $O_RDWR = ORDWR, + + OEXEC = 3, // execute, == read but check execute permission + OTRUNC = 16, // or'ed in (except for exec), truncate file first + OCEXEC = 32, // or'ed in, close on exec + + $O_CLOEXEC = OCEXEC, + + ORCLOSE = 64, // or'ed in, remove on close + OEXCL = 0x1000, // or'ed in, exclusive use (create only) + $O_EXCL = OEXCL, + + $STATMAX = 65535U, + $ERRMAX = 128, + + $MORDER = 0x0003, // mask for bits defining order of mounting + $MREPL = 0x0000, // mount replaces object + $MBEFORE = 0x0001, // mount goes before others in union directory + $MAFTER = 0x0002, // mount goes after others in union directory + $MCREATE = 0x0004, // permit creation in mounted directory + $MCACHE = 0x0010, // cache some data + $MMASK = 0x0017, // all bits on + + $RFNAMEG = (1<<0), + $RFENVG = (1<<1), + $RFFDG = (1<<2), + $RFNOTEG = (1<<3), + $RFPROC = (1<<4), + $RFMEM = (1<<5), + $RFNOWAIT = (1<<6), + $RFCNAMEG = (1<<10), + $RFCENVG = (1<<11), + $RFCFDG = (1<<12), + $RFREND = (1<<13), + $RFNOMNT = (1<<14), + + // bits in Qid.type + $QTDIR = 0x80, // type bit for directories + $QTAPPEND = 0x40, // type bit for append only files + $QTEXCL = 0x20, // type bit for exclusive use files + $QTMOUNT = 0x10, // type bit for mounted channel + $QTAUTH = 0x08, // type bit for authentication file + $QTTMP = 0x04, // type bit for not-backed-up file + $QTFILE = 0x00, // plain file + + + // bits in Dir.mode + $DMDIR = 0x80000000, // mode bit for directories + $DMAPPEND = 0x40000000, // mode bit for append only files + $DMEXCL = 0x20000000, // mode bit for exclusive use files + $DMMOUNT = 0x10000000, // mode bit for mounted channel + $DMAUTH = 0x08000000, // mode bit for authentication file + $DMTMP = 0x04000000, // mode bit for non-backed-up files + $DMREAD = 0x4, // mode bit for read permission + $DMWRITE = 0x2, // mode bit for write permission + $DMEXEC = 0x1, // mode bit for execute permission + + BIT8SZ = 1, + BIT16SZ = 2, + BIT32SZ = 4, + BIT64SZ = 8, + QIDSZ = BIT8SZ+BIT32SZ+BIT64SZ, + + // STATFIXLEN includes leading 16-bit count + // The count, however, excludes itself; total size is BIT16SZ+count + $STATFIXLEN = BIT16SZ+QIDSZ+5*BIT16SZ+4*BIT32SZ+1*BIT64SZ, // amount of fixed length data in a stat buffer +}; + + +struct Prof // Per process profiling +{ + struct Plink *pp; // known to be 0(ptr) + struct Plink *next; // known to be 4(ptr) + struct Plink *last; + struct Plink *first; + ulong pid; + ulong what; +}; + +struct Tos { + struct Prof prof; + uvlong cyclefreq; // cycle clock frequency if there is one, 0 otherwise + vlong kcycles; // cycles spent in kernel + vlong pcycles; // cycles spent in process (kernel + user) + ulong pid; // might as well put the pid here + ulong clock; + // top of stack is here +}; + +typedef struct Prof $Prof; +typedef struct Tos $Tos; diff --git a/src/pkg/syscall/zerrors_darwin_386.go b/src/pkg/syscall/zerrors_darwin_386.go index 52b986228..48f563f44 100644 --- a/src/pkg/syscall/zerrors_darwin_386.go +++ b/src/pkg/syscall/zerrors_darwin_386.go @@ -196,7 +196,6 @@ const ( F_GETLK = 0x7 F_GETOWN = 0x5 F_GETPATH = 0x32 - F_GETPROTECTIONCLASS = 0x3e F_GLOBAL_NOCACHE = 0x37 F_LOG2PHYS = 0x31 F_MARKDEPENDENCY = 0x3c @@ -213,7 +212,6 @@ const ( F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 - F_SETPROTECTIONCLASS = 0x3f F_SETSIZE = 0x2b F_THAW_FS = 0x36 F_UNLCK = 0x2 @@ -461,6 +459,20 @@ const ( IP_TOS = 0x3 IP_TRAFFIC_MGT_BACKGROUND = 0x41 IP_TTL = 0x4 + MAP_ANON = 0x1000 + MAP_COPY = 0x2 + MAP_FILE = 0 + MAP_FIXED = 0x10 + MAP_HASSEMAPHORE = 0x200 + MAP_NOCACHE = 0x400 + MAP_NOEXTEND = 0x100 + MAP_NORESERVE = 0x40 + MAP_PRIVATE = 0x2 + MAP_RENAME = 0x20 + MAP_RESERVED0080 = 0x80 + MAP_SHARED = 0x1 + MCL_CURRENT = 0x1 + MCL_FUTURE = 0x2 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 @@ -477,6 +489,11 @@ const ( MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITSTREAM = 0x200 + MS_ASYNC = 0x1 + MS_DEACTIVATE = 0x8 + MS_INVALIDATE = 0x2 + MS_KILLPAGES = 0x4 + MS_SYNC = 0x10 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_DUMP2 = 0x7 @@ -509,6 +526,10 @@ const ( O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 + PROT_EXEC = 0x4 + PROT_NONE = 0 + PROT_READ = 0x1 + PROT_WRITE = 0x2 RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0 @@ -535,7 +556,6 @@ const ( RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 - RTF_IFREF = 0x4000000 RTF_IFSCOPE = 0x1000000 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 @@ -629,7 +649,6 @@ const ( SIOCDIFADDR = 0x80206919 SIOCDIFPHYADDR = 0x80206941 SIOCDLIFADDR = 0x8118691f - SIOCGDRVSPEC = 0xc01c697b SIOCGETSGCNT = 0xc014721c SIOCGETVIFCNT = 0xc014721b SIOCGETVLAN = 0xc020697f @@ -661,10 +680,8 @@ const ( SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCIFCREATE = 0xc0206978 - SIOCIFCREATE2 = 0xc020697a SIOCIFDESTROY = 0x80206979 SIOCRSLVMULTI = 0xc008693b - SIOCSDRVSPEC = 0x801c697b SIOCSETVLAN = 0x8020697e SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c diff --git a/src/pkg/syscall/zerrors_darwin_amd64.go b/src/pkg/syscall/zerrors_darwin_amd64.go index 4e7a174ea..840ea13ce 100644 --- a/src/pkg/syscall/zerrors_darwin_amd64.go +++ b/src/pkg/syscall/zerrors_darwin_amd64.go @@ -196,7 +196,6 @@ const ( F_GETLK = 0x7 F_GETOWN = 0x5 F_GETPATH = 0x32 - F_GETPROTECTIONCLASS = 0x3e F_GLOBAL_NOCACHE = 0x37 F_LOG2PHYS = 0x31 F_MARKDEPENDENCY = 0x3c @@ -213,7 +212,6 @@ const ( F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 - F_SETPROTECTIONCLASS = 0x3f F_SETSIZE = 0x2b F_THAW_FS = 0x36 F_UNLCK = 0x2 @@ -461,6 +459,20 @@ const ( IP_TOS = 0x3 IP_TRAFFIC_MGT_BACKGROUND = 0x41 IP_TTL = 0x4 + MAP_ANON = 0x1000 + MAP_COPY = 0x2 + MAP_FILE = 0 + MAP_FIXED = 0x10 + MAP_HASSEMAPHORE = 0x200 + MAP_NOCACHE = 0x400 + MAP_NOEXTEND = 0x100 + MAP_NORESERVE = 0x40 + MAP_PRIVATE = 0x2 + MAP_RENAME = 0x20 + MAP_RESERVED0080 = 0x80 + MAP_SHARED = 0x1 + MCL_CURRENT = 0x1 + MCL_FUTURE = 0x2 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 @@ -477,6 +489,11 @@ const ( MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITSTREAM = 0x200 + MS_ASYNC = 0x1 + MS_DEACTIVATE = 0x8 + MS_INVALIDATE = 0x2 + MS_KILLPAGES = 0x4 + MS_SYNC = 0x10 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_DUMP2 = 0x7 @@ -509,6 +526,10 @@ const ( O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 + PROT_EXEC = 0x4 + PROT_NONE = 0 + PROT_READ = 0x1 + PROT_WRITE = 0x2 RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0 @@ -535,7 +556,6 @@ const ( RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 - RTF_IFREF = 0x4000000 RTF_IFSCOPE = 0x1000000 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 @@ -629,7 +649,6 @@ const ( SIOCDIFADDR = 0x80206919 SIOCDIFPHYADDR = 0x80206941 SIOCDLIFADDR = 0x8118691f - SIOCGDRVSPEC = 0xc028697b SIOCGETSGCNT = 0xc014721c SIOCGETVIFCNT = 0xc014721b SIOCGETVLAN = 0xc020697f @@ -661,10 +680,8 @@ const ( SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCIFCREATE = 0xc0206978 - SIOCIFCREATE2 = 0xc020697a SIOCIFDESTROY = 0x80206979 SIOCRSLVMULTI = 0xc010693b - SIOCSDRVSPEC = 0x8028697b SIOCSETVLAN = 0x8020697e SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c diff --git a/src/pkg/syscall/zerrors_freebsd_386.go b/src/pkg/syscall/zerrors_freebsd_386.go index d3d46ce03..9c21c71eb 100644 --- a/src/pkg/syscall/zerrors_freebsd_386.go +++ b/src/pkg/syscall/zerrors_freebsd_386.go @@ -9,805 +9,1013 @@ package syscall // Constants const ( - AF_APPLETALK = 0x10 - AF_ARP = 0x23 - AF_ATM = 0x1e - AF_BLUETOOTH = 0x24 - AF_CCITT = 0xa - AF_CHAOS = 0x5 - AF_CNT = 0x15 - AF_COIP = 0x14 - AF_DATAKIT = 0x9 - AF_DECnet = 0xc - AF_DLI = 0xd - AF_E164 = 0x1a - AF_ECMA = 0x8 - AF_HYLINK = 0xf - AF_IEEE80211 = 0x25 - AF_IMPLINK = 0x3 - AF_INET = 0x2 - AF_INET6 = 0x1c - AF_IPX = 0x17 - AF_ISDN = 0x1a - AF_ISO = 0x7 - AF_LAT = 0xe - AF_LINK = 0x12 - AF_LOCAL = 0x1 - AF_MAX = 0x26 - AF_NATM = 0x1d - AF_NETBIOS = 0x6 - AF_NETGRAPH = 0x20 - AF_OSI = 0x7 - AF_PUP = 0x4 - AF_ROUTE = 0x11 - AF_SCLUSTER = 0x22 - AF_SIP = 0x18 - AF_SLOW = 0x21 - AF_SNA = 0xb - AF_UNIX = 0x1 - AF_UNSPEC = 0 - AF_VENDOR00 = 0x27 - AF_VENDOR01 = 0x29 - AF_VENDOR02 = 0x2b - AF_VENDOR03 = 0x2d - AF_VENDOR04 = 0x2f - AF_VENDOR05 = 0x31 - AF_VENDOR06 = 0x33 - AF_VENDOR07 = 0x35 - AF_VENDOR08 = 0x37 - AF_VENDOR09 = 0x39 - AF_VENDOR10 = 0x3b - AF_VENDOR11 = 0x3d - AF_VENDOR12 = 0x3f - AF_VENDOR13 = 0x41 - AF_VENDOR14 = 0x43 - AF_VENDOR15 = 0x45 - AF_VENDOR16 = 0x47 - AF_VENDOR17 = 0x49 - AF_VENDOR18 = 0x4b - AF_VENDOR19 = 0x4d - AF_VENDOR20 = 0x4f - AF_VENDOR21 = 0x51 - AF_VENDOR22 = 0x53 - AF_VENDOR23 = 0x55 - AF_VENDOR24 = 0x57 - AF_VENDOR25 = 0x59 - AF_VENDOR26 = 0x5b - AF_VENDOR27 = 0x5d - AF_VENDOR28 = 0x5f - AF_VENDOR29 = 0x61 - AF_VENDOR30 = 0x63 - AF_VENDOR31 = 0x65 - AF_VENDOR32 = 0x67 - AF_VENDOR33 = 0x69 - AF_VENDOR34 = 0x6b - AF_VENDOR35 = 0x6d - AF_VENDOR36 = 0x6f - AF_VENDOR37 = 0x71 - AF_VENDOR38 = 0x73 - AF_VENDOR39 = 0x75 - AF_VENDOR40 = 0x77 - AF_VENDOR41 = 0x79 - AF_VENDOR42 = 0x7b - AF_VENDOR43 = 0x7d - AF_VENDOR44 = 0x7f - AF_VENDOR45 = 0x81 - AF_VENDOR46 = 0x83 - AF_VENDOR47 = 0x85 - CTL_MAXNAME = 0x18 - CTL_NET = 0x4 - E2BIG = 0x7 - EACCES = 0xd - EADDRINUSE = 0x30 - EADDRNOTAVAIL = 0x31 - EAFNOSUPPORT = 0x2f - EAGAIN = 0x23 - EALREADY = 0x25 - EAUTH = 0x50 - EBADF = 0x9 - EBADMSG = 0x59 - EBADRPC = 0x48 - EBUSY = 0x10 - ECANCELED = 0x55 - ECHILD = 0xa - ECONNABORTED = 0x35 - ECONNREFUSED = 0x3d - ECONNRESET = 0x36 - EDEADLK = 0xb - EDESTADDRREQ = 0x27 - EDOM = 0x21 - EDOOFUS = 0x58 - EDQUOT = 0x45 - EEXIST = 0x11 - EFAULT = 0xe - EFBIG = 0x1b - EFTYPE = 0x4f - EHOSTDOWN = 0x40 - EHOSTUNREACH = 0x41 - EIDRM = 0x52 - EILSEQ = 0x56 - EINPROGRESS = 0x24 - EINTR = 0x4 - EINVAL = 0x16 - EIO = 0x5 - EISCONN = 0x38 - EISDIR = 0x15 - ELAST = 0x5d - ELOOP = 0x3e - EMFILE = 0x18 - EMLINK = 0x1f - EMSGSIZE = 0x28 - EMULTIHOP = 0x5a - ENAMETOOLONG = 0x3f - ENEEDAUTH = 0x51 - ENETDOWN = 0x32 - ENETRESET = 0x34 - ENETUNREACH = 0x33 - ENFILE = 0x17 - ENOATTR = 0x57 - ENOBUFS = 0x37 - ENODEV = 0x13 - ENOENT = 0x2 - ENOEXEC = 0x8 - ENOLCK = 0x4d - ENOLINK = 0x5b - ENOMEM = 0xc - ENOMSG = 0x53 - ENOPROTOOPT = 0x2a - ENOSPC = 0x1c - ENOSYS = 0x4e - ENOTBLK = 0xf - ENOTCAPABLE = 0x5d - ENOTCONN = 0x39 - ENOTDIR = 0x14 - ENOTEMPTY = 0x42 - ENOTSOCK = 0x26 - ENOTSUP = 0x2d - ENOTTY = 0x19 - ENXIO = 0x6 - EOPNOTSUPP = 0x2d - EOVERFLOW = 0x54 - EPERM = 0x1 - EPFNOSUPPORT = 0x2e - EPIPE = 0x20 - EPROCLIM = 0x43 - EPROCUNAVAIL = 0x4c - EPROGMISMATCH = 0x4b - EPROGUNAVAIL = 0x4a - EPROTO = 0x5c - EPROTONOSUPPORT = 0x2b - EPROTOTYPE = 0x29 - ERANGE = 0x22 - EREMOTE = 0x47 - EROFS = 0x1e - ERPCMISMATCH = 0x49 - ESHUTDOWN = 0x3a - ESOCKTNOSUPPORT = 0x2c - ESPIPE = 0x1d - ESRCH = 0x3 - ESTALE = 0x46 - ETIMEDOUT = 0x3c - ETOOMANYREFS = 0x3b - ETXTBSY = 0x1a - EUSERS = 0x44 - EVFILT_AIO = -0x3 - EVFILT_FS = -0x9 - EVFILT_LIO = -0xa - EVFILT_PROC = -0x5 - EVFILT_READ = -0x1 - EVFILT_SIGNAL = -0x6 - EVFILT_SYSCOUNT = 0xb - EVFILT_TIMER = -0x7 - EVFILT_USER = -0xb - EVFILT_VNODE = -0x4 - EVFILT_WRITE = -0x2 - EV_ADD = 0x1 - EV_CLEAR = 0x20 - EV_DELETE = 0x2 - EV_DISABLE = 0x8 - EV_DISPATCH = 0x80 - EV_ENABLE = 0x4 - EV_EOF = 0x8000 - EV_ERROR = 0x4000 - EV_FLAG1 = 0x2000 - EV_ONESHOT = 0x10 - EV_RECEIPT = 0x40 - EV_SYSFLAGS = 0xf000 - EWOULDBLOCK = 0x23 - EXDEV = 0x12 - FD_CLOEXEC = 0x1 - FD_SETSIZE = 0x400 - F_CANCEL = 0x5 - F_DUP2FD = 0xa - F_DUPFD = 0 - F_GETFD = 0x1 - F_GETFL = 0x3 - F_GETLK = 0xb - F_GETOWN = 0x5 - F_OGETLK = 0x7 - F_OSETLK = 0x8 - F_OSETLKW = 0x9 - F_RDAHEAD = 0x10 - F_RDLCK = 0x1 - F_READAHEAD = 0xf - F_SETFD = 0x2 - F_SETFL = 0x4 - F_SETLK = 0xc - F_SETLKW = 0xd - F_SETLK_REMOTE = 0xe - F_SETOWN = 0x6 - F_UNLCK = 0x2 - F_UNLCKSYS = 0x4 - F_WRLCK = 0x3 - IFF_ALLMULTI = 0x200 - IFF_ALTPHYS = 0x4000 - IFF_BROADCAST = 0x2 - IFF_CANTCHANGE = 0x208f72 - IFF_DEBUG = 0x4 - IFF_DRV_OACTIVE = 0x400 - IFF_DRV_RUNNING = 0x40 - IFF_DYING = 0x200000 - IFF_LINK0 = 0x1000 - IFF_LINK1 = 0x2000 - IFF_LINK2 = 0x4000 - IFF_LOOPBACK = 0x8 - IFF_MONITOR = 0x40000 - IFF_MULTICAST = 0x8000 - IFF_NOARP = 0x80 - IFF_OACTIVE = 0x400 - IFF_POINTOPOINT = 0x10 - IFF_PPROMISC = 0x20000 - IFF_PROMISC = 0x100 - IFF_RENAMING = 0x400000 - IFF_RUNNING = 0x40 - IFF_SIMPLEX = 0x800 - IFF_SMART = 0x20 - IFF_STATICARP = 0x80000 - IFF_UP = 0x1 - IFNAMSIZ = 0x10 - IN_CLASSA_HOST = 0xffffff - IN_CLASSA_MAX = 0x80 - IN_CLASSA_NET = 0xff000000 - IN_CLASSA_NSHIFT = 0x18 - IN_CLASSB_HOST = 0xffff - IN_CLASSB_MAX = 0x10000 - IN_CLASSB_NET = 0xffff0000 - IN_CLASSB_NSHIFT = 0x10 - IN_CLASSC_HOST = 0xff - IN_CLASSC_NET = 0xffffff00 - IN_CLASSC_NSHIFT = 0x8 - IN_CLASSD_HOST = 0xfffffff - IN_CLASSD_NET = 0xf0000000 - IN_CLASSD_NSHIFT = 0x1c - IN_LOOPBACKNET = 0x7f - IPPROTO_3PC = 0x22 - IPPROTO_ADFS = 0x44 - IPPROTO_AH = 0x33 - IPPROTO_AHIP = 0x3d - IPPROTO_APES = 0x63 - IPPROTO_ARGUS = 0xd - IPPROTO_AX25 = 0x5d - IPPROTO_BHA = 0x31 - IPPROTO_BLT = 0x1e - IPPROTO_BRSATMON = 0x4c - IPPROTO_CARP = 0x70 - IPPROTO_CFTP = 0x3e - IPPROTO_CHAOS = 0x10 - IPPROTO_CMTP = 0x26 - IPPROTO_CPHB = 0x49 - IPPROTO_CPNX = 0x48 - IPPROTO_DDP = 0x25 - IPPROTO_DGP = 0x56 - IPPROTO_DIVERT = 0x102 - IPPROTO_DONE = 0x101 - IPPROTO_DSTOPTS = 0x3c - IPPROTO_EGP = 0x8 - IPPROTO_EMCON = 0xe - IPPROTO_ENCAP = 0x62 - IPPROTO_EON = 0x50 - IPPROTO_ESP = 0x32 - IPPROTO_ETHERIP = 0x61 - IPPROTO_FRAGMENT = 0x2c - IPPROTO_GGP = 0x3 - IPPROTO_GMTP = 0x64 - IPPROTO_GRE = 0x2f - IPPROTO_HELLO = 0x3f - IPPROTO_HMP = 0x14 - IPPROTO_HOPOPTS = 0 - IPPROTO_ICMP = 0x1 - IPPROTO_ICMPV6 = 0x3a - IPPROTO_IDP = 0x16 - IPPROTO_IDPR = 0x23 - IPPROTO_IDRP = 0x2d - IPPROTO_IGMP = 0x2 - IPPROTO_IGP = 0x55 - IPPROTO_IGRP = 0x58 - IPPROTO_IL = 0x28 - IPPROTO_INLSP = 0x34 - IPPROTO_INP = 0x20 - IPPROTO_IP = 0 - IPPROTO_IPCOMP = 0x6c - IPPROTO_IPCV = 0x47 - IPPROTO_IPEIP = 0x5e - IPPROTO_IPIP = 0x4 - IPPROTO_IPPC = 0x43 - IPPROTO_IPV4 = 0x4 - IPPROTO_IPV6 = 0x29 - IPPROTO_IRTP = 0x1c - IPPROTO_KRYPTOLAN = 0x41 - IPPROTO_LARP = 0x5b - IPPROTO_LEAF1 = 0x19 - IPPROTO_LEAF2 = 0x1a - IPPROTO_MAX = 0x100 - IPPROTO_MAXID = 0x34 - IPPROTO_MEAS = 0x13 - IPPROTO_MHRP = 0x30 - IPPROTO_MICP = 0x5f - IPPROTO_MOBILE = 0x37 - IPPROTO_MTP = 0x5c - IPPROTO_MUX = 0x12 - IPPROTO_ND = 0x4d - IPPROTO_NHRP = 0x36 - IPPROTO_NONE = 0x3b - IPPROTO_NSP = 0x1f - IPPROTO_NVPII = 0xb - IPPROTO_OLD_DIVERT = 0xfe - IPPROTO_OSPFIGP = 0x59 - IPPROTO_PFSYNC = 0xf0 - IPPROTO_PGM = 0x71 - IPPROTO_PIGP = 0x9 - IPPROTO_PIM = 0x67 - IPPROTO_PRM = 0x15 - IPPROTO_PUP = 0xc - IPPROTO_PVP = 0x4b - IPPROTO_RAW = 0xff - IPPROTO_RCCMON = 0xa - IPPROTO_RDP = 0x1b - IPPROTO_ROUTING = 0x2b - IPPROTO_RSVP = 0x2e - IPPROTO_RVD = 0x42 - IPPROTO_SATEXPAK = 0x40 - IPPROTO_SATMON = 0x45 - IPPROTO_SCCSP = 0x60 - IPPROTO_SCTP = 0x84 - IPPROTO_SDRP = 0x2a - IPPROTO_SEP = 0x21 - IPPROTO_SKIP = 0x39 - IPPROTO_SPACER = 0x7fff - IPPROTO_SRPC = 0x5a - IPPROTO_ST = 0x7 - IPPROTO_SVMTP = 0x52 - IPPROTO_SWIPE = 0x35 - IPPROTO_TCF = 0x57 - IPPROTO_TCP = 0x6 - IPPROTO_TLSP = 0x38 - IPPROTO_TP = 0x1d - IPPROTO_TPXX = 0x27 - IPPROTO_TRUNK1 = 0x17 - IPPROTO_TRUNK2 = 0x18 - IPPROTO_TTP = 0x54 - IPPROTO_UDP = 0x11 - IPPROTO_VINES = 0x53 - IPPROTO_VISA = 0x46 - IPPROTO_VMTP = 0x51 - IPPROTO_WBEXPAK = 0x4f - IPPROTO_WBMON = 0x4e - IPPROTO_WSN = 0x4a - IPPROTO_XNET = 0xf - IPPROTO_XTP = 0x24 - IPV6_AUTOFLOWLABEL = 0x3b - IPV6_BINDANY = 0x40 - IPV6_BINDV6ONLY = 0x1b - IPV6_CHECKSUM = 0x1a - IPV6_DEFAULT_MULTICAST_HOPS = 0x1 - IPV6_DEFAULT_MULTICAST_LOOP = 0x1 - IPV6_DEFHLIM = 0x40 - IPV6_DONTFRAG = 0x3e - IPV6_DSTOPTS = 0x32 - IPV6_FAITH = 0x1d - IPV6_FLOWINFO_MASK = 0xffffff0f - IPV6_FLOWLABEL_MASK = 0xffff0f00 - IPV6_FRAGTTL = 0x78 - IPV6_FW_ADD = 0x1e - IPV6_FW_DEL = 0x1f - IPV6_FW_FLUSH = 0x20 - IPV6_FW_GET = 0x22 - IPV6_FW_ZERO = 0x21 - IPV6_HLIMDEC = 0x1 - IPV6_HOPLIMIT = 0x2f - IPV6_HOPOPTS = 0x31 - IPV6_IPSEC_POLICY = 0x1c - IPV6_JOIN_GROUP = 0xc - IPV6_LEAVE_GROUP = 0xd - IPV6_MAXHLIM = 0xff - IPV6_MAXOPTHDR = 0x800 - IPV6_MAXPACKET = 0xffff - IPV6_MAX_GROUP_SRC_FILTER = 0x200 - IPV6_MAX_MEMBERSHIPS = 0xfff - IPV6_MAX_SOCK_SRC_FILTER = 0x80 - IPV6_MIN_MEMBERSHIPS = 0x1f - IPV6_MMTU = 0x500 - IPV6_MSFILTER = 0x4a - IPV6_MULTICAST_HOPS = 0xa - IPV6_MULTICAST_IF = 0x9 - IPV6_MULTICAST_LOOP = 0xb - IPV6_NEXTHOP = 0x30 - IPV6_PATHMTU = 0x2c - IPV6_PKTINFO = 0x2e - IPV6_PORTRANGE = 0xe - IPV6_PORTRANGE_DEFAULT = 0 - IPV6_PORTRANGE_HIGH = 0x1 - IPV6_PORTRANGE_LOW = 0x2 - IPV6_PREFER_TEMPADDR = 0x3f - IPV6_RECVDSTOPTS = 0x28 - IPV6_RECVHOPLIMIT = 0x25 - IPV6_RECVHOPOPTS = 0x27 - IPV6_RECVPATHMTU = 0x2b - IPV6_RECVPKTINFO = 0x24 - IPV6_RECVRTHDR = 0x26 - IPV6_RECVTCLASS = 0x39 - IPV6_RTHDR = 0x33 - IPV6_RTHDRDSTOPTS = 0x23 - IPV6_RTHDR_LOOSE = 0 - IPV6_RTHDR_STRICT = 0x1 - IPV6_RTHDR_TYPE_0 = 0 - IPV6_SOCKOPT_RESERVED1 = 0x3 - IPV6_TCLASS = 0x3d - IPV6_UNICAST_HOPS = 0x4 - IPV6_USE_MIN_MTU = 0x2a - IPV6_V6ONLY = 0x1b - IPV6_VERSION = 0x60 - IPV6_VERSION_MASK = 0xf0 - IP_ADD_MEMBERSHIP = 0xc - IP_ADD_SOURCE_MEMBERSHIP = 0x46 - IP_BINDANY = 0x18 - IP_BLOCK_SOURCE = 0x48 - IP_DEFAULT_MULTICAST_LOOP = 0x1 - IP_DEFAULT_MULTICAST_TTL = 0x1 - IP_DF = 0x4000 - IP_DONTFRAG = 0x43 - IP_DROP_MEMBERSHIP = 0xd - IP_DROP_SOURCE_MEMBERSHIP = 0x47 - IP_DUMMYNET3 = 0x31 - IP_DUMMYNET_CONFIGURE = 0x3c - IP_DUMMYNET_DEL = 0x3d - IP_DUMMYNET_FLUSH = 0x3e - IP_DUMMYNET_GET = 0x40 - IP_FAITH = 0x16 - IP_FW3 = 0x30 - IP_FW_ADD = 0x32 - IP_FW_DEL = 0x33 - IP_FW_FLUSH = 0x34 - IP_FW_GET = 0x36 - IP_FW_NAT_CFG = 0x38 - IP_FW_NAT_DEL = 0x39 - IP_FW_NAT_GET_CONFIG = 0x3a - IP_FW_NAT_GET_LOG = 0x3b - IP_FW_RESETLOG = 0x37 - IP_FW_TABLE_ADD = 0x28 - IP_FW_TABLE_DEL = 0x29 - IP_FW_TABLE_FLUSH = 0x2a - IP_FW_TABLE_GETSIZE = 0x2b - IP_FW_TABLE_LIST = 0x2c - IP_FW_ZERO = 0x35 - IP_HDRINCL = 0x2 - IP_IPSEC_POLICY = 0x15 - IP_MAXPACKET = 0xffff - IP_MAX_GROUP_SRC_FILTER = 0x200 - IP_MAX_MEMBERSHIPS = 0xfff - IP_MAX_SOCK_MUTE_FILTER = 0x80 - IP_MAX_SOCK_SRC_FILTER = 0x80 - IP_MAX_SOURCE_FILTER = 0x400 - IP_MF = 0x2000 - IP_MINTTL = 0x42 - IP_MIN_MEMBERSHIPS = 0x1f - IP_MSFILTER = 0x4a - IP_MSS = 0x240 - IP_MULTICAST_IF = 0x9 - IP_MULTICAST_LOOP = 0xb - IP_MULTICAST_TTL = 0xa - IP_MULTICAST_VIF = 0xe - IP_OFFMASK = 0x1fff - IP_ONESBCAST = 0x17 - IP_OPTIONS = 0x1 - IP_PORTRANGE = 0x13 - IP_PORTRANGE_DEFAULT = 0 - IP_PORTRANGE_HIGH = 0x1 - IP_PORTRANGE_LOW = 0x2 - IP_RECVDSTADDR = 0x7 - IP_RECVIF = 0x14 - IP_RECVOPTS = 0x5 - IP_RECVRETOPTS = 0x6 - IP_RECVTTL = 0x41 - IP_RETOPTS = 0x8 - IP_RF = 0x8000 - IP_RSVP_OFF = 0x10 - IP_RSVP_ON = 0xf - IP_RSVP_VIF_OFF = 0x12 - IP_RSVP_VIF_ON = 0x11 - IP_SENDSRCADDR = 0x7 - IP_TOS = 0x3 - IP_TTL = 0x4 - IP_UNBLOCK_SOURCE = 0x49 - MSG_COMPAT = 0x8000 - MSG_CTRUNC = 0x20 - MSG_DONTROUTE = 0x4 - MSG_DONTWAIT = 0x80 - MSG_EOF = 0x100 - MSG_EOR = 0x8 - MSG_NBIO = 0x4000 - MSG_NOSIGNAL = 0x20000 - MSG_NOTIFICATION = 0x2000 - MSG_OOB = 0x1 - MSG_PEEK = 0x2 - MSG_TRUNC = 0x10 - MSG_WAITALL = 0x40 - NET_RT_DUMP = 0x1 - NET_RT_FLAGS = 0x2 - NET_RT_IFLIST = 0x3 - NET_RT_IFMALIST = 0x4 - NET_RT_MAXID = 0x5 - O_ACCMODE = 0x3 - O_APPEND = 0x8 - O_ASYNC = 0x40 - O_CREAT = 0x200 - O_DIRECT = 0x10000 - O_DIRECTORY = 0x20000 - O_EXCL = 0x800 - O_EXEC = 0x40000 - O_EXLOCK = 0x20 - O_FSYNC = 0x80 - O_NDELAY = 0x4 - O_NOCTTY = 0x8000 - O_NOFOLLOW = 0x100 - O_NONBLOCK = 0x4 - O_RDONLY = 0 - O_RDWR = 0x2 - O_SHLOCK = 0x10 - O_SYNC = 0x80 - O_TRUNC = 0x400 - O_TTY_INIT = 0x80000 - O_WRONLY = 0x1 - RTAX_AUTHOR = 0x6 - RTAX_BRD = 0x7 - RTAX_DST = 0 - RTAX_GATEWAY = 0x1 - RTAX_GENMASK = 0x3 - RTAX_IFA = 0x5 - RTAX_IFP = 0x4 - RTAX_MAX = 0x8 - RTAX_NETMASK = 0x2 - RTA_AUTHOR = 0x40 - RTA_BRD = 0x80 - RTA_DST = 0x1 - RTA_GATEWAY = 0x2 - RTA_GENMASK = 0x8 - RTA_IFA = 0x20 - RTA_IFP = 0x10 - RTA_NETMASK = 0x4 - RTF_BLACKHOLE = 0x1000 - RTF_BROADCAST = 0x400000 - RTF_DONE = 0x40 - RTF_DYNAMIC = 0x10 - RTF_FMASK = 0x1004d808 - RTF_GATEWAY = 0x2 - RTF_HOST = 0x4 - RTF_LLDATA = 0x400 - RTF_LLINFO = 0x400 - RTF_LOCAL = 0x200000 - RTF_MODIFIED = 0x20 - RTF_MULTICAST = 0x800000 - RTF_PINNED = 0x100000 - RTF_PRCLONING = 0x10000 - RTF_PROTO1 = 0x8000 - RTF_PROTO2 = 0x4000 - RTF_PROTO3 = 0x40000 - RTF_REJECT = 0x8 - RTF_RNH_LOCKED = 0x40000000 - RTF_STATIC = 0x800 - RTF_STICKY = 0x10000000 - RTF_UP = 0x1 - RTF_XRESOLVE = 0x200 - RTM_ADD = 0x1 - RTM_CHANGE = 0x3 - RTM_DELADDR = 0xd - RTM_DELETE = 0x2 - RTM_DELMADDR = 0x10 - RTM_GET = 0x4 - RTM_IEEE80211 = 0x12 - RTM_IFANNOUNCE = 0x11 - RTM_IFINFO = 0xe - RTM_LOCK = 0x8 - RTM_LOSING = 0x5 - RTM_MISS = 0x7 - RTM_NEWADDR = 0xc - RTM_NEWMADDR = 0xf - RTM_OLDADD = 0x9 - RTM_OLDDEL = 0xa - RTM_REDIRECT = 0x6 - RTM_RESOLVE = 0xb - RTM_RTTUNIT = 0xf4240 - RTM_VERSION = 0x5 - RTV_EXPIRE = 0x4 - RTV_HOPCOUNT = 0x2 - RTV_MTU = 0x1 - RTV_RPIPE = 0x8 - RTV_RTT = 0x40 - RTV_RTTVAR = 0x80 - RTV_SPIPE = 0x10 - RTV_SSTHRESH = 0x20 - RTV_WEIGHT = 0x100 - SCM_BINTIME = 0x4 - SCM_CREDS = 0x3 - SCM_RIGHTS = 0x1 - SCM_TIMESTAMP = 0x2 - SHUT_RD = 0 - SHUT_RDWR = 0x2 - SHUT_WR = 0x1 - SIGABRT = 0x6 - SIGALRM = 0xe - SIGBUS = 0xa - SIGCHLD = 0x14 - SIGCONT = 0x13 - SIGEMT = 0x7 - SIGFPE = 0x8 - SIGHUP = 0x1 - SIGILL = 0x4 - SIGINFO = 0x1d - SIGINT = 0x2 - SIGIO = 0x17 - SIGIOT = 0x6 - SIGKILL = 0x9 - SIGLWP = 0x20 - SIGPIPE = 0xd - SIGPROF = 0x1b - SIGQUIT = 0x3 - SIGSEGV = 0xb - SIGSTOP = 0x11 - SIGSYS = 0xc - SIGTERM = 0xf - SIGTHR = 0x20 - SIGTRAP = 0x5 - SIGTSTP = 0x12 - SIGTTIN = 0x15 - SIGTTOU = 0x16 - SIGURG = 0x10 - SIGUSR1 = 0x1e - SIGUSR2 = 0x1f - SIGVTALRM = 0x1a - SIGWINCH = 0x1c - SIGXCPU = 0x18 - SIGXFSZ = 0x19 - SIOCADDMULTI = 0x80206931 - SIOCADDRT = 0x8030720a - SIOCAIFADDR = 0x8040691a - SIOCAIFGROUP = 0x80246987 - SIOCALIFADDR = 0x8118691b - SIOCATMARK = 0x40047307 - SIOCDELMULTI = 0x80206932 - SIOCDELRT = 0x8030720b - SIOCDIFADDR = 0x80206919 - SIOCDIFGROUP = 0x80246989 - SIOCDIFPHYADDR = 0x80206949 - SIOCDLIFADDR = 0x8118691d - SIOCGDRVSPEC = 0xc01c697b - SIOCGETSGCNT = 0xc0147210 - SIOCGETVIFCNT = 0xc014720f - SIOCGHIWAT = 0x40047301 - SIOCGIFADDR = 0xc0206921 - SIOCGIFBRDADDR = 0xc0206923 - SIOCGIFCAP = 0xc020691f - SIOCGIFCONF = 0xc0086924 - SIOCGIFDESCR = 0xc020692a - SIOCGIFDSTADDR = 0xc0206922 - SIOCGIFFLAGS = 0xc0206911 - SIOCGIFGENERIC = 0xc020693a - SIOCGIFGMEMB = 0xc024698a - SIOCGIFGROUP = 0xc0246988 - SIOCGIFINDEX = 0xc0206920 - SIOCGIFMAC = 0xc0206926 - SIOCGIFMEDIA = 0xc0286938 - SIOCGIFMETRIC = 0xc0206917 - SIOCGIFMTU = 0xc0206933 - SIOCGIFNETMASK = 0xc0206925 - SIOCGIFPDSTADDR = 0xc0206948 - SIOCGIFPHYS = 0xc0206935 - SIOCGIFPSRCADDR = 0xc0206947 - SIOCGIFSTATUS = 0xc331693b - SIOCGLIFADDR = 0xc118691c - SIOCGLIFPHYADDR = 0xc118694b - SIOCGLOWAT = 0x40047303 - SIOCGPGRP = 0x40047309 - SIOCGPRIVATE_0 = 0xc0206950 - SIOCGPRIVATE_1 = 0xc0206951 - SIOCIFCREATE = 0xc020697a - SIOCIFCREATE2 = 0xc020697c - SIOCIFDESTROY = 0x80206979 - SIOCIFGCLONERS = 0xc00c6978 - SIOCSDRVSPEC = 0x801c697b - SIOCSHIWAT = 0x80047300 - SIOCSIFADDR = 0x8020690c - SIOCSIFBRDADDR = 0x80206913 - SIOCSIFCAP = 0x8020691e - SIOCSIFDESCR = 0x80206929 - SIOCSIFDSTADDR = 0x8020690e - SIOCSIFFLAGS = 0x80206910 - SIOCSIFGENERIC = 0x80206939 - SIOCSIFLLADDR = 0x8020693c - SIOCSIFMAC = 0x80206927 - SIOCSIFMEDIA = 0xc0206937 - SIOCSIFMETRIC = 0x80206918 - SIOCSIFMTU = 0x80206934 - SIOCSIFNAME = 0x80206928 - SIOCSIFNETMASK = 0x80206916 - SIOCSIFPHYADDR = 0x80406946 - SIOCSIFPHYS = 0x80206936 - SIOCSIFRVNET = 0xc020695b - SIOCSIFVNET = 0xc020695a - SIOCSLIFPHYADDR = 0x8118694a - SIOCSLOWAT = 0x80047302 - SIOCSPGRP = 0x80047308 - SOCK_DGRAM = 0x2 - SOCK_MAXADDRLEN = 0xff - SOCK_RAW = 0x3 - SOCK_RDM = 0x4 - SOCK_SEQPACKET = 0x5 - SOCK_STREAM = 0x1 - SOL_SOCKET = 0xffff - SOMAXCONN = 0x80 - SO_ACCEPTCONN = 0x2 - SO_ACCEPTFILTER = 0x1000 - SO_BINTIME = 0x2000 - SO_BROADCAST = 0x20 - SO_DEBUG = 0x1 - SO_DONTROUTE = 0x10 - SO_ERROR = 0x1007 - SO_KEEPALIVE = 0x8 - SO_LABEL = 0x1009 - SO_LINGER = 0x80 - SO_LISTENINCQLEN = 0x1013 - SO_LISTENQLEN = 0x1012 - SO_LISTENQLIMIT = 0x1011 - SO_NOSIGPIPE = 0x800 - SO_NO_DDP = 0x8000 - SO_NO_OFFLOAD = 0x4000 - SO_OOBINLINE = 0x100 - SO_PEERLABEL = 0x1010 - SO_RCVBUF = 0x1002 - SO_RCVLOWAT = 0x1004 - SO_RCVTIMEO = 0x1006 - SO_REUSEADDR = 0x4 - SO_REUSEPORT = 0x200 - SO_SETFIB = 0x1014 - SO_SNDBUF = 0x1001 - SO_SNDLOWAT = 0x1003 - SO_SNDTIMEO = 0x1005 - SO_TIMESTAMP = 0x400 - SO_TYPE = 0x1008 - SO_USELOOPBACK = 0x40 - TCP_CA_NAME_MAX = 0x10 - TCP_CONGESTION = 0x40 - TCP_INFO = 0x20 - TCP_MAXBURST = 0x4 - TCP_MAXHLEN = 0x3c - TCP_MAXOLEN = 0x28 - TCP_MAXSEG = 0x2 - TCP_MAXWIN = 0xffff - TCP_MAX_SACK = 0x4 - TCP_MAX_WINSHIFT = 0xe - TCP_MD5SIG = 0x10 - TCP_MINMSS = 0xd8 - TCP_MSS = 0x200 - TCP_NODELAY = 0x1 - TCP_NOOPT = 0x8 - TCP_NOPUSH = 0x4 - WCONTINUED = 0x4 - WCOREFLAG = 0x80 - WLINUXCLONE = 0x80000000 - WNOHANG = 0x1 - WNOWAIT = 0x8 - WSTOPPED = 0x2 - WUNTRACED = 0x2 + AF_APPLETALK = 0x10 + AF_ARP = 0x23 + AF_ATM = 0x1e + AF_BLUETOOTH = 0x24 + AF_CCITT = 0xa + AF_CHAOS = 0x5 + AF_CNT = 0x15 + AF_COIP = 0x14 + AF_DATAKIT = 0x9 + AF_DECnet = 0xc + AF_DLI = 0xd + AF_E164 = 0x1a + AF_ECMA = 0x8 + AF_HYLINK = 0xf + AF_IEEE80211 = 0x25 + AF_IMPLINK = 0x3 + AF_INET = 0x2 + AF_INET6 = 0x1c + AF_IPX = 0x17 + AF_ISDN = 0x1a + AF_ISO = 0x7 + AF_LAT = 0xe + AF_LINK = 0x12 + AF_LOCAL = 0x1 + AF_MAX = 0x26 + AF_NATM = 0x1d + AF_NETBIOS = 0x6 + AF_NETGRAPH = 0x20 + AF_OSI = 0x7 + AF_PUP = 0x4 + AF_ROUTE = 0x11 + AF_SCLUSTER = 0x22 + AF_SIP = 0x18 + AF_SLOW = 0x21 + AF_SNA = 0xb + AF_UNIX = 0x1 + AF_UNSPEC = 0 + AF_VENDOR00 = 0x27 + AF_VENDOR01 = 0x29 + AF_VENDOR02 = 0x2b + AF_VENDOR03 = 0x2d + AF_VENDOR04 = 0x2f + AF_VENDOR05 = 0x31 + AF_VENDOR06 = 0x33 + AF_VENDOR07 = 0x35 + AF_VENDOR08 = 0x37 + AF_VENDOR09 = 0x39 + AF_VENDOR10 = 0x3b + AF_VENDOR11 = 0x3d + AF_VENDOR12 = 0x3f + AF_VENDOR13 = 0x41 + AF_VENDOR14 = 0x43 + AF_VENDOR15 = 0x45 + AF_VENDOR16 = 0x47 + AF_VENDOR17 = 0x49 + AF_VENDOR18 = 0x4b + AF_VENDOR19 = 0x4d + AF_VENDOR20 = 0x4f + AF_VENDOR21 = 0x51 + AF_VENDOR22 = 0x53 + AF_VENDOR23 = 0x55 + AF_VENDOR24 = 0x57 + AF_VENDOR25 = 0x59 + AF_VENDOR26 = 0x5b + AF_VENDOR27 = 0x5d + AF_VENDOR28 = 0x5f + AF_VENDOR29 = 0x61 + AF_VENDOR30 = 0x63 + AF_VENDOR31 = 0x65 + AF_VENDOR32 = 0x67 + AF_VENDOR33 = 0x69 + AF_VENDOR34 = 0x6b + AF_VENDOR35 = 0x6d + AF_VENDOR36 = 0x6f + AF_VENDOR37 = 0x71 + AF_VENDOR38 = 0x73 + AF_VENDOR39 = 0x75 + AF_VENDOR40 = 0x77 + AF_VENDOR41 = 0x79 + AF_VENDOR42 = 0x7b + AF_VENDOR43 = 0x7d + AF_VENDOR44 = 0x7f + AF_VENDOR45 = 0x81 + AF_VENDOR46 = 0x83 + AF_VENDOR47 = 0x85 + BIOCFEEDBACK = 0x8004427c + BIOCFLUSH = 0x20004268 + BIOCGBLEN = 0x40044266 + BIOCGDIRECTION = 0x40044276 + BIOCGDLT = 0x4004426a + BIOCGDLTLIST = 0xc0084279 + BIOCGETBUFMODE = 0x4004427d + BIOCGETIF = 0x4020426b + BIOCGETZMAX = 0x4004427f + BIOCGHDRCMPLT = 0x40044274 + BIOCGRSIG = 0x40044272 + BIOCGRTIMEOUT = 0x4008426e + BIOCGSEESENT = 0x40044276 + BIOCGSTATS = 0x4008426f + BIOCIMMEDIATE = 0x80044270 + BIOCLOCK = 0x2000427a + BIOCPROMISC = 0x20004269 + BIOCROTZBUF = 0x400c4280 + BIOCSBLEN = 0xc0044266 + BIOCSDIRECTION = 0x80044277 + BIOCSDLT = 0x80044278 + BIOCSETBUFMODE = 0x8004427e + BIOCSETF = 0x80084267 + BIOCSETFNR = 0x80084282 + BIOCSETIF = 0x8020426c + BIOCSETWF = 0x8008427b + BIOCSETZBUF = 0x800c4281 + BIOCSHDRCMPLT = 0x80044275 + BIOCSRSIG = 0x80044273 + BIOCSRTIMEOUT = 0x8008426d + BIOCSSEESENT = 0x80044277 + BIOCVERSION = 0x40044271 + BPF_A = 0x10 + BPF_ABS = 0x20 + BPF_ADD = 0 + BPF_ALIGNMENT = 0x4 + BPF_ALU = 0x4 + BPF_AND = 0x50 + BPF_B = 0x10 + BPF_BUFMODE_BUFFER = 0x1 + BPF_BUFMODE_ZBUF = 0x2 + BPF_DIV = 0x30 + BPF_H = 0x8 + BPF_IMM = 0 + BPF_IND = 0x40 + BPF_JA = 0 + BPF_JEQ = 0x10 + BPF_JGE = 0x30 + BPF_JGT = 0x20 + BPF_JMP = 0x5 + BPF_JSET = 0x40 + BPF_K = 0 + BPF_LD = 0 + BPF_LDX = 0x1 + BPF_LEN = 0x80 + BPF_LSH = 0x60 + BPF_MAJOR_VERSION = 0x1 + BPF_MAXBUFSIZE = 0x80000 + BPF_MAXINSNS = 0x200 + BPF_MEM = 0x60 + BPF_MEMWORDS = 0x10 + BPF_MINBUFSIZE = 0x20 + BPF_MINOR_VERSION = 0x1 + BPF_MISC = 0x7 + BPF_MSH = 0xa0 + BPF_MUL = 0x20 + BPF_NEG = 0x80 + BPF_OR = 0x40 + BPF_RELEASE = 0x30bb6 + BPF_RET = 0x6 + BPF_RSH = 0x70 + BPF_ST = 0x2 + BPF_STX = 0x3 + BPF_SUB = 0x10 + BPF_TAX = 0 + BPF_TXA = 0x80 + BPF_W = 0 + BPF_X = 0x8 + CTL_MAXNAME = 0x18 + CTL_NET = 0x4 + DLT_A429 = 0xb8 + DLT_A653_ICM = 0xb9 + DLT_AIRONET_HEADER = 0x78 + DLT_APPLE_IP_OVER_IEEE1394 = 0x8a + DLT_ARCNET = 0x7 + DLT_ARCNET_LINUX = 0x81 + DLT_ATM_CLIP = 0x13 + DLT_ATM_RFC1483 = 0xb + DLT_AURORA = 0x7e + DLT_AX25 = 0x3 + DLT_AX25_KISS = 0xca + DLT_BACNET_MS_TP = 0xa5 + DLT_BLUETOOTH_HCI_H4 = 0xbb + DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 + DLT_CAN20B = 0xbe + DLT_CHAOS = 0x5 + DLT_CHDLC = 0x68 + DLT_CISCO_IOS = 0x76 + DLT_C_HDLC = 0x68 + DLT_C_HDLC_WITH_DIR = 0xcd + DLT_DOCSIS = 0x8f + DLT_ECONET = 0x73 + DLT_EN10MB = 0x1 + DLT_EN3MB = 0x2 + DLT_ENC = 0x6d + DLT_ERF = 0xc5 + DLT_ERF_ETH = 0xaf + DLT_ERF_POS = 0xb0 + DLT_FDDI = 0xa + DLT_FLEXRAY = 0xd2 + DLT_FRELAY = 0x6b + DLT_FRELAY_WITH_DIR = 0xce + DLT_GCOM_SERIAL = 0xad + DLT_GCOM_T1E1 = 0xac + DLT_GPF_F = 0xab + DLT_GPF_T = 0xaa + DLT_GPRS_LLC = 0xa9 + DLT_HHDLC = 0x79 + DLT_IBM_SN = 0x92 + DLT_IBM_SP = 0x91 + DLT_IEEE802 = 0x6 + DLT_IEEE802_11 = 0x69 + DLT_IEEE802_11_RADIO = 0x7f + DLT_IEEE802_11_RADIO_AVS = 0xa3 + DLT_IEEE802_15_4 = 0xc3 + DLT_IEEE802_15_4_LINUX = 0xbf + DLT_IEEE802_15_4_NONASK_PHY = 0xd7 + DLT_IEEE802_16_MAC_CPS = 0xbc + DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 + DLT_IPFILTER = 0x74 + DLT_IPMB = 0xc7 + DLT_IPMB_LINUX = 0xd1 + DLT_IP_OVER_FC = 0x7a + DLT_JUNIPER_ATM1 = 0x89 + DLT_JUNIPER_ATM2 = 0x87 + DLT_JUNIPER_CHDLC = 0xb5 + DLT_JUNIPER_ES = 0x84 + DLT_JUNIPER_ETHER = 0xb2 + DLT_JUNIPER_FRELAY = 0xb4 + DLT_JUNIPER_GGSN = 0x85 + DLT_JUNIPER_ISM = 0xc2 + DLT_JUNIPER_MFR = 0x86 + DLT_JUNIPER_MLFR = 0x83 + DLT_JUNIPER_MLPPP = 0x82 + DLT_JUNIPER_MONITOR = 0xa4 + DLT_JUNIPER_PIC_PEER = 0xae + DLT_JUNIPER_PPP = 0xb3 + DLT_JUNIPER_PPPOE = 0xa7 + DLT_JUNIPER_PPPOE_ATM = 0xa8 + DLT_JUNIPER_SERVICES = 0x88 + DLT_JUNIPER_ST = 0xc8 + DLT_JUNIPER_VP = 0xb7 + DLT_LAPB_WITH_DIR = 0xcf + DLT_LAPD = 0xcb + DLT_LIN = 0xd4 + DLT_LINUX_IRDA = 0x90 + DLT_LINUX_LAPD = 0xb1 + DLT_LINUX_PPP_WITHDIRECTION = 0xa6 + DLT_LINUX_SLL = 0x71 + DLT_LOOP = 0x6c + DLT_LTALK = 0x72 + DLT_MFR = 0xb6 + DLT_MOST = 0xd3 + DLT_MTP2 = 0x8c + DLT_MTP2_WITH_PHDR = 0x8b + DLT_MTP3 = 0x8d + DLT_NULL = 0 + DLT_PCI_EXP = 0x7d + DLT_PFLOG = 0x75 + DLT_PFSYNC = 0x79 + DLT_PPI = 0xc0 + DLT_PPP = 0x9 + DLT_PPP_BSDOS = 0x10 + DLT_PPP_ETHER = 0x33 + DLT_PPP_PPPD = 0xa6 + DLT_PPP_SERIAL = 0x32 + DLT_PPP_WITH_DIR = 0xcc + DLT_PPP_WITH_DIRECTION = 0xa6 + DLT_PRISM_HEADER = 0x77 + DLT_PRONET = 0x4 + DLT_RAIF1 = 0xc6 + DLT_RAW = 0xc + DLT_RIO = 0x7c + DLT_SCCP = 0x8e + DLT_SITA = 0xc4 + DLT_SLIP = 0x8 + DLT_SLIP_BSDOS = 0xf + DLT_SUNATM = 0x7b + DLT_SYMANTEC_FIREWALL = 0x63 + DLT_TZSP = 0x80 + DLT_USB = 0xba + DLT_USB_LINUX = 0xbd + DLT_USER0 = 0x93 + DLT_USER1 = 0x94 + DLT_USER10 = 0x9d + DLT_USER11 = 0x9e + DLT_USER12 = 0x9f + DLT_USER13 = 0xa0 + DLT_USER14 = 0xa1 + DLT_USER15 = 0xa2 + DLT_USER2 = 0x95 + DLT_USER3 = 0x96 + DLT_USER4 = 0x97 + DLT_USER5 = 0x98 + DLT_USER6 = 0x99 + DLT_USER7 = 0x9a + DLT_USER8 = 0x9b + DLT_USER9 = 0x9c + DLT_X2E_SERIAL = 0xd5 + DLT_X2E_XORAYA = 0xd6 + E2BIG = 0x7 + EACCES = 0xd + EADDRINUSE = 0x30 + EADDRNOTAVAIL = 0x31 + EAFNOSUPPORT = 0x2f + EAGAIN = 0x23 + EALREADY = 0x25 + EAUTH = 0x50 + EBADF = 0x9 + EBADMSG = 0x59 + EBADRPC = 0x48 + EBUSY = 0x10 + ECANCELED = 0x55 + ECHILD = 0xa + ECONNABORTED = 0x35 + ECONNREFUSED = 0x3d + ECONNRESET = 0x36 + EDEADLK = 0xb + EDESTADDRREQ = 0x27 + EDOM = 0x21 + EDOOFUS = 0x58 + EDQUOT = 0x45 + EEXIST = 0x11 + EFAULT = 0xe + EFBIG = 0x1b + EFTYPE = 0x4f + EHOSTDOWN = 0x40 + EHOSTUNREACH = 0x41 + EIDRM = 0x52 + EILSEQ = 0x56 + EINPROGRESS = 0x24 + EINTR = 0x4 + EINVAL = 0x16 + EIO = 0x5 + EISCONN = 0x38 + EISDIR = 0x15 + ELAST = 0x5d + ELOOP = 0x3e + EMFILE = 0x18 + EMLINK = 0x1f + EMSGSIZE = 0x28 + EMULTIHOP = 0x5a + ENAMETOOLONG = 0x3f + ENEEDAUTH = 0x51 + ENETDOWN = 0x32 + ENETRESET = 0x34 + ENETUNREACH = 0x33 + ENFILE = 0x17 + ENOATTR = 0x57 + ENOBUFS = 0x37 + ENODEV = 0x13 + ENOENT = 0x2 + ENOEXEC = 0x8 + ENOLCK = 0x4d + ENOLINK = 0x5b + ENOMEM = 0xc + ENOMSG = 0x53 + ENOPROTOOPT = 0x2a + ENOSPC = 0x1c + ENOSYS = 0x4e + ENOTBLK = 0xf + ENOTCAPABLE = 0x5d + ENOTCONN = 0x39 + ENOTDIR = 0x14 + ENOTEMPTY = 0x42 + ENOTSOCK = 0x26 + ENOTSUP = 0x2d + ENOTTY = 0x19 + ENXIO = 0x6 + EOPNOTSUPP = 0x2d + EOVERFLOW = 0x54 + EPERM = 0x1 + EPFNOSUPPORT = 0x2e + EPIPE = 0x20 + EPROCLIM = 0x43 + EPROCUNAVAIL = 0x4c + EPROGMISMATCH = 0x4b + EPROGUNAVAIL = 0x4a + EPROTO = 0x5c + EPROTONOSUPPORT = 0x2b + EPROTOTYPE = 0x29 + ERANGE = 0x22 + EREMOTE = 0x47 + EROFS = 0x1e + ERPCMISMATCH = 0x49 + ESHUTDOWN = 0x3a + ESOCKTNOSUPPORT = 0x2c + ESPIPE = 0x1d + ESRCH = 0x3 + ESTALE = 0x46 + ETIMEDOUT = 0x3c + ETOOMANYREFS = 0x3b + ETXTBSY = 0x1a + EUSERS = 0x44 + EVFILT_AIO = -0x3 + EVFILT_FS = -0x9 + EVFILT_LIO = -0xa + EVFILT_PROC = -0x5 + EVFILT_READ = -0x1 + EVFILT_SIGNAL = -0x6 + EVFILT_SYSCOUNT = 0xb + EVFILT_TIMER = -0x7 + EVFILT_USER = -0xb + EVFILT_VNODE = -0x4 + EVFILT_WRITE = -0x2 + EV_ADD = 0x1 + EV_CLEAR = 0x20 + EV_DELETE = 0x2 + EV_DISABLE = 0x8 + EV_DISPATCH = 0x80 + EV_ENABLE = 0x4 + EV_EOF = 0x8000 + EV_ERROR = 0x4000 + EV_FLAG1 = 0x2000 + EV_ONESHOT = 0x10 + EV_RECEIPT = 0x40 + EV_SYSFLAGS = 0xf000 + EWOULDBLOCK = 0x23 + EXDEV = 0x12 + FD_CLOEXEC = 0x1 + FD_SETSIZE = 0x400 + F_CANCEL = 0x5 + F_DUP2FD = 0xa + F_DUPFD = 0 + F_GETFD = 0x1 + F_GETFL = 0x3 + F_GETLK = 0xb + F_GETOWN = 0x5 + F_OGETLK = 0x7 + F_OSETLK = 0x8 + F_OSETLKW = 0x9 + F_RDAHEAD = 0x10 + F_RDLCK = 0x1 + F_READAHEAD = 0xf + F_SETFD = 0x2 + F_SETFL = 0x4 + F_SETLK = 0xc + F_SETLKW = 0xd + F_SETLK_REMOTE = 0xe + F_SETOWN = 0x6 + F_UNLCK = 0x2 + F_UNLCKSYS = 0x4 + F_WRLCK = 0x3 + IFF_ALLMULTI = 0x200 + IFF_ALTPHYS = 0x4000 + IFF_BROADCAST = 0x2 + IFF_CANTCHANGE = 0x208f72 + IFF_DEBUG = 0x4 + IFF_DRV_OACTIVE = 0x400 + IFF_DRV_RUNNING = 0x40 + IFF_DYING = 0x200000 + IFF_LINK0 = 0x1000 + IFF_LINK1 = 0x2000 + IFF_LINK2 = 0x4000 + IFF_LOOPBACK = 0x8 + IFF_MONITOR = 0x40000 + IFF_MULTICAST = 0x8000 + IFF_NOARP = 0x80 + IFF_OACTIVE = 0x400 + IFF_POINTOPOINT = 0x10 + IFF_PPROMISC = 0x20000 + IFF_PROMISC = 0x100 + IFF_RENAMING = 0x400000 + IFF_RUNNING = 0x40 + IFF_SIMPLEX = 0x800 + IFF_SMART = 0x20 + IFF_STATICARP = 0x80000 + IFF_UP = 0x1 + IFNAMSIZ = 0x10 + IN_CLASSA_HOST = 0xffffff + IN_CLASSA_MAX = 0x80 + IN_CLASSA_NET = 0xff000000 + IN_CLASSA_NSHIFT = 0x18 + IN_CLASSB_HOST = 0xffff + IN_CLASSB_MAX = 0x10000 + IN_CLASSB_NET = 0xffff0000 + IN_CLASSB_NSHIFT = 0x10 + IN_CLASSC_HOST = 0xff + IN_CLASSC_NET = 0xffffff00 + IN_CLASSC_NSHIFT = 0x8 + IN_CLASSD_HOST = 0xfffffff + IN_CLASSD_NET = 0xf0000000 + IN_CLASSD_NSHIFT = 0x1c + IN_LOOPBACKNET = 0x7f + IPPROTO_3PC = 0x22 + IPPROTO_ADFS = 0x44 + IPPROTO_AH = 0x33 + IPPROTO_AHIP = 0x3d + IPPROTO_APES = 0x63 + IPPROTO_ARGUS = 0xd + IPPROTO_AX25 = 0x5d + IPPROTO_BHA = 0x31 + IPPROTO_BLT = 0x1e + IPPROTO_BRSATMON = 0x4c + IPPROTO_CARP = 0x70 + IPPROTO_CFTP = 0x3e + IPPROTO_CHAOS = 0x10 + IPPROTO_CMTP = 0x26 + IPPROTO_CPHB = 0x49 + IPPROTO_CPNX = 0x48 + IPPROTO_DDP = 0x25 + IPPROTO_DGP = 0x56 + IPPROTO_DIVERT = 0x102 + IPPROTO_DONE = 0x101 + IPPROTO_DSTOPTS = 0x3c + IPPROTO_EGP = 0x8 + IPPROTO_EMCON = 0xe + IPPROTO_ENCAP = 0x62 + IPPROTO_EON = 0x50 + IPPROTO_ESP = 0x32 + IPPROTO_ETHERIP = 0x61 + IPPROTO_FRAGMENT = 0x2c + IPPROTO_GGP = 0x3 + IPPROTO_GMTP = 0x64 + IPPROTO_GRE = 0x2f + IPPROTO_HELLO = 0x3f + IPPROTO_HMP = 0x14 + IPPROTO_HOPOPTS = 0 + IPPROTO_ICMP = 0x1 + IPPROTO_ICMPV6 = 0x3a + IPPROTO_IDP = 0x16 + IPPROTO_IDPR = 0x23 + IPPROTO_IDRP = 0x2d + IPPROTO_IGMP = 0x2 + IPPROTO_IGP = 0x55 + IPPROTO_IGRP = 0x58 + IPPROTO_IL = 0x28 + IPPROTO_INLSP = 0x34 + IPPROTO_INP = 0x20 + IPPROTO_IP = 0 + IPPROTO_IPCOMP = 0x6c + IPPROTO_IPCV = 0x47 + IPPROTO_IPEIP = 0x5e + IPPROTO_IPIP = 0x4 + IPPROTO_IPPC = 0x43 + IPPROTO_IPV4 = 0x4 + IPPROTO_IPV6 = 0x29 + IPPROTO_IRTP = 0x1c + IPPROTO_KRYPTOLAN = 0x41 + IPPROTO_LARP = 0x5b + IPPROTO_LEAF1 = 0x19 + IPPROTO_LEAF2 = 0x1a + IPPROTO_MAX = 0x100 + IPPROTO_MAXID = 0x34 + IPPROTO_MEAS = 0x13 + IPPROTO_MHRP = 0x30 + IPPROTO_MICP = 0x5f + IPPROTO_MOBILE = 0x37 + IPPROTO_MTP = 0x5c + IPPROTO_MUX = 0x12 + IPPROTO_ND = 0x4d + IPPROTO_NHRP = 0x36 + IPPROTO_NONE = 0x3b + IPPROTO_NSP = 0x1f + IPPROTO_NVPII = 0xb + IPPROTO_OLD_DIVERT = 0xfe + IPPROTO_OSPFIGP = 0x59 + IPPROTO_PFSYNC = 0xf0 + IPPROTO_PGM = 0x71 + IPPROTO_PIGP = 0x9 + IPPROTO_PIM = 0x67 + IPPROTO_PRM = 0x15 + IPPROTO_PUP = 0xc + IPPROTO_PVP = 0x4b + IPPROTO_RAW = 0xff + IPPROTO_RCCMON = 0xa + IPPROTO_RDP = 0x1b + IPPROTO_ROUTING = 0x2b + IPPROTO_RSVP = 0x2e + IPPROTO_RVD = 0x42 + IPPROTO_SATEXPAK = 0x40 + IPPROTO_SATMON = 0x45 + IPPROTO_SCCSP = 0x60 + IPPROTO_SCTP = 0x84 + IPPROTO_SDRP = 0x2a + IPPROTO_SEP = 0x21 + IPPROTO_SKIP = 0x39 + IPPROTO_SPACER = 0x7fff + IPPROTO_SRPC = 0x5a + IPPROTO_ST = 0x7 + IPPROTO_SVMTP = 0x52 + IPPROTO_SWIPE = 0x35 + IPPROTO_TCF = 0x57 + IPPROTO_TCP = 0x6 + IPPROTO_TLSP = 0x38 + IPPROTO_TP = 0x1d + IPPROTO_TPXX = 0x27 + IPPROTO_TRUNK1 = 0x17 + IPPROTO_TRUNK2 = 0x18 + IPPROTO_TTP = 0x54 + IPPROTO_UDP = 0x11 + IPPROTO_VINES = 0x53 + IPPROTO_VISA = 0x46 + IPPROTO_VMTP = 0x51 + IPPROTO_WBEXPAK = 0x4f + IPPROTO_WBMON = 0x4e + IPPROTO_WSN = 0x4a + IPPROTO_XNET = 0xf + IPPROTO_XTP = 0x24 + IPV6_AUTOFLOWLABEL = 0x3b + IPV6_BINDANY = 0x40 + IPV6_BINDV6ONLY = 0x1b + IPV6_CHECKSUM = 0x1a + IPV6_DEFAULT_MULTICAST_HOPS = 0x1 + IPV6_DEFAULT_MULTICAST_LOOP = 0x1 + IPV6_DEFHLIM = 0x40 + IPV6_DONTFRAG = 0x3e + IPV6_DSTOPTS = 0x32 + IPV6_FAITH = 0x1d + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 + IPV6_FRAGTTL = 0x78 + IPV6_FW_ADD = 0x1e + IPV6_FW_DEL = 0x1f + IPV6_FW_FLUSH = 0x20 + IPV6_FW_GET = 0x22 + IPV6_FW_ZERO = 0x21 + IPV6_HLIMDEC = 0x1 + IPV6_HOPLIMIT = 0x2f + IPV6_HOPOPTS = 0x31 + IPV6_IPSEC_POLICY = 0x1c + IPV6_JOIN_GROUP = 0xc + IPV6_LEAVE_GROUP = 0xd + IPV6_MAXHLIM = 0xff + IPV6_MAXOPTHDR = 0x800 + IPV6_MAXPACKET = 0xffff + IPV6_MAX_GROUP_SRC_FILTER = 0x200 + IPV6_MAX_MEMBERSHIPS = 0xfff + IPV6_MAX_SOCK_SRC_FILTER = 0x80 + IPV6_MIN_MEMBERSHIPS = 0x1f + IPV6_MMTU = 0x500 + IPV6_MSFILTER = 0x4a + IPV6_MULTICAST_HOPS = 0xa + IPV6_MULTICAST_IF = 0x9 + IPV6_MULTICAST_LOOP = 0xb + IPV6_NEXTHOP = 0x30 + IPV6_PATHMTU = 0x2c + IPV6_PKTINFO = 0x2e + IPV6_PORTRANGE = 0xe + IPV6_PORTRANGE_DEFAULT = 0 + IPV6_PORTRANGE_HIGH = 0x1 + IPV6_PORTRANGE_LOW = 0x2 + IPV6_PREFER_TEMPADDR = 0x3f + IPV6_RECVDSTOPTS = 0x28 + IPV6_RECVHOPLIMIT = 0x25 + IPV6_RECVHOPOPTS = 0x27 + IPV6_RECVPATHMTU = 0x2b + IPV6_RECVPKTINFO = 0x24 + IPV6_RECVRTHDR = 0x26 + IPV6_RECVTCLASS = 0x39 + IPV6_RTHDR = 0x33 + IPV6_RTHDRDSTOPTS = 0x23 + IPV6_RTHDR_LOOSE = 0 + IPV6_RTHDR_STRICT = 0x1 + IPV6_RTHDR_TYPE_0 = 0 + IPV6_SOCKOPT_RESERVED1 = 0x3 + IPV6_TCLASS = 0x3d + IPV6_UNICAST_HOPS = 0x4 + IPV6_USE_MIN_MTU = 0x2a + IPV6_V6ONLY = 0x1b + IPV6_VERSION = 0x60 + IPV6_VERSION_MASK = 0xf0 + IP_ADD_MEMBERSHIP = 0xc + IP_ADD_SOURCE_MEMBERSHIP = 0x46 + IP_BINDANY = 0x18 + IP_BLOCK_SOURCE = 0x48 + IP_DEFAULT_MULTICAST_LOOP = 0x1 + IP_DEFAULT_MULTICAST_TTL = 0x1 + IP_DF = 0x4000 + IP_DONTFRAG = 0x43 + IP_DROP_MEMBERSHIP = 0xd + IP_DROP_SOURCE_MEMBERSHIP = 0x47 + IP_DUMMYNET3 = 0x31 + IP_DUMMYNET_CONFIGURE = 0x3c + IP_DUMMYNET_DEL = 0x3d + IP_DUMMYNET_FLUSH = 0x3e + IP_DUMMYNET_GET = 0x40 + IP_FAITH = 0x16 + IP_FW3 = 0x30 + IP_FW_ADD = 0x32 + IP_FW_DEL = 0x33 + IP_FW_FLUSH = 0x34 + IP_FW_GET = 0x36 + IP_FW_NAT_CFG = 0x38 + IP_FW_NAT_DEL = 0x39 + IP_FW_NAT_GET_CONFIG = 0x3a + IP_FW_NAT_GET_LOG = 0x3b + IP_FW_RESETLOG = 0x37 + IP_FW_TABLE_ADD = 0x28 + IP_FW_TABLE_DEL = 0x29 + IP_FW_TABLE_FLUSH = 0x2a + IP_FW_TABLE_GETSIZE = 0x2b + IP_FW_TABLE_LIST = 0x2c + IP_FW_ZERO = 0x35 + IP_HDRINCL = 0x2 + IP_IPSEC_POLICY = 0x15 + IP_MAXPACKET = 0xffff + IP_MAX_GROUP_SRC_FILTER = 0x200 + IP_MAX_MEMBERSHIPS = 0xfff + IP_MAX_SOCK_MUTE_FILTER = 0x80 + IP_MAX_SOCK_SRC_FILTER = 0x80 + IP_MAX_SOURCE_FILTER = 0x400 + IP_MF = 0x2000 + IP_MINTTL = 0x42 + IP_MIN_MEMBERSHIPS = 0x1f + IP_MSFILTER = 0x4a + IP_MSS = 0x240 + IP_MULTICAST_IF = 0x9 + IP_MULTICAST_LOOP = 0xb + IP_MULTICAST_TTL = 0xa + IP_MULTICAST_VIF = 0xe + IP_OFFMASK = 0x1fff + IP_ONESBCAST = 0x17 + IP_OPTIONS = 0x1 + IP_PORTRANGE = 0x13 + IP_PORTRANGE_DEFAULT = 0 + IP_PORTRANGE_HIGH = 0x1 + IP_PORTRANGE_LOW = 0x2 + IP_RECVDSTADDR = 0x7 + IP_RECVIF = 0x14 + IP_RECVOPTS = 0x5 + IP_RECVRETOPTS = 0x6 + IP_RECVTTL = 0x41 + IP_RETOPTS = 0x8 + IP_RF = 0x8000 + IP_RSVP_OFF = 0x10 + IP_RSVP_ON = 0xf + IP_RSVP_VIF_OFF = 0x12 + IP_RSVP_VIF_ON = 0x11 + IP_SENDSRCADDR = 0x7 + IP_TOS = 0x3 + IP_TTL = 0x4 + IP_UNBLOCK_SOURCE = 0x49 + MSG_COMPAT = 0x8000 + MSG_CTRUNC = 0x20 + MSG_DONTROUTE = 0x4 + MSG_DONTWAIT = 0x80 + MSG_EOF = 0x100 + MSG_EOR = 0x8 + MSG_NBIO = 0x4000 + MSG_NOSIGNAL = 0x20000 + MSG_NOTIFICATION = 0x2000 + MSG_OOB = 0x1 + MSG_PEEK = 0x2 + MSG_TRUNC = 0x10 + MSG_WAITALL = 0x40 + NET_RT_DUMP = 0x1 + NET_RT_FLAGS = 0x2 + NET_RT_IFLIST = 0x3 + NET_RT_IFMALIST = 0x4 + NET_RT_MAXID = 0x5 + O_ACCMODE = 0x3 + O_APPEND = 0x8 + O_ASYNC = 0x40 + O_CREAT = 0x200 + O_DIRECT = 0x10000 + O_DIRECTORY = 0x20000 + O_EXCL = 0x800 + O_EXEC = 0x40000 + O_EXLOCK = 0x20 + O_FSYNC = 0x80 + O_NDELAY = 0x4 + O_NOCTTY = 0x8000 + O_NOFOLLOW = 0x100 + O_NONBLOCK = 0x4 + O_RDONLY = 0 + O_RDWR = 0x2 + O_SHLOCK = 0x10 + O_SYNC = 0x80 + O_TRUNC = 0x400 + O_TTY_INIT = 0x80000 + O_WRONLY = 0x1 + RTAX_AUTHOR = 0x6 + RTAX_BRD = 0x7 + RTAX_DST = 0 + RTAX_GATEWAY = 0x1 + RTAX_GENMASK = 0x3 + RTAX_IFA = 0x5 + RTAX_IFP = 0x4 + RTAX_MAX = 0x8 + RTAX_NETMASK = 0x2 + RTA_AUTHOR = 0x40 + RTA_BRD = 0x80 + RTA_DST = 0x1 + RTA_GATEWAY = 0x2 + RTA_GENMASK = 0x8 + RTA_IFA = 0x20 + RTA_IFP = 0x10 + RTA_NETMASK = 0x4 + RTF_BLACKHOLE = 0x1000 + RTF_BROADCAST = 0x400000 + RTF_DONE = 0x40 + RTF_DYNAMIC = 0x10 + RTF_FMASK = 0x1004d808 + RTF_GATEWAY = 0x2 + RTF_HOST = 0x4 + RTF_LLDATA = 0x400 + RTF_LLINFO = 0x400 + RTF_LOCAL = 0x200000 + RTF_MODIFIED = 0x20 + RTF_MULTICAST = 0x800000 + RTF_PINNED = 0x100000 + RTF_PRCLONING = 0x10000 + RTF_PROTO1 = 0x8000 + RTF_PROTO2 = 0x4000 + RTF_PROTO3 = 0x40000 + RTF_REJECT = 0x8 + RTF_RNH_LOCKED = 0x40000000 + RTF_STATIC = 0x800 + RTF_STICKY = 0x10000000 + RTF_UP = 0x1 + RTF_XRESOLVE = 0x200 + RTM_ADD = 0x1 + RTM_CHANGE = 0x3 + RTM_DELADDR = 0xd + RTM_DELETE = 0x2 + RTM_DELMADDR = 0x10 + RTM_GET = 0x4 + RTM_IEEE80211 = 0x12 + RTM_IFANNOUNCE = 0x11 + RTM_IFINFO = 0xe + RTM_LOCK = 0x8 + RTM_LOSING = 0x5 + RTM_MISS = 0x7 + RTM_NEWADDR = 0xc + RTM_NEWMADDR = 0xf + RTM_OLDADD = 0x9 + RTM_OLDDEL = 0xa + RTM_REDIRECT = 0x6 + RTM_RESOLVE = 0xb + RTM_RTTUNIT = 0xf4240 + RTM_VERSION = 0x5 + RTV_EXPIRE = 0x4 + RTV_HOPCOUNT = 0x2 + RTV_MTU = 0x1 + RTV_RPIPE = 0x8 + RTV_RTT = 0x40 + RTV_RTTVAR = 0x80 + RTV_SPIPE = 0x10 + RTV_SSTHRESH = 0x20 + RTV_WEIGHT = 0x100 + SCM_BINTIME = 0x4 + SCM_CREDS = 0x3 + SCM_RIGHTS = 0x1 + SCM_TIMESTAMP = 0x2 + SHUT_RD = 0 + SHUT_RDWR = 0x2 + SHUT_WR = 0x1 + SIGABRT = 0x6 + SIGALRM = 0xe + SIGBUS = 0xa + SIGCHLD = 0x14 + SIGCONT = 0x13 + SIGEMT = 0x7 + SIGFPE = 0x8 + SIGHUP = 0x1 + SIGILL = 0x4 + SIGINFO = 0x1d + SIGINT = 0x2 + SIGIO = 0x17 + SIGIOT = 0x6 + SIGKILL = 0x9 + SIGLWP = 0x20 + SIGPIPE = 0xd + SIGPROF = 0x1b + SIGQUIT = 0x3 + SIGSEGV = 0xb + SIGSTOP = 0x11 + SIGSYS = 0xc + SIGTERM = 0xf + SIGTHR = 0x20 + SIGTRAP = 0x5 + SIGTSTP = 0x12 + SIGTTIN = 0x15 + SIGTTOU = 0x16 + SIGURG = 0x10 + SIGUSR1 = 0x1e + SIGUSR2 = 0x1f + SIGVTALRM = 0x1a + SIGWINCH = 0x1c + SIGXCPU = 0x18 + SIGXFSZ = 0x19 + SIOCADDMULTI = 0x80206931 + SIOCADDRT = 0x8030720a + SIOCAIFADDR = 0x8040691a + SIOCAIFGROUP = 0x80246987 + SIOCALIFADDR = 0x8118691b + SIOCATMARK = 0x40047307 + SIOCDELMULTI = 0x80206932 + SIOCDELRT = 0x8030720b + SIOCDIFADDR = 0x80206919 + SIOCDIFGROUP = 0x80246989 + SIOCDIFPHYADDR = 0x80206949 + SIOCDLIFADDR = 0x8118691d + SIOCGDRVSPEC = 0xc01c697b + SIOCGETSGCNT = 0xc0147210 + SIOCGETVIFCNT = 0xc014720f + SIOCGHIWAT = 0x40047301 + SIOCGIFADDR = 0xc0206921 + SIOCGIFBRDADDR = 0xc0206923 + SIOCGIFCAP = 0xc020691f + SIOCGIFCONF = 0xc0086924 + SIOCGIFDESCR = 0xc020692a + SIOCGIFDSTADDR = 0xc0206922 + SIOCGIFFLAGS = 0xc0206911 + SIOCGIFGENERIC = 0xc020693a + SIOCGIFGMEMB = 0xc024698a + SIOCGIFGROUP = 0xc0246988 + SIOCGIFINDEX = 0xc0206920 + SIOCGIFMAC = 0xc0206926 + SIOCGIFMEDIA = 0xc0286938 + SIOCGIFMETRIC = 0xc0206917 + SIOCGIFMTU = 0xc0206933 + SIOCGIFNETMASK = 0xc0206925 + SIOCGIFPDSTADDR = 0xc0206948 + SIOCGIFPHYS = 0xc0206935 + SIOCGIFPSRCADDR = 0xc0206947 + SIOCGIFSTATUS = 0xc331693b + SIOCGLIFADDR = 0xc118691c + SIOCGLIFPHYADDR = 0xc118694b + SIOCGLOWAT = 0x40047303 + SIOCGPGRP = 0x40047309 + SIOCGPRIVATE_0 = 0xc0206950 + SIOCGPRIVATE_1 = 0xc0206951 + SIOCIFCREATE = 0xc020697a + SIOCIFCREATE2 = 0xc020697c + SIOCIFDESTROY = 0x80206979 + SIOCIFGCLONERS = 0xc00c6978 + SIOCSDRVSPEC = 0x801c697b + SIOCSHIWAT = 0x80047300 + SIOCSIFADDR = 0x8020690c + SIOCSIFBRDADDR = 0x80206913 + SIOCSIFCAP = 0x8020691e + SIOCSIFDESCR = 0x80206929 + SIOCSIFDSTADDR = 0x8020690e + SIOCSIFFLAGS = 0x80206910 + SIOCSIFGENERIC = 0x80206939 + SIOCSIFLLADDR = 0x8020693c + SIOCSIFMAC = 0x80206927 + SIOCSIFMEDIA = 0xc0206937 + SIOCSIFMETRIC = 0x80206918 + SIOCSIFMTU = 0x80206934 + SIOCSIFNAME = 0x80206928 + SIOCSIFNETMASK = 0x80206916 + SIOCSIFPHYADDR = 0x80406946 + SIOCSIFPHYS = 0x80206936 + SIOCSIFRVNET = 0xc020695b + SIOCSIFVNET = 0xc020695a + SIOCSLIFPHYADDR = 0x8118694a + SIOCSLOWAT = 0x80047302 + SIOCSPGRP = 0x80047308 + SOCK_DGRAM = 0x2 + SOCK_MAXADDRLEN = 0xff + SOCK_RAW = 0x3 + SOCK_RDM = 0x4 + SOCK_SEQPACKET = 0x5 + SOCK_STREAM = 0x1 + SOL_SOCKET = 0xffff + SOMAXCONN = 0x80 + SO_ACCEPTCONN = 0x2 + SO_ACCEPTFILTER = 0x1000 + SO_BINTIME = 0x2000 + SO_BROADCAST = 0x20 + SO_DEBUG = 0x1 + SO_DONTROUTE = 0x10 + SO_ERROR = 0x1007 + SO_KEEPALIVE = 0x8 + SO_LABEL = 0x1009 + SO_LINGER = 0x80 + SO_LISTENINCQLEN = 0x1013 + SO_LISTENQLEN = 0x1012 + SO_LISTENQLIMIT = 0x1011 + SO_NOSIGPIPE = 0x800 + SO_NO_DDP = 0x8000 + SO_NO_OFFLOAD = 0x4000 + SO_OOBINLINE = 0x100 + SO_PEERLABEL = 0x1010 + SO_RCVBUF = 0x1002 + SO_RCVLOWAT = 0x1004 + SO_RCVTIMEO = 0x1006 + SO_REUSEADDR = 0x4 + SO_REUSEPORT = 0x200 + SO_SETFIB = 0x1014 + SO_SNDBUF = 0x1001 + SO_SNDLOWAT = 0x1003 + SO_SNDTIMEO = 0x1005 + SO_TIMESTAMP = 0x400 + SO_TYPE = 0x1008 + SO_USELOOPBACK = 0x40 + TCP_CA_NAME_MAX = 0x10 + TCP_CONGESTION = 0x40 + TCP_INFO = 0x20 + TCP_MAXBURST = 0x4 + TCP_MAXHLEN = 0x3c + TCP_MAXOLEN = 0x28 + TCP_MAXSEG = 0x2 + TCP_MAXWIN = 0xffff + TCP_MAX_SACK = 0x4 + TCP_MAX_WINSHIFT = 0xe + TCP_MD5SIG = 0x10 + TCP_MINMSS = 0xd8 + TCP_MSS = 0x200 + TCP_NODELAY = 0x1 + TCP_NOOPT = 0x8 + TCP_NOPUSH = 0x4 + WCONTINUED = 0x4 + WCOREFLAG = 0x80 + WLINUXCLONE = 0x80000000 + WNOHANG = 0x1 + WNOWAIT = 0x8 + WSTOPPED = 0x2 + WUNTRACED = 0x2 ) // Types diff --git a/src/pkg/syscall/zerrors_freebsd_amd64.go b/src/pkg/syscall/zerrors_freebsd_amd64.go index 770d293a2..33fd3de1f 100644 --- a/src/pkg/syscall/zerrors_freebsd_amd64.go +++ b/src/pkg/syscall/zerrors_freebsd_amd64.go @@ -9,805 +9,1013 @@ package syscall // Constants const ( - AF_APPLETALK = 0x10 - AF_ARP = 0x23 - AF_ATM = 0x1e - AF_BLUETOOTH = 0x24 - AF_CCITT = 0xa - AF_CHAOS = 0x5 - AF_CNT = 0x15 - AF_COIP = 0x14 - AF_DATAKIT = 0x9 - AF_DECnet = 0xc - AF_DLI = 0xd - AF_E164 = 0x1a - AF_ECMA = 0x8 - AF_HYLINK = 0xf - AF_IEEE80211 = 0x25 - AF_IMPLINK = 0x3 - AF_INET = 0x2 - AF_INET6 = 0x1c - AF_IPX = 0x17 - AF_ISDN = 0x1a - AF_ISO = 0x7 - AF_LAT = 0xe - AF_LINK = 0x12 - AF_LOCAL = 0x1 - AF_MAX = 0x26 - AF_NATM = 0x1d - AF_NETBIOS = 0x6 - AF_NETGRAPH = 0x20 - AF_OSI = 0x7 - AF_PUP = 0x4 - AF_ROUTE = 0x11 - AF_SCLUSTER = 0x22 - AF_SIP = 0x18 - AF_SLOW = 0x21 - AF_SNA = 0xb - AF_UNIX = 0x1 - AF_UNSPEC = 0 - AF_VENDOR00 = 0x27 - AF_VENDOR01 = 0x29 - AF_VENDOR02 = 0x2b - AF_VENDOR03 = 0x2d - AF_VENDOR04 = 0x2f - AF_VENDOR05 = 0x31 - AF_VENDOR06 = 0x33 - AF_VENDOR07 = 0x35 - AF_VENDOR08 = 0x37 - AF_VENDOR09 = 0x39 - AF_VENDOR10 = 0x3b - AF_VENDOR11 = 0x3d - AF_VENDOR12 = 0x3f - AF_VENDOR13 = 0x41 - AF_VENDOR14 = 0x43 - AF_VENDOR15 = 0x45 - AF_VENDOR16 = 0x47 - AF_VENDOR17 = 0x49 - AF_VENDOR18 = 0x4b - AF_VENDOR19 = 0x4d - AF_VENDOR20 = 0x4f - AF_VENDOR21 = 0x51 - AF_VENDOR22 = 0x53 - AF_VENDOR23 = 0x55 - AF_VENDOR24 = 0x57 - AF_VENDOR25 = 0x59 - AF_VENDOR26 = 0x5b - AF_VENDOR27 = 0x5d - AF_VENDOR28 = 0x5f - AF_VENDOR29 = 0x61 - AF_VENDOR30 = 0x63 - AF_VENDOR31 = 0x65 - AF_VENDOR32 = 0x67 - AF_VENDOR33 = 0x69 - AF_VENDOR34 = 0x6b - AF_VENDOR35 = 0x6d - AF_VENDOR36 = 0x6f - AF_VENDOR37 = 0x71 - AF_VENDOR38 = 0x73 - AF_VENDOR39 = 0x75 - AF_VENDOR40 = 0x77 - AF_VENDOR41 = 0x79 - AF_VENDOR42 = 0x7b - AF_VENDOR43 = 0x7d - AF_VENDOR44 = 0x7f - AF_VENDOR45 = 0x81 - AF_VENDOR46 = 0x83 - AF_VENDOR47 = 0x85 - CTL_MAXNAME = 0x18 - CTL_NET = 0x4 - E2BIG = 0x7 - EACCES = 0xd - EADDRINUSE = 0x30 - EADDRNOTAVAIL = 0x31 - EAFNOSUPPORT = 0x2f - EAGAIN = 0x23 - EALREADY = 0x25 - EAUTH = 0x50 - EBADF = 0x9 - EBADMSG = 0x59 - EBADRPC = 0x48 - EBUSY = 0x10 - ECANCELED = 0x55 - ECHILD = 0xa - ECONNABORTED = 0x35 - ECONNREFUSED = 0x3d - ECONNRESET = 0x36 - EDEADLK = 0xb - EDESTADDRREQ = 0x27 - EDOM = 0x21 - EDOOFUS = 0x58 - EDQUOT = 0x45 - EEXIST = 0x11 - EFAULT = 0xe - EFBIG = 0x1b - EFTYPE = 0x4f - EHOSTDOWN = 0x40 - EHOSTUNREACH = 0x41 - EIDRM = 0x52 - EILSEQ = 0x56 - EINPROGRESS = 0x24 - EINTR = 0x4 - EINVAL = 0x16 - EIO = 0x5 - EISCONN = 0x38 - EISDIR = 0x15 - ELAST = 0x5d - ELOOP = 0x3e - EMFILE = 0x18 - EMLINK = 0x1f - EMSGSIZE = 0x28 - EMULTIHOP = 0x5a - ENAMETOOLONG = 0x3f - ENEEDAUTH = 0x51 - ENETDOWN = 0x32 - ENETRESET = 0x34 - ENETUNREACH = 0x33 - ENFILE = 0x17 - ENOATTR = 0x57 - ENOBUFS = 0x37 - ENODEV = 0x13 - ENOENT = 0x2 - ENOEXEC = 0x8 - ENOLCK = 0x4d - ENOLINK = 0x5b - ENOMEM = 0xc - ENOMSG = 0x53 - ENOPROTOOPT = 0x2a - ENOSPC = 0x1c - ENOSYS = 0x4e - ENOTBLK = 0xf - ENOTCAPABLE = 0x5d - ENOTCONN = 0x39 - ENOTDIR = 0x14 - ENOTEMPTY = 0x42 - ENOTSOCK = 0x26 - ENOTSUP = 0x2d - ENOTTY = 0x19 - ENXIO = 0x6 - EOPNOTSUPP = 0x2d - EOVERFLOW = 0x54 - EPERM = 0x1 - EPFNOSUPPORT = 0x2e - EPIPE = 0x20 - EPROCLIM = 0x43 - EPROCUNAVAIL = 0x4c - EPROGMISMATCH = 0x4b - EPROGUNAVAIL = 0x4a - EPROTO = 0x5c - EPROTONOSUPPORT = 0x2b - EPROTOTYPE = 0x29 - ERANGE = 0x22 - EREMOTE = 0x47 - EROFS = 0x1e - ERPCMISMATCH = 0x49 - ESHUTDOWN = 0x3a - ESOCKTNOSUPPORT = 0x2c - ESPIPE = 0x1d - ESRCH = 0x3 - ESTALE = 0x46 - ETIMEDOUT = 0x3c - ETOOMANYREFS = 0x3b - ETXTBSY = 0x1a - EUSERS = 0x44 - EVFILT_AIO = -0x3 - EVFILT_FS = -0x9 - EVFILT_LIO = -0xa - EVFILT_PROC = -0x5 - EVFILT_READ = -0x1 - EVFILT_SIGNAL = -0x6 - EVFILT_SYSCOUNT = 0xb - EVFILT_TIMER = -0x7 - EVFILT_USER = -0xb - EVFILT_VNODE = -0x4 - EVFILT_WRITE = -0x2 - EV_ADD = 0x1 - EV_CLEAR = 0x20 - EV_DELETE = 0x2 - EV_DISABLE = 0x8 - EV_DISPATCH = 0x80 - EV_ENABLE = 0x4 - EV_EOF = 0x8000 - EV_ERROR = 0x4000 - EV_FLAG1 = 0x2000 - EV_ONESHOT = 0x10 - EV_RECEIPT = 0x40 - EV_SYSFLAGS = 0xf000 - EWOULDBLOCK = 0x23 - EXDEV = 0x12 - FD_CLOEXEC = 0x1 - FD_SETSIZE = 0x400 - F_CANCEL = 0x5 - F_DUP2FD = 0xa - F_DUPFD = 0 - F_GETFD = 0x1 - F_GETFL = 0x3 - F_GETLK = 0xb - F_GETOWN = 0x5 - F_OGETLK = 0x7 - F_OSETLK = 0x8 - F_OSETLKW = 0x9 - F_RDAHEAD = 0x10 - F_RDLCK = 0x1 - F_READAHEAD = 0xf - F_SETFD = 0x2 - F_SETFL = 0x4 - F_SETLK = 0xc - F_SETLKW = 0xd - F_SETLK_REMOTE = 0xe - F_SETOWN = 0x6 - F_UNLCK = 0x2 - F_UNLCKSYS = 0x4 - F_WRLCK = 0x3 - IFF_ALLMULTI = 0x200 - IFF_ALTPHYS = 0x4000 - IFF_BROADCAST = 0x2 - IFF_CANTCHANGE = 0x208f72 - IFF_DEBUG = 0x4 - IFF_DRV_OACTIVE = 0x400 - IFF_DRV_RUNNING = 0x40 - IFF_DYING = 0x200000 - IFF_LINK0 = 0x1000 - IFF_LINK1 = 0x2000 - IFF_LINK2 = 0x4000 - IFF_LOOPBACK = 0x8 - IFF_MONITOR = 0x40000 - IFF_MULTICAST = 0x8000 - IFF_NOARP = 0x80 - IFF_OACTIVE = 0x400 - IFF_POINTOPOINT = 0x10 - IFF_PPROMISC = 0x20000 - IFF_PROMISC = 0x100 - IFF_RENAMING = 0x400000 - IFF_RUNNING = 0x40 - IFF_SIMPLEX = 0x800 - IFF_SMART = 0x20 - IFF_STATICARP = 0x80000 - IFF_UP = 0x1 - IFNAMSIZ = 0x10 - IN_CLASSA_HOST = 0xffffff - IN_CLASSA_MAX = 0x80 - IN_CLASSA_NET = 0xff000000 - IN_CLASSA_NSHIFT = 0x18 - IN_CLASSB_HOST = 0xffff - IN_CLASSB_MAX = 0x10000 - IN_CLASSB_NET = 0xffff0000 - IN_CLASSB_NSHIFT = 0x10 - IN_CLASSC_HOST = 0xff - IN_CLASSC_NET = 0xffffff00 - IN_CLASSC_NSHIFT = 0x8 - IN_CLASSD_HOST = 0xfffffff - IN_CLASSD_NET = 0xf0000000 - IN_CLASSD_NSHIFT = 0x1c - IN_LOOPBACKNET = 0x7f - IPPROTO_3PC = 0x22 - IPPROTO_ADFS = 0x44 - IPPROTO_AH = 0x33 - IPPROTO_AHIP = 0x3d - IPPROTO_APES = 0x63 - IPPROTO_ARGUS = 0xd - IPPROTO_AX25 = 0x5d - IPPROTO_BHA = 0x31 - IPPROTO_BLT = 0x1e - IPPROTO_BRSATMON = 0x4c - IPPROTO_CARP = 0x70 - IPPROTO_CFTP = 0x3e - IPPROTO_CHAOS = 0x10 - IPPROTO_CMTP = 0x26 - IPPROTO_CPHB = 0x49 - IPPROTO_CPNX = 0x48 - IPPROTO_DDP = 0x25 - IPPROTO_DGP = 0x56 - IPPROTO_DIVERT = 0x102 - IPPROTO_DONE = 0x101 - IPPROTO_DSTOPTS = 0x3c - IPPROTO_EGP = 0x8 - IPPROTO_EMCON = 0xe - IPPROTO_ENCAP = 0x62 - IPPROTO_EON = 0x50 - IPPROTO_ESP = 0x32 - IPPROTO_ETHERIP = 0x61 - IPPROTO_FRAGMENT = 0x2c - IPPROTO_GGP = 0x3 - IPPROTO_GMTP = 0x64 - IPPROTO_GRE = 0x2f - IPPROTO_HELLO = 0x3f - IPPROTO_HMP = 0x14 - IPPROTO_HOPOPTS = 0 - IPPROTO_ICMP = 0x1 - IPPROTO_ICMPV6 = 0x3a - IPPROTO_IDP = 0x16 - IPPROTO_IDPR = 0x23 - IPPROTO_IDRP = 0x2d - IPPROTO_IGMP = 0x2 - IPPROTO_IGP = 0x55 - IPPROTO_IGRP = 0x58 - IPPROTO_IL = 0x28 - IPPROTO_INLSP = 0x34 - IPPROTO_INP = 0x20 - IPPROTO_IP = 0 - IPPROTO_IPCOMP = 0x6c - IPPROTO_IPCV = 0x47 - IPPROTO_IPEIP = 0x5e - IPPROTO_IPIP = 0x4 - IPPROTO_IPPC = 0x43 - IPPROTO_IPV4 = 0x4 - IPPROTO_IPV6 = 0x29 - IPPROTO_IRTP = 0x1c - IPPROTO_KRYPTOLAN = 0x41 - IPPROTO_LARP = 0x5b - IPPROTO_LEAF1 = 0x19 - IPPROTO_LEAF2 = 0x1a - IPPROTO_MAX = 0x100 - IPPROTO_MAXID = 0x34 - IPPROTO_MEAS = 0x13 - IPPROTO_MHRP = 0x30 - IPPROTO_MICP = 0x5f - IPPROTO_MOBILE = 0x37 - IPPROTO_MTP = 0x5c - IPPROTO_MUX = 0x12 - IPPROTO_ND = 0x4d - IPPROTO_NHRP = 0x36 - IPPROTO_NONE = 0x3b - IPPROTO_NSP = 0x1f - IPPROTO_NVPII = 0xb - IPPROTO_OLD_DIVERT = 0xfe - IPPROTO_OSPFIGP = 0x59 - IPPROTO_PFSYNC = 0xf0 - IPPROTO_PGM = 0x71 - IPPROTO_PIGP = 0x9 - IPPROTO_PIM = 0x67 - IPPROTO_PRM = 0x15 - IPPROTO_PUP = 0xc - IPPROTO_PVP = 0x4b - IPPROTO_RAW = 0xff - IPPROTO_RCCMON = 0xa - IPPROTO_RDP = 0x1b - IPPROTO_ROUTING = 0x2b - IPPROTO_RSVP = 0x2e - IPPROTO_RVD = 0x42 - IPPROTO_SATEXPAK = 0x40 - IPPROTO_SATMON = 0x45 - IPPROTO_SCCSP = 0x60 - IPPROTO_SCTP = 0x84 - IPPROTO_SDRP = 0x2a - IPPROTO_SEP = 0x21 - IPPROTO_SKIP = 0x39 - IPPROTO_SPACER = 0x7fff - IPPROTO_SRPC = 0x5a - IPPROTO_ST = 0x7 - IPPROTO_SVMTP = 0x52 - IPPROTO_SWIPE = 0x35 - IPPROTO_TCF = 0x57 - IPPROTO_TCP = 0x6 - IPPROTO_TLSP = 0x38 - IPPROTO_TP = 0x1d - IPPROTO_TPXX = 0x27 - IPPROTO_TRUNK1 = 0x17 - IPPROTO_TRUNK2 = 0x18 - IPPROTO_TTP = 0x54 - IPPROTO_UDP = 0x11 - IPPROTO_VINES = 0x53 - IPPROTO_VISA = 0x46 - IPPROTO_VMTP = 0x51 - IPPROTO_WBEXPAK = 0x4f - IPPROTO_WBMON = 0x4e - IPPROTO_WSN = 0x4a - IPPROTO_XNET = 0xf - IPPROTO_XTP = 0x24 - IPV6_AUTOFLOWLABEL = 0x3b - IPV6_BINDANY = 0x40 - IPV6_BINDV6ONLY = 0x1b - IPV6_CHECKSUM = 0x1a - IPV6_DEFAULT_MULTICAST_HOPS = 0x1 - IPV6_DEFAULT_MULTICAST_LOOP = 0x1 - IPV6_DEFHLIM = 0x40 - IPV6_DONTFRAG = 0x3e - IPV6_DSTOPTS = 0x32 - IPV6_FAITH = 0x1d - IPV6_FLOWINFO_MASK = 0xffffff0f - IPV6_FLOWLABEL_MASK = 0xffff0f00 - IPV6_FRAGTTL = 0x78 - IPV6_FW_ADD = 0x1e - IPV6_FW_DEL = 0x1f - IPV6_FW_FLUSH = 0x20 - IPV6_FW_GET = 0x22 - IPV6_FW_ZERO = 0x21 - IPV6_HLIMDEC = 0x1 - IPV6_HOPLIMIT = 0x2f - IPV6_HOPOPTS = 0x31 - IPV6_IPSEC_POLICY = 0x1c - IPV6_JOIN_GROUP = 0xc - IPV6_LEAVE_GROUP = 0xd - IPV6_MAXHLIM = 0xff - IPV6_MAXOPTHDR = 0x800 - IPV6_MAXPACKET = 0xffff - IPV6_MAX_GROUP_SRC_FILTER = 0x200 - IPV6_MAX_MEMBERSHIPS = 0xfff - IPV6_MAX_SOCK_SRC_FILTER = 0x80 - IPV6_MIN_MEMBERSHIPS = 0x1f - IPV6_MMTU = 0x500 - IPV6_MSFILTER = 0x4a - IPV6_MULTICAST_HOPS = 0xa - IPV6_MULTICAST_IF = 0x9 - IPV6_MULTICAST_LOOP = 0xb - IPV6_NEXTHOP = 0x30 - IPV6_PATHMTU = 0x2c - IPV6_PKTINFO = 0x2e - IPV6_PORTRANGE = 0xe - IPV6_PORTRANGE_DEFAULT = 0 - IPV6_PORTRANGE_HIGH = 0x1 - IPV6_PORTRANGE_LOW = 0x2 - IPV6_PREFER_TEMPADDR = 0x3f - IPV6_RECVDSTOPTS = 0x28 - IPV6_RECVHOPLIMIT = 0x25 - IPV6_RECVHOPOPTS = 0x27 - IPV6_RECVPATHMTU = 0x2b - IPV6_RECVPKTINFO = 0x24 - IPV6_RECVRTHDR = 0x26 - IPV6_RECVTCLASS = 0x39 - IPV6_RTHDR = 0x33 - IPV6_RTHDRDSTOPTS = 0x23 - IPV6_RTHDR_LOOSE = 0 - IPV6_RTHDR_STRICT = 0x1 - IPV6_RTHDR_TYPE_0 = 0 - IPV6_SOCKOPT_RESERVED1 = 0x3 - IPV6_TCLASS = 0x3d - IPV6_UNICAST_HOPS = 0x4 - IPV6_USE_MIN_MTU = 0x2a - IPV6_V6ONLY = 0x1b - IPV6_VERSION = 0x60 - IPV6_VERSION_MASK = 0xf0 - IP_ADD_MEMBERSHIP = 0xc - IP_ADD_SOURCE_MEMBERSHIP = 0x46 - IP_BINDANY = 0x18 - IP_BLOCK_SOURCE = 0x48 - IP_DEFAULT_MULTICAST_LOOP = 0x1 - IP_DEFAULT_MULTICAST_TTL = 0x1 - IP_DF = 0x4000 - IP_DONTFRAG = 0x43 - IP_DROP_MEMBERSHIP = 0xd - IP_DROP_SOURCE_MEMBERSHIP = 0x47 - IP_DUMMYNET3 = 0x31 - IP_DUMMYNET_CONFIGURE = 0x3c - IP_DUMMYNET_DEL = 0x3d - IP_DUMMYNET_FLUSH = 0x3e - IP_DUMMYNET_GET = 0x40 - IP_FAITH = 0x16 - IP_FW3 = 0x30 - IP_FW_ADD = 0x32 - IP_FW_DEL = 0x33 - IP_FW_FLUSH = 0x34 - IP_FW_GET = 0x36 - IP_FW_NAT_CFG = 0x38 - IP_FW_NAT_DEL = 0x39 - IP_FW_NAT_GET_CONFIG = 0x3a - IP_FW_NAT_GET_LOG = 0x3b - IP_FW_RESETLOG = 0x37 - IP_FW_TABLE_ADD = 0x28 - IP_FW_TABLE_DEL = 0x29 - IP_FW_TABLE_FLUSH = 0x2a - IP_FW_TABLE_GETSIZE = 0x2b - IP_FW_TABLE_LIST = 0x2c - IP_FW_ZERO = 0x35 - IP_HDRINCL = 0x2 - IP_IPSEC_POLICY = 0x15 - IP_MAXPACKET = 0xffff - IP_MAX_GROUP_SRC_FILTER = 0x200 - IP_MAX_MEMBERSHIPS = 0xfff - IP_MAX_SOCK_MUTE_FILTER = 0x80 - IP_MAX_SOCK_SRC_FILTER = 0x80 - IP_MAX_SOURCE_FILTER = 0x400 - IP_MF = 0x2000 - IP_MINTTL = 0x42 - IP_MIN_MEMBERSHIPS = 0x1f - IP_MSFILTER = 0x4a - IP_MSS = 0x240 - IP_MULTICAST_IF = 0x9 - IP_MULTICAST_LOOP = 0xb - IP_MULTICAST_TTL = 0xa - IP_MULTICAST_VIF = 0xe - IP_OFFMASK = 0x1fff - IP_ONESBCAST = 0x17 - IP_OPTIONS = 0x1 - IP_PORTRANGE = 0x13 - IP_PORTRANGE_DEFAULT = 0 - IP_PORTRANGE_HIGH = 0x1 - IP_PORTRANGE_LOW = 0x2 - IP_RECVDSTADDR = 0x7 - IP_RECVIF = 0x14 - IP_RECVOPTS = 0x5 - IP_RECVRETOPTS = 0x6 - IP_RECVTTL = 0x41 - IP_RETOPTS = 0x8 - IP_RF = 0x8000 - IP_RSVP_OFF = 0x10 - IP_RSVP_ON = 0xf - IP_RSVP_VIF_OFF = 0x12 - IP_RSVP_VIF_ON = 0x11 - IP_SENDSRCADDR = 0x7 - IP_TOS = 0x3 - IP_TTL = 0x4 - IP_UNBLOCK_SOURCE = 0x49 - MSG_COMPAT = 0x8000 - MSG_CTRUNC = 0x20 - MSG_DONTROUTE = 0x4 - MSG_DONTWAIT = 0x80 - MSG_EOF = 0x100 - MSG_EOR = 0x8 - MSG_NBIO = 0x4000 - MSG_NOSIGNAL = 0x20000 - MSG_NOTIFICATION = 0x2000 - MSG_OOB = 0x1 - MSG_PEEK = 0x2 - MSG_TRUNC = 0x10 - MSG_WAITALL = 0x40 - NET_RT_DUMP = 0x1 - NET_RT_FLAGS = 0x2 - NET_RT_IFLIST = 0x3 - NET_RT_IFMALIST = 0x4 - NET_RT_MAXID = 0x5 - O_ACCMODE = 0x3 - O_APPEND = 0x8 - O_ASYNC = 0x40 - O_CREAT = 0x200 - O_DIRECT = 0x10000 - O_DIRECTORY = 0x20000 - O_EXCL = 0x800 - O_EXEC = 0x40000 - O_EXLOCK = 0x20 - O_FSYNC = 0x80 - O_NDELAY = 0x4 - O_NOCTTY = 0x8000 - O_NOFOLLOW = 0x100 - O_NONBLOCK = 0x4 - O_RDONLY = 0 - O_RDWR = 0x2 - O_SHLOCK = 0x10 - O_SYNC = 0x80 - O_TRUNC = 0x400 - O_TTY_INIT = 0x80000 - O_WRONLY = 0x1 - RTAX_AUTHOR = 0x6 - RTAX_BRD = 0x7 - RTAX_DST = 0 - RTAX_GATEWAY = 0x1 - RTAX_GENMASK = 0x3 - RTAX_IFA = 0x5 - RTAX_IFP = 0x4 - RTAX_MAX = 0x8 - RTAX_NETMASK = 0x2 - RTA_AUTHOR = 0x40 - RTA_BRD = 0x80 - RTA_DST = 0x1 - RTA_GATEWAY = 0x2 - RTA_GENMASK = 0x8 - RTA_IFA = 0x20 - RTA_IFP = 0x10 - RTA_NETMASK = 0x4 - RTF_BLACKHOLE = 0x1000 - RTF_BROADCAST = 0x400000 - RTF_DONE = 0x40 - RTF_DYNAMIC = 0x10 - RTF_FMASK = 0x1004d808 - RTF_GATEWAY = 0x2 - RTF_HOST = 0x4 - RTF_LLDATA = 0x400 - RTF_LLINFO = 0x400 - RTF_LOCAL = 0x200000 - RTF_MODIFIED = 0x20 - RTF_MULTICAST = 0x800000 - RTF_PINNED = 0x100000 - RTF_PRCLONING = 0x10000 - RTF_PROTO1 = 0x8000 - RTF_PROTO2 = 0x4000 - RTF_PROTO3 = 0x40000 - RTF_REJECT = 0x8 - RTF_RNH_LOCKED = 0x40000000 - RTF_STATIC = 0x800 - RTF_STICKY = 0x10000000 - RTF_UP = 0x1 - RTF_XRESOLVE = 0x200 - RTM_ADD = 0x1 - RTM_CHANGE = 0x3 - RTM_DELADDR = 0xd - RTM_DELETE = 0x2 - RTM_DELMADDR = 0x10 - RTM_GET = 0x4 - RTM_IEEE80211 = 0x12 - RTM_IFANNOUNCE = 0x11 - RTM_IFINFO = 0xe - RTM_LOCK = 0x8 - RTM_LOSING = 0x5 - RTM_MISS = 0x7 - RTM_NEWADDR = 0xc - RTM_NEWMADDR = 0xf - RTM_OLDADD = 0x9 - RTM_OLDDEL = 0xa - RTM_REDIRECT = 0x6 - RTM_RESOLVE = 0xb - RTM_RTTUNIT = 0xf4240 - RTM_VERSION = 0x5 - RTV_EXPIRE = 0x4 - RTV_HOPCOUNT = 0x2 - RTV_MTU = 0x1 - RTV_RPIPE = 0x8 - RTV_RTT = 0x40 - RTV_RTTVAR = 0x80 - RTV_SPIPE = 0x10 - RTV_SSTHRESH = 0x20 - RTV_WEIGHT = 0x100 - SCM_BINTIME = 0x4 - SCM_CREDS = 0x3 - SCM_RIGHTS = 0x1 - SCM_TIMESTAMP = 0x2 - SHUT_RD = 0 - SHUT_RDWR = 0x2 - SHUT_WR = 0x1 - SIGABRT = 0x6 - SIGALRM = 0xe - SIGBUS = 0xa - SIGCHLD = 0x14 - SIGCONT = 0x13 - SIGEMT = 0x7 - SIGFPE = 0x8 - SIGHUP = 0x1 - SIGILL = 0x4 - SIGINFO = 0x1d - SIGINT = 0x2 - SIGIO = 0x17 - SIGIOT = 0x6 - SIGKILL = 0x9 - SIGLWP = 0x20 - SIGPIPE = 0xd - SIGPROF = 0x1b - SIGQUIT = 0x3 - SIGSEGV = 0xb - SIGSTOP = 0x11 - SIGSYS = 0xc - SIGTERM = 0xf - SIGTHR = 0x20 - SIGTRAP = 0x5 - SIGTSTP = 0x12 - SIGTTIN = 0x15 - SIGTTOU = 0x16 - SIGURG = 0x10 - SIGUSR1 = 0x1e - SIGUSR2 = 0x1f - SIGVTALRM = 0x1a - SIGWINCH = 0x1c - SIGXCPU = 0x18 - SIGXFSZ = 0x19 - SIOCADDMULTI = 0x80206931 - SIOCADDRT = 0x8040720a - SIOCAIFADDR = 0x8040691a - SIOCAIFGROUP = 0x80286987 - SIOCALIFADDR = 0x8118691b - SIOCATMARK = 0x40047307 - SIOCDELMULTI = 0x80206932 - SIOCDELRT = 0x8040720b - SIOCDIFADDR = 0x80206919 - SIOCDIFGROUP = 0x80286989 - SIOCDIFPHYADDR = 0x80206949 - SIOCDLIFADDR = 0x8118691d - SIOCGDRVSPEC = 0xc028697b - SIOCGETSGCNT = 0xc0207210 - SIOCGETVIFCNT = 0xc028720f - SIOCGHIWAT = 0x40047301 - SIOCGIFADDR = 0xc0206921 - SIOCGIFBRDADDR = 0xc0206923 - SIOCGIFCAP = 0xc020691f - SIOCGIFCONF = 0xc0106924 - SIOCGIFDESCR = 0xc020692a - SIOCGIFDSTADDR = 0xc0206922 - SIOCGIFFLAGS = 0xc0206911 - SIOCGIFGENERIC = 0xc020693a - SIOCGIFGMEMB = 0xc028698a - SIOCGIFGROUP = 0xc0286988 - SIOCGIFINDEX = 0xc0206920 - SIOCGIFMAC = 0xc0206926 - SIOCGIFMEDIA = 0xc0306938 - SIOCGIFMETRIC = 0xc0206917 - SIOCGIFMTU = 0xc0206933 - SIOCGIFNETMASK = 0xc0206925 - SIOCGIFPDSTADDR = 0xc0206948 - SIOCGIFPHYS = 0xc0206935 - SIOCGIFPSRCADDR = 0xc0206947 - SIOCGIFSTATUS = 0xc331693b - SIOCGLIFADDR = 0xc118691c - SIOCGLIFPHYADDR = 0xc118694b - SIOCGLOWAT = 0x40047303 - SIOCGPGRP = 0x40047309 - SIOCGPRIVATE_0 = 0xc0206950 - SIOCGPRIVATE_1 = 0xc0206951 - SIOCIFCREATE = 0xc020697a - SIOCIFCREATE2 = 0xc020697c - SIOCIFDESTROY = 0x80206979 - SIOCIFGCLONERS = 0xc0106978 - SIOCSDRVSPEC = 0x8028697b - SIOCSHIWAT = 0x80047300 - SIOCSIFADDR = 0x8020690c - SIOCSIFBRDADDR = 0x80206913 - SIOCSIFCAP = 0x8020691e - SIOCSIFDESCR = 0x80206929 - SIOCSIFDSTADDR = 0x8020690e - SIOCSIFFLAGS = 0x80206910 - SIOCSIFGENERIC = 0x80206939 - SIOCSIFLLADDR = 0x8020693c - SIOCSIFMAC = 0x80206927 - SIOCSIFMEDIA = 0xc0206937 - SIOCSIFMETRIC = 0x80206918 - SIOCSIFMTU = 0x80206934 - SIOCSIFNAME = 0x80206928 - SIOCSIFNETMASK = 0x80206916 - SIOCSIFPHYADDR = 0x80406946 - SIOCSIFPHYS = 0x80206936 - SIOCSIFRVNET = 0xc020695b - SIOCSIFVNET = 0xc020695a - SIOCSLIFPHYADDR = 0x8118694a - SIOCSLOWAT = 0x80047302 - SIOCSPGRP = 0x80047308 - SOCK_DGRAM = 0x2 - SOCK_MAXADDRLEN = 0xff - SOCK_RAW = 0x3 - SOCK_RDM = 0x4 - SOCK_SEQPACKET = 0x5 - SOCK_STREAM = 0x1 - SOL_SOCKET = 0xffff - SOMAXCONN = 0x80 - SO_ACCEPTCONN = 0x2 - SO_ACCEPTFILTER = 0x1000 - SO_BINTIME = 0x2000 - SO_BROADCAST = 0x20 - SO_DEBUG = 0x1 - SO_DONTROUTE = 0x10 - SO_ERROR = 0x1007 - SO_KEEPALIVE = 0x8 - SO_LABEL = 0x1009 - SO_LINGER = 0x80 - SO_LISTENINCQLEN = 0x1013 - SO_LISTENQLEN = 0x1012 - SO_LISTENQLIMIT = 0x1011 - SO_NOSIGPIPE = 0x800 - SO_NO_DDP = 0x8000 - SO_NO_OFFLOAD = 0x4000 - SO_OOBINLINE = 0x100 - SO_PEERLABEL = 0x1010 - SO_RCVBUF = 0x1002 - SO_RCVLOWAT = 0x1004 - SO_RCVTIMEO = 0x1006 - SO_REUSEADDR = 0x4 - SO_REUSEPORT = 0x200 - SO_SETFIB = 0x1014 - SO_SNDBUF = 0x1001 - SO_SNDLOWAT = 0x1003 - SO_SNDTIMEO = 0x1005 - SO_TIMESTAMP = 0x400 - SO_TYPE = 0x1008 - SO_USELOOPBACK = 0x40 - TCP_CA_NAME_MAX = 0x10 - TCP_CONGESTION = 0x40 - TCP_INFO = 0x20 - TCP_MAXBURST = 0x4 - TCP_MAXHLEN = 0x3c - TCP_MAXOLEN = 0x28 - TCP_MAXSEG = 0x2 - TCP_MAXWIN = 0xffff - TCP_MAX_SACK = 0x4 - TCP_MAX_WINSHIFT = 0xe - TCP_MD5SIG = 0x10 - TCP_MINMSS = 0xd8 - TCP_MSS = 0x200 - TCP_NODELAY = 0x1 - TCP_NOOPT = 0x8 - TCP_NOPUSH = 0x4 - WCONTINUED = 0x4 - WCOREFLAG = 0x80 - WLINUXCLONE = 0x80000000 - WNOHANG = 0x1 - WNOWAIT = 0x8 - WSTOPPED = 0x2 - WUNTRACED = 0x2 + AF_APPLETALK = 0x10 + AF_ARP = 0x23 + AF_ATM = 0x1e + AF_BLUETOOTH = 0x24 + AF_CCITT = 0xa + AF_CHAOS = 0x5 + AF_CNT = 0x15 + AF_COIP = 0x14 + AF_DATAKIT = 0x9 + AF_DECnet = 0xc + AF_DLI = 0xd + AF_E164 = 0x1a + AF_ECMA = 0x8 + AF_HYLINK = 0xf + AF_IEEE80211 = 0x25 + AF_IMPLINK = 0x3 + AF_INET = 0x2 + AF_INET6 = 0x1c + AF_IPX = 0x17 + AF_ISDN = 0x1a + AF_ISO = 0x7 + AF_LAT = 0xe + AF_LINK = 0x12 + AF_LOCAL = 0x1 + AF_MAX = 0x26 + AF_NATM = 0x1d + AF_NETBIOS = 0x6 + AF_NETGRAPH = 0x20 + AF_OSI = 0x7 + AF_PUP = 0x4 + AF_ROUTE = 0x11 + AF_SCLUSTER = 0x22 + AF_SIP = 0x18 + AF_SLOW = 0x21 + AF_SNA = 0xb + AF_UNIX = 0x1 + AF_UNSPEC = 0 + AF_VENDOR00 = 0x27 + AF_VENDOR01 = 0x29 + AF_VENDOR02 = 0x2b + AF_VENDOR03 = 0x2d + AF_VENDOR04 = 0x2f + AF_VENDOR05 = 0x31 + AF_VENDOR06 = 0x33 + AF_VENDOR07 = 0x35 + AF_VENDOR08 = 0x37 + AF_VENDOR09 = 0x39 + AF_VENDOR10 = 0x3b + AF_VENDOR11 = 0x3d + AF_VENDOR12 = 0x3f + AF_VENDOR13 = 0x41 + AF_VENDOR14 = 0x43 + AF_VENDOR15 = 0x45 + AF_VENDOR16 = 0x47 + AF_VENDOR17 = 0x49 + AF_VENDOR18 = 0x4b + AF_VENDOR19 = 0x4d + AF_VENDOR20 = 0x4f + AF_VENDOR21 = 0x51 + AF_VENDOR22 = 0x53 + AF_VENDOR23 = 0x55 + AF_VENDOR24 = 0x57 + AF_VENDOR25 = 0x59 + AF_VENDOR26 = 0x5b + AF_VENDOR27 = 0x5d + AF_VENDOR28 = 0x5f + AF_VENDOR29 = 0x61 + AF_VENDOR30 = 0x63 + AF_VENDOR31 = 0x65 + AF_VENDOR32 = 0x67 + AF_VENDOR33 = 0x69 + AF_VENDOR34 = 0x6b + AF_VENDOR35 = 0x6d + AF_VENDOR36 = 0x6f + AF_VENDOR37 = 0x71 + AF_VENDOR38 = 0x73 + AF_VENDOR39 = 0x75 + AF_VENDOR40 = 0x77 + AF_VENDOR41 = 0x79 + AF_VENDOR42 = 0x7b + AF_VENDOR43 = 0x7d + AF_VENDOR44 = 0x7f + AF_VENDOR45 = 0x81 + AF_VENDOR46 = 0x83 + AF_VENDOR47 = 0x85 + BIOCFEEDBACK = 0x8004427c + BIOCFLUSH = 0x20004268 + BIOCGBLEN = 0x40044266 + BIOCGDIRECTION = 0x40044276 + BIOCGDLT = 0x4004426a + BIOCGDLTLIST = 0xc0104279 + BIOCGETBUFMODE = 0x4004427d + BIOCGETIF = 0x4020426b + BIOCGETZMAX = 0x4008427f + BIOCGHDRCMPLT = 0x40044274 + BIOCGRSIG = 0x40044272 + BIOCGRTIMEOUT = 0x4010426e + BIOCGSEESENT = 0x40044276 + BIOCGSTATS = 0x4008426f + BIOCIMMEDIATE = 0x80044270 + BIOCLOCK = 0x2000427a + BIOCPROMISC = 0x20004269 + BIOCROTZBUF = 0x40184280 + BIOCSBLEN = 0xc0044266 + BIOCSDIRECTION = 0x80044277 + BIOCSDLT = 0x80044278 + BIOCSETBUFMODE = 0x8004427e + BIOCSETF = 0x80104267 + BIOCSETFNR = 0x80104282 + BIOCSETIF = 0x8020426c + BIOCSETWF = 0x8010427b + BIOCSETZBUF = 0x80184281 + BIOCSHDRCMPLT = 0x80044275 + BIOCSRSIG = 0x80044273 + BIOCSRTIMEOUT = 0x8010426d + BIOCSSEESENT = 0x80044277 + BIOCVERSION = 0x40044271 + BPF_A = 0x10 + BPF_ABS = 0x20 + BPF_ADD = 0 + BPF_ALIGNMENT = 0x8 + BPF_ALU = 0x4 + BPF_AND = 0x50 + BPF_B = 0x10 + BPF_BUFMODE_BUFFER = 0x1 + BPF_BUFMODE_ZBUF = 0x2 + BPF_DIV = 0x30 + BPF_H = 0x8 + BPF_IMM = 0 + BPF_IND = 0x40 + BPF_JA = 0 + BPF_JEQ = 0x10 + BPF_JGE = 0x30 + BPF_JGT = 0x20 + BPF_JMP = 0x5 + BPF_JSET = 0x40 + BPF_K = 0 + BPF_LD = 0 + BPF_LDX = 0x1 + BPF_LEN = 0x80 + BPF_LSH = 0x60 + BPF_MAJOR_VERSION = 0x1 + BPF_MAXBUFSIZE = 0x80000 + BPF_MAXINSNS = 0x200 + BPF_MEM = 0x60 + BPF_MEMWORDS = 0x10 + BPF_MINBUFSIZE = 0x20 + BPF_MINOR_VERSION = 0x1 + BPF_MISC = 0x7 + BPF_MSH = 0xa0 + BPF_MUL = 0x20 + BPF_NEG = 0x80 + BPF_OR = 0x40 + BPF_RELEASE = 0x30bb6 + BPF_RET = 0x6 + BPF_RSH = 0x70 + BPF_ST = 0x2 + BPF_STX = 0x3 + BPF_SUB = 0x10 + BPF_TAX = 0 + BPF_TXA = 0x80 + BPF_W = 0 + BPF_X = 0x8 + CTL_MAXNAME = 0x18 + CTL_NET = 0x4 + DLT_A429 = 0xb8 + DLT_A653_ICM = 0xb9 + DLT_AIRONET_HEADER = 0x78 + DLT_APPLE_IP_OVER_IEEE1394 = 0x8a + DLT_ARCNET = 0x7 + DLT_ARCNET_LINUX = 0x81 + DLT_ATM_CLIP = 0x13 + DLT_ATM_RFC1483 = 0xb + DLT_AURORA = 0x7e + DLT_AX25 = 0x3 + DLT_AX25_KISS = 0xca + DLT_BACNET_MS_TP = 0xa5 + DLT_BLUETOOTH_HCI_H4 = 0xbb + DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 + DLT_CAN20B = 0xbe + DLT_CHAOS = 0x5 + DLT_CHDLC = 0x68 + DLT_CISCO_IOS = 0x76 + DLT_C_HDLC = 0x68 + DLT_C_HDLC_WITH_DIR = 0xcd + DLT_DOCSIS = 0x8f + DLT_ECONET = 0x73 + DLT_EN10MB = 0x1 + DLT_EN3MB = 0x2 + DLT_ENC = 0x6d + DLT_ERF = 0xc5 + DLT_ERF_ETH = 0xaf + DLT_ERF_POS = 0xb0 + DLT_FDDI = 0xa + DLT_FLEXRAY = 0xd2 + DLT_FRELAY = 0x6b + DLT_FRELAY_WITH_DIR = 0xce + DLT_GCOM_SERIAL = 0xad + DLT_GCOM_T1E1 = 0xac + DLT_GPF_F = 0xab + DLT_GPF_T = 0xaa + DLT_GPRS_LLC = 0xa9 + DLT_HHDLC = 0x79 + DLT_IBM_SN = 0x92 + DLT_IBM_SP = 0x91 + DLT_IEEE802 = 0x6 + DLT_IEEE802_11 = 0x69 + DLT_IEEE802_11_RADIO = 0x7f + DLT_IEEE802_11_RADIO_AVS = 0xa3 + DLT_IEEE802_15_4 = 0xc3 + DLT_IEEE802_15_4_LINUX = 0xbf + DLT_IEEE802_15_4_NONASK_PHY = 0xd7 + DLT_IEEE802_16_MAC_CPS = 0xbc + DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 + DLT_IPFILTER = 0x74 + DLT_IPMB = 0xc7 + DLT_IPMB_LINUX = 0xd1 + DLT_IP_OVER_FC = 0x7a + DLT_JUNIPER_ATM1 = 0x89 + DLT_JUNIPER_ATM2 = 0x87 + DLT_JUNIPER_CHDLC = 0xb5 + DLT_JUNIPER_ES = 0x84 + DLT_JUNIPER_ETHER = 0xb2 + DLT_JUNIPER_FRELAY = 0xb4 + DLT_JUNIPER_GGSN = 0x85 + DLT_JUNIPER_ISM = 0xc2 + DLT_JUNIPER_MFR = 0x86 + DLT_JUNIPER_MLFR = 0x83 + DLT_JUNIPER_MLPPP = 0x82 + DLT_JUNIPER_MONITOR = 0xa4 + DLT_JUNIPER_PIC_PEER = 0xae + DLT_JUNIPER_PPP = 0xb3 + DLT_JUNIPER_PPPOE = 0xa7 + DLT_JUNIPER_PPPOE_ATM = 0xa8 + DLT_JUNIPER_SERVICES = 0x88 + DLT_JUNIPER_ST = 0xc8 + DLT_JUNIPER_VP = 0xb7 + DLT_LAPB_WITH_DIR = 0xcf + DLT_LAPD = 0xcb + DLT_LIN = 0xd4 + DLT_LINUX_IRDA = 0x90 + DLT_LINUX_LAPD = 0xb1 + DLT_LINUX_PPP_WITHDIRECTION = 0xa6 + DLT_LINUX_SLL = 0x71 + DLT_LOOP = 0x6c + DLT_LTALK = 0x72 + DLT_MFR = 0xb6 + DLT_MOST = 0xd3 + DLT_MTP2 = 0x8c + DLT_MTP2_WITH_PHDR = 0x8b + DLT_MTP3 = 0x8d + DLT_NULL = 0 + DLT_PCI_EXP = 0x7d + DLT_PFLOG = 0x75 + DLT_PFSYNC = 0x79 + DLT_PPI = 0xc0 + DLT_PPP = 0x9 + DLT_PPP_BSDOS = 0x10 + DLT_PPP_ETHER = 0x33 + DLT_PPP_PPPD = 0xa6 + DLT_PPP_SERIAL = 0x32 + DLT_PPP_WITH_DIR = 0xcc + DLT_PPP_WITH_DIRECTION = 0xa6 + DLT_PRISM_HEADER = 0x77 + DLT_PRONET = 0x4 + DLT_RAIF1 = 0xc6 + DLT_RAW = 0xc + DLT_RIO = 0x7c + DLT_SCCP = 0x8e + DLT_SITA = 0xc4 + DLT_SLIP = 0x8 + DLT_SLIP_BSDOS = 0xf + DLT_SUNATM = 0x7b + DLT_SYMANTEC_FIREWALL = 0x63 + DLT_TZSP = 0x80 + DLT_USB = 0xba + DLT_USB_LINUX = 0xbd + DLT_USER0 = 0x93 + DLT_USER1 = 0x94 + DLT_USER10 = 0x9d + DLT_USER11 = 0x9e + DLT_USER12 = 0x9f + DLT_USER13 = 0xa0 + DLT_USER14 = 0xa1 + DLT_USER15 = 0xa2 + DLT_USER2 = 0x95 + DLT_USER3 = 0x96 + DLT_USER4 = 0x97 + DLT_USER5 = 0x98 + DLT_USER6 = 0x99 + DLT_USER7 = 0x9a + DLT_USER8 = 0x9b + DLT_USER9 = 0x9c + DLT_X2E_SERIAL = 0xd5 + DLT_X2E_XORAYA = 0xd6 + E2BIG = 0x7 + EACCES = 0xd + EADDRINUSE = 0x30 + EADDRNOTAVAIL = 0x31 + EAFNOSUPPORT = 0x2f + EAGAIN = 0x23 + EALREADY = 0x25 + EAUTH = 0x50 + EBADF = 0x9 + EBADMSG = 0x59 + EBADRPC = 0x48 + EBUSY = 0x10 + ECANCELED = 0x55 + ECHILD = 0xa + ECONNABORTED = 0x35 + ECONNREFUSED = 0x3d + ECONNRESET = 0x36 + EDEADLK = 0xb + EDESTADDRREQ = 0x27 + EDOM = 0x21 + EDOOFUS = 0x58 + EDQUOT = 0x45 + EEXIST = 0x11 + EFAULT = 0xe + EFBIG = 0x1b + EFTYPE = 0x4f + EHOSTDOWN = 0x40 + EHOSTUNREACH = 0x41 + EIDRM = 0x52 + EILSEQ = 0x56 + EINPROGRESS = 0x24 + EINTR = 0x4 + EINVAL = 0x16 + EIO = 0x5 + EISCONN = 0x38 + EISDIR = 0x15 + ELAST = 0x5d + ELOOP = 0x3e + EMFILE = 0x18 + EMLINK = 0x1f + EMSGSIZE = 0x28 + EMULTIHOP = 0x5a + ENAMETOOLONG = 0x3f + ENEEDAUTH = 0x51 + ENETDOWN = 0x32 + ENETRESET = 0x34 + ENETUNREACH = 0x33 + ENFILE = 0x17 + ENOATTR = 0x57 + ENOBUFS = 0x37 + ENODEV = 0x13 + ENOENT = 0x2 + ENOEXEC = 0x8 + ENOLCK = 0x4d + ENOLINK = 0x5b + ENOMEM = 0xc + ENOMSG = 0x53 + ENOPROTOOPT = 0x2a + ENOSPC = 0x1c + ENOSYS = 0x4e + ENOTBLK = 0xf + ENOTCAPABLE = 0x5d + ENOTCONN = 0x39 + ENOTDIR = 0x14 + ENOTEMPTY = 0x42 + ENOTSOCK = 0x26 + ENOTSUP = 0x2d + ENOTTY = 0x19 + ENXIO = 0x6 + EOPNOTSUPP = 0x2d + EOVERFLOW = 0x54 + EPERM = 0x1 + EPFNOSUPPORT = 0x2e + EPIPE = 0x20 + EPROCLIM = 0x43 + EPROCUNAVAIL = 0x4c + EPROGMISMATCH = 0x4b + EPROGUNAVAIL = 0x4a + EPROTO = 0x5c + EPROTONOSUPPORT = 0x2b + EPROTOTYPE = 0x29 + ERANGE = 0x22 + EREMOTE = 0x47 + EROFS = 0x1e + ERPCMISMATCH = 0x49 + ESHUTDOWN = 0x3a + ESOCKTNOSUPPORT = 0x2c + ESPIPE = 0x1d + ESRCH = 0x3 + ESTALE = 0x46 + ETIMEDOUT = 0x3c + ETOOMANYREFS = 0x3b + ETXTBSY = 0x1a + EUSERS = 0x44 + EVFILT_AIO = -0x3 + EVFILT_FS = -0x9 + EVFILT_LIO = -0xa + EVFILT_PROC = -0x5 + EVFILT_READ = -0x1 + EVFILT_SIGNAL = -0x6 + EVFILT_SYSCOUNT = 0xb + EVFILT_TIMER = -0x7 + EVFILT_USER = -0xb + EVFILT_VNODE = -0x4 + EVFILT_WRITE = -0x2 + EV_ADD = 0x1 + EV_CLEAR = 0x20 + EV_DELETE = 0x2 + EV_DISABLE = 0x8 + EV_DISPATCH = 0x80 + EV_ENABLE = 0x4 + EV_EOF = 0x8000 + EV_ERROR = 0x4000 + EV_FLAG1 = 0x2000 + EV_ONESHOT = 0x10 + EV_RECEIPT = 0x40 + EV_SYSFLAGS = 0xf000 + EWOULDBLOCK = 0x23 + EXDEV = 0x12 + FD_CLOEXEC = 0x1 + FD_SETSIZE = 0x400 + F_CANCEL = 0x5 + F_DUP2FD = 0xa + F_DUPFD = 0 + F_GETFD = 0x1 + F_GETFL = 0x3 + F_GETLK = 0xb + F_GETOWN = 0x5 + F_OGETLK = 0x7 + F_OSETLK = 0x8 + F_OSETLKW = 0x9 + F_RDAHEAD = 0x10 + F_RDLCK = 0x1 + F_READAHEAD = 0xf + F_SETFD = 0x2 + F_SETFL = 0x4 + F_SETLK = 0xc + F_SETLKW = 0xd + F_SETLK_REMOTE = 0xe + F_SETOWN = 0x6 + F_UNLCK = 0x2 + F_UNLCKSYS = 0x4 + F_WRLCK = 0x3 + IFF_ALLMULTI = 0x200 + IFF_ALTPHYS = 0x4000 + IFF_BROADCAST = 0x2 + IFF_CANTCHANGE = 0x208f72 + IFF_DEBUG = 0x4 + IFF_DRV_OACTIVE = 0x400 + IFF_DRV_RUNNING = 0x40 + IFF_DYING = 0x200000 + IFF_LINK0 = 0x1000 + IFF_LINK1 = 0x2000 + IFF_LINK2 = 0x4000 + IFF_LOOPBACK = 0x8 + IFF_MONITOR = 0x40000 + IFF_MULTICAST = 0x8000 + IFF_NOARP = 0x80 + IFF_OACTIVE = 0x400 + IFF_POINTOPOINT = 0x10 + IFF_PPROMISC = 0x20000 + IFF_PROMISC = 0x100 + IFF_RENAMING = 0x400000 + IFF_RUNNING = 0x40 + IFF_SIMPLEX = 0x800 + IFF_SMART = 0x20 + IFF_STATICARP = 0x80000 + IFF_UP = 0x1 + IFNAMSIZ = 0x10 + IN_CLASSA_HOST = 0xffffff + IN_CLASSA_MAX = 0x80 + IN_CLASSA_NET = 0xff000000 + IN_CLASSA_NSHIFT = 0x18 + IN_CLASSB_HOST = 0xffff + IN_CLASSB_MAX = 0x10000 + IN_CLASSB_NET = 0xffff0000 + IN_CLASSB_NSHIFT = 0x10 + IN_CLASSC_HOST = 0xff + IN_CLASSC_NET = 0xffffff00 + IN_CLASSC_NSHIFT = 0x8 + IN_CLASSD_HOST = 0xfffffff + IN_CLASSD_NET = 0xf0000000 + IN_CLASSD_NSHIFT = 0x1c + IN_LOOPBACKNET = 0x7f + IPPROTO_3PC = 0x22 + IPPROTO_ADFS = 0x44 + IPPROTO_AH = 0x33 + IPPROTO_AHIP = 0x3d + IPPROTO_APES = 0x63 + IPPROTO_ARGUS = 0xd + IPPROTO_AX25 = 0x5d + IPPROTO_BHA = 0x31 + IPPROTO_BLT = 0x1e + IPPROTO_BRSATMON = 0x4c + IPPROTO_CARP = 0x70 + IPPROTO_CFTP = 0x3e + IPPROTO_CHAOS = 0x10 + IPPROTO_CMTP = 0x26 + IPPROTO_CPHB = 0x49 + IPPROTO_CPNX = 0x48 + IPPROTO_DDP = 0x25 + IPPROTO_DGP = 0x56 + IPPROTO_DIVERT = 0x102 + IPPROTO_DONE = 0x101 + IPPROTO_DSTOPTS = 0x3c + IPPROTO_EGP = 0x8 + IPPROTO_EMCON = 0xe + IPPROTO_ENCAP = 0x62 + IPPROTO_EON = 0x50 + IPPROTO_ESP = 0x32 + IPPROTO_ETHERIP = 0x61 + IPPROTO_FRAGMENT = 0x2c + IPPROTO_GGP = 0x3 + IPPROTO_GMTP = 0x64 + IPPROTO_GRE = 0x2f + IPPROTO_HELLO = 0x3f + IPPROTO_HMP = 0x14 + IPPROTO_HOPOPTS = 0 + IPPROTO_ICMP = 0x1 + IPPROTO_ICMPV6 = 0x3a + IPPROTO_IDP = 0x16 + IPPROTO_IDPR = 0x23 + IPPROTO_IDRP = 0x2d + IPPROTO_IGMP = 0x2 + IPPROTO_IGP = 0x55 + IPPROTO_IGRP = 0x58 + IPPROTO_IL = 0x28 + IPPROTO_INLSP = 0x34 + IPPROTO_INP = 0x20 + IPPROTO_IP = 0 + IPPROTO_IPCOMP = 0x6c + IPPROTO_IPCV = 0x47 + IPPROTO_IPEIP = 0x5e + IPPROTO_IPIP = 0x4 + IPPROTO_IPPC = 0x43 + IPPROTO_IPV4 = 0x4 + IPPROTO_IPV6 = 0x29 + IPPROTO_IRTP = 0x1c + IPPROTO_KRYPTOLAN = 0x41 + IPPROTO_LARP = 0x5b + IPPROTO_LEAF1 = 0x19 + IPPROTO_LEAF2 = 0x1a + IPPROTO_MAX = 0x100 + IPPROTO_MAXID = 0x34 + IPPROTO_MEAS = 0x13 + IPPROTO_MHRP = 0x30 + IPPROTO_MICP = 0x5f + IPPROTO_MOBILE = 0x37 + IPPROTO_MTP = 0x5c + IPPROTO_MUX = 0x12 + IPPROTO_ND = 0x4d + IPPROTO_NHRP = 0x36 + IPPROTO_NONE = 0x3b + IPPROTO_NSP = 0x1f + IPPROTO_NVPII = 0xb + IPPROTO_OLD_DIVERT = 0xfe + IPPROTO_OSPFIGP = 0x59 + IPPROTO_PFSYNC = 0xf0 + IPPROTO_PGM = 0x71 + IPPROTO_PIGP = 0x9 + IPPROTO_PIM = 0x67 + IPPROTO_PRM = 0x15 + IPPROTO_PUP = 0xc + IPPROTO_PVP = 0x4b + IPPROTO_RAW = 0xff + IPPROTO_RCCMON = 0xa + IPPROTO_RDP = 0x1b + IPPROTO_ROUTING = 0x2b + IPPROTO_RSVP = 0x2e + IPPROTO_RVD = 0x42 + IPPROTO_SATEXPAK = 0x40 + IPPROTO_SATMON = 0x45 + IPPROTO_SCCSP = 0x60 + IPPROTO_SCTP = 0x84 + IPPROTO_SDRP = 0x2a + IPPROTO_SEP = 0x21 + IPPROTO_SKIP = 0x39 + IPPROTO_SPACER = 0x7fff + IPPROTO_SRPC = 0x5a + IPPROTO_ST = 0x7 + IPPROTO_SVMTP = 0x52 + IPPROTO_SWIPE = 0x35 + IPPROTO_TCF = 0x57 + IPPROTO_TCP = 0x6 + IPPROTO_TLSP = 0x38 + IPPROTO_TP = 0x1d + IPPROTO_TPXX = 0x27 + IPPROTO_TRUNK1 = 0x17 + IPPROTO_TRUNK2 = 0x18 + IPPROTO_TTP = 0x54 + IPPROTO_UDP = 0x11 + IPPROTO_VINES = 0x53 + IPPROTO_VISA = 0x46 + IPPROTO_VMTP = 0x51 + IPPROTO_WBEXPAK = 0x4f + IPPROTO_WBMON = 0x4e + IPPROTO_WSN = 0x4a + IPPROTO_XNET = 0xf + IPPROTO_XTP = 0x24 + IPV6_AUTOFLOWLABEL = 0x3b + IPV6_BINDANY = 0x40 + IPV6_BINDV6ONLY = 0x1b + IPV6_CHECKSUM = 0x1a + IPV6_DEFAULT_MULTICAST_HOPS = 0x1 + IPV6_DEFAULT_MULTICAST_LOOP = 0x1 + IPV6_DEFHLIM = 0x40 + IPV6_DONTFRAG = 0x3e + IPV6_DSTOPTS = 0x32 + IPV6_FAITH = 0x1d + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 + IPV6_FRAGTTL = 0x78 + IPV6_FW_ADD = 0x1e + IPV6_FW_DEL = 0x1f + IPV6_FW_FLUSH = 0x20 + IPV6_FW_GET = 0x22 + IPV6_FW_ZERO = 0x21 + IPV6_HLIMDEC = 0x1 + IPV6_HOPLIMIT = 0x2f + IPV6_HOPOPTS = 0x31 + IPV6_IPSEC_POLICY = 0x1c + IPV6_JOIN_GROUP = 0xc + IPV6_LEAVE_GROUP = 0xd + IPV6_MAXHLIM = 0xff + IPV6_MAXOPTHDR = 0x800 + IPV6_MAXPACKET = 0xffff + IPV6_MAX_GROUP_SRC_FILTER = 0x200 + IPV6_MAX_MEMBERSHIPS = 0xfff + IPV6_MAX_SOCK_SRC_FILTER = 0x80 + IPV6_MIN_MEMBERSHIPS = 0x1f + IPV6_MMTU = 0x500 + IPV6_MSFILTER = 0x4a + IPV6_MULTICAST_HOPS = 0xa + IPV6_MULTICAST_IF = 0x9 + IPV6_MULTICAST_LOOP = 0xb + IPV6_NEXTHOP = 0x30 + IPV6_PATHMTU = 0x2c + IPV6_PKTINFO = 0x2e + IPV6_PORTRANGE = 0xe + IPV6_PORTRANGE_DEFAULT = 0 + IPV6_PORTRANGE_HIGH = 0x1 + IPV6_PORTRANGE_LOW = 0x2 + IPV6_PREFER_TEMPADDR = 0x3f + IPV6_RECVDSTOPTS = 0x28 + IPV6_RECVHOPLIMIT = 0x25 + IPV6_RECVHOPOPTS = 0x27 + IPV6_RECVPATHMTU = 0x2b + IPV6_RECVPKTINFO = 0x24 + IPV6_RECVRTHDR = 0x26 + IPV6_RECVTCLASS = 0x39 + IPV6_RTHDR = 0x33 + IPV6_RTHDRDSTOPTS = 0x23 + IPV6_RTHDR_LOOSE = 0 + IPV6_RTHDR_STRICT = 0x1 + IPV6_RTHDR_TYPE_0 = 0 + IPV6_SOCKOPT_RESERVED1 = 0x3 + IPV6_TCLASS = 0x3d + IPV6_UNICAST_HOPS = 0x4 + IPV6_USE_MIN_MTU = 0x2a + IPV6_V6ONLY = 0x1b + IPV6_VERSION = 0x60 + IPV6_VERSION_MASK = 0xf0 + IP_ADD_MEMBERSHIP = 0xc + IP_ADD_SOURCE_MEMBERSHIP = 0x46 + IP_BINDANY = 0x18 + IP_BLOCK_SOURCE = 0x48 + IP_DEFAULT_MULTICAST_LOOP = 0x1 + IP_DEFAULT_MULTICAST_TTL = 0x1 + IP_DF = 0x4000 + IP_DONTFRAG = 0x43 + IP_DROP_MEMBERSHIP = 0xd + IP_DROP_SOURCE_MEMBERSHIP = 0x47 + IP_DUMMYNET3 = 0x31 + IP_DUMMYNET_CONFIGURE = 0x3c + IP_DUMMYNET_DEL = 0x3d + IP_DUMMYNET_FLUSH = 0x3e + IP_DUMMYNET_GET = 0x40 + IP_FAITH = 0x16 + IP_FW3 = 0x30 + IP_FW_ADD = 0x32 + IP_FW_DEL = 0x33 + IP_FW_FLUSH = 0x34 + IP_FW_GET = 0x36 + IP_FW_NAT_CFG = 0x38 + IP_FW_NAT_DEL = 0x39 + IP_FW_NAT_GET_CONFIG = 0x3a + IP_FW_NAT_GET_LOG = 0x3b + IP_FW_RESETLOG = 0x37 + IP_FW_TABLE_ADD = 0x28 + IP_FW_TABLE_DEL = 0x29 + IP_FW_TABLE_FLUSH = 0x2a + IP_FW_TABLE_GETSIZE = 0x2b + IP_FW_TABLE_LIST = 0x2c + IP_FW_ZERO = 0x35 + IP_HDRINCL = 0x2 + IP_IPSEC_POLICY = 0x15 + IP_MAXPACKET = 0xffff + IP_MAX_GROUP_SRC_FILTER = 0x200 + IP_MAX_MEMBERSHIPS = 0xfff + IP_MAX_SOCK_MUTE_FILTER = 0x80 + IP_MAX_SOCK_SRC_FILTER = 0x80 + IP_MAX_SOURCE_FILTER = 0x400 + IP_MF = 0x2000 + IP_MINTTL = 0x42 + IP_MIN_MEMBERSHIPS = 0x1f + IP_MSFILTER = 0x4a + IP_MSS = 0x240 + IP_MULTICAST_IF = 0x9 + IP_MULTICAST_LOOP = 0xb + IP_MULTICAST_TTL = 0xa + IP_MULTICAST_VIF = 0xe + IP_OFFMASK = 0x1fff + IP_ONESBCAST = 0x17 + IP_OPTIONS = 0x1 + IP_PORTRANGE = 0x13 + IP_PORTRANGE_DEFAULT = 0 + IP_PORTRANGE_HIGH = 0x1 + IP_PORTRANGE_LOW = 0x2 + IP_RECVDSTADDR = 0x7 + IP_RECVIF = 0x14 + IP_RECVOPTS = 0x5 + IP_RECVRETOPTS = 0x6 + IP_RECVTTL = 0x41 + IP_RETOPTS = 0x8 + IP_RF = 0x8000 + IP_RSVP_OFF = 0x10 + IP_RSVP_ON = 0xf + IP_RSVP_VIF_OFF = 0x12 + IP_RSVP_VIF_ON = 0x11 + IP_SENDSRCADDR = 0x7 + IP_TOS = 0x3 + IP_TTL = 0x4 + IP_UNBLOCK_SOURCE = 0x49 + MSG_COMPAT = 0x8000 + MSG_CTRUNC = 0x20 + MSG_DONTROUTE = 0x4 + MSG_DONTWAIT = 0x80 + MSG_EOF = 0x100 + MSG_EOR = 0x8 + MSG_NBIO = 0x4000 + MSG_NOSIGNAL = 0x20000 + MSG_NOTIFICATION = 0x2000 + MSG_OOB = 0x1 + MSG_PEEK = 0x2 + MSG_TRUNC = 0x10 + MSG_WAITALL = 0x40 + NET_RT_DUMP = 0x1 + NET_RT_FLAGS = 0x2 + NET_RT_IFLIST = 0x3 + NET_RT_IFMALIST = 0x4 + NET_RT_MAXID = 0x5 + O_ACCMODE = 0x3 + O_APPEND = 0x8 + O_ASYNC = 0x40 + O_CREAT = 0x200 + O_DIRECT = 0x10000 + O_DIRECTORY = 0x20000 + O_EXCL = 0x800 + O_EXEC = 0x40000 + O_EXLOCK = 0x20 + O_FSYNC = 0x80 + O_NDELAY = 0x4 + O_NOCTTY = 0x8000 + O_NOFOLLOW = 0x100 + O_NONBLOCK = 0x4 + O_RDONLY = 0 + O_RDWR = 0x2 + O_SHLOCK = 0x10 + O_SYNC = 0x80 + O_TRUNC = 0x400 + O_TTY_INIT = 0x80000 + O_WRONLY = 0x1 + RTAX_AUTHOR = 0x6 + RTAX_BRD = 0x7 + RTAX_DST = 0 + RTAX_GATEWAY = 0x1 + RTAX_GENMASK = 0x3 + RTAX_IFA = 0x5 + RTAX_IFP = 0x4 + RTAX_MAX = 0x8 + RTAX_NETMASK = 0x2 + RTA_AUTHOR = 0x40 + RTA_BRD = 0x80 + RTA_DST = 0x1 + RTA_GATEWAY = 0x2 + RTA_GENMASK = 0x8 + RTA_IFA = 0x20 + RTA_IFP = 0x10 + RTA_NETMASK = 0x4 + RTF_BLACKHOLE = 0x1000 + RTF_BROADCAST = 0x400000 + RTF_DONE = 0x40 + RTF_DYNAMIC = 0x10 + RTF_FMASK = 0x1004d808 + RTF_GATEWAY = 0x2 + RTF_HOST = 0x4 + RTF_LLDATA = 0x400 + RTF_LLINFO = 0x400 + RTF_LOCAL = 0x200000 + RTF_MODIFIED = 0x20 + RTF_MULTICAST = 0x800000 + RTF_PINNED = 0x100000 + RTF_PRCLONING = 0x10000 + RTF_PROTO1 = 0x8000 + RTF_PROTO2 = 0x4000 + RTF_PROTO3 = 0x40000 + RTF_REJECT = 0x8 + RTF_RNH_LOCKED = 0x40000000 + RTF_STATIC = 0x800 + RTF_STICKY = 0x10000000 + RTF_UP = 0x1 + RTF_XRESOLVE = 0x200 + RTM_ADD = 0x1 + RTM_CHANGE = 0x3 + RTM_DELADDR = 0xd + RTM_DELETE = 0x2 + RTM_DELMADDR = 0x10 + RTM_GET = 0x4 + RTM_IEEE80211 = 0x12 + RTM_IFANNOUNCE = 0x11 + RTM_IFINFO = 0xe + RTM_LOCK = 0x8 + RTM_LOSING = 0x5 + RTM_MISS = 0x7 + RTM_NEWADDR = 0xc + RTM_NEWMADDR = 0xf + RTM_OLDADD = 0x9 + RTM_OLDDEL = 0xa + RTM_REDIRECT = 0x6 + RTM_RESOLVE = 0xb + RTM_RTTUNIT = 0xf4240 + RTM_VERSION = 0x5 + RTV_EXPIRE = 0x4 + RTV_HOPCOUNT = 0x2 + RTV_MTU = 0x1 + RTV_RPIPE = 0x8 + RTV_RTT = 0x40 + RTV_RTTVAR = 0x80 + RTV_SPIPE = 0x10 + RTV_SSTHRESH = 0x20 + RTV_WEIGHT = 0x100 + SCM_BINTIME = 0x4 + SCM_CREDS = 0x3 + SCM_RIGHTS = 0x1 + SCM_TIMESTAMP = 0x2 + SHUT_RD = 0 + SHUT_RDWR = 0x2 + SHUT_WR = 0x1 + SIGABRT = 0x6 + SIGALRM = 0xe + SIGBUS = 0xa + SIGCHLD = 0x14 + SIGCONT = 0x13 + SIGEMT = 0x7 + SIGFPE = 0x8 + SIGHUP = 0x1 + SIGILL = 0x4 + SIGINFO = 0x1d + SIGINT = 0x2 + SIGIO = 0x17 + SIGIOT = 0x6 + SIGKILL = 0x9 + SIGLWP = 0x20 + SIGPIPE = 0xd + SIGPROF = 0x1b + SIGQUIT = 0x3 + SIGSEGV = 0xb + SIGSTOP = 0x11 + SIGSYS = 0xc + SIGTERM = 0xf + SIGTHR = 0x20 + SIGTRAP = 0x5 + SIGTSTP = 0x12 + SIGTTIN = 0x15 + SIGTTOU = 0x16 + SIGURG = 0x10 + SIGUSR1 = 0x1e + SIGUSR2 = 0x1f + SIGVTALRM = 0x1a + SIGWINCH = 0x1c + SIGXCPU = 0x18 + SIGXFSZ = 0x19 + SIOCADDMULTI = 0x80206931 + SIOCADDRT = 0x8040720a + SIOCAIFADDR = 0x8040691a + SIOCAIFGROUP = 0x80286987 + SIOCALIFADDR = 0x8118691b + SIOCATMARK = 0x40047307 + SIOCDELMULTI = 0x80206932 + SIOCDELRT = 0x8040720b + SIOCDIFADDR = 0x80206919 + SIOCDIFGROUP = 0x80286989 + SIOCDIFPHYADDR = 0x80206949 + SIOCDLIFADDR = 0x8118691d + SIOCGDRVSPEC = 0xc028697b + SIOCGETSGCNT = 0xc0207210 + SIOCGETVIFCNT = 0xc028720f + SIOCGHIWAT = 0x40047301 + SIOCGIFADDR = 0xc0206921 + SIOCGIFBRDADDR = 0xc0206923 + SIOCGIFCAP = 0xc020691f + SIOCGIFCONF = 0xc0106924 + SIOCGIFDESCR = 0xc020692a + SIOCGIFDSTADDR = 0xc0206922 + SIOCGIFFLAGS = 0xc0206911 + SIOCGIFGENERIC = 0xc020693a + SIOCGIFGMEMB = 0xc028698a + SIOCGIFGROUP = 0xc0286988 + SIOCGIFINDEX = 0xc0206920 + SIOCGIFMAC = 0xc0206926 + SIOCGIFMEDIA = 0xc0306938 + SIOCGIFMETRIC = 0xc0206917 + SIOCGIFMTU = 0xc0206933 + SIOCGIFNETMASK = 0xc0206925 + SIOCGIFPDSTADDR = 0xc0206948 + SIOCGIFPHYS = 0xc0206935 + SIOCGIFPSRCADDR = 0xc0206947 + SIOCGIFSTATUS = 0xc331693b + SIOCGLIFADDR = 0xc118691c + SIOCGLIFPHYADDR = 0xc118694b + SIOCGLOWAT = 0x40047303 + SIOCGPGRP = 0x40047309 + SIOCGPRIVATE_0 = 0xc0206950 + SIOCGPRIVATE_1 = 0xc0206951 + SIOCIFCREATE = 0xc020697a + SIOCIFCREATE2 = 0xc020697c + SIOCIFDESTROY = 0x80206979 + SIOCIFGCLONERS = 0xc0106978 + SIOCSDRVSPEC = 0x8028697b + SIOCSHIWAT = 0x80047300 + SIOCSIFADDR = 0x8020690c + SIOCSIFBRDADDR = 0x80206913 + SIOCSIFCAP = 0x8020691e + SIOCSIFDESCR = 0x80206929 + SIOCSIFDSTADDR = 0x8020690e + SIOCSIFFLAGS = 0x80206910 + SIOCSIFGENERIC = 0x80206939 + SIOCSIFLLADDR = 0x8020693c + SIOCSIFMAC = 0x80206927 + SIOCSIFMEDIA = 0xc0206937 + SIOCSIFMETRIC = 0x80206918 + SIOCSIFMTU = 0x80206934 + SIOCSIFNAME = 0x80206928 + SIOCSIFNETMASK = 0x80206916 + SIOCSIFPHYADDR = 0x80406946 + SIOCSIFPHYS = 0x80206936 + SIOCSIFRVNET = 0xc020695b + SIOCSIFVNET = 0xc020695a + SIOCSLIFPHYADDR = 0x8118694a + SIOCSLOWAT = 0x80047302 + SIOCSPGRP = 0x80047308 + SOCK_DGRAM = 0x2 + SOCK_MAXADDRLEN = 0xff + SOCK_RAW = 0x3 + SOCK_RDM = 0x4 + SOCK_SEQPACKET = 0x5 + SOCK_STREAM = 0x1 + SOL_SOCKET = 0xffff + SOMAXCONN = 0x80 + SO_ACCEPTCONN = 0x2 + SO_ACCEPTFILTER = 0x1000 + SO_BINTIME = 0x2000 + SO_BROADCAST = 0x20 + SO_DEBUG = 0x1 + SO_DONTROUTE = 0x10 + SO_ERROR = 0x1007 + SO_KEEPALIVE = 0x8 + SO_LABEL = 0x1009 + SO_LINGER = 0x80 + SO_LISTENINCQLEN = 0x1013 + SO_LISTENQLEN = 0x1012 + SO_LISTENQLIMIT = 0x1011 + SO_NOSIGPIPE = 0x800 + SO_NO_DDP = 0x8000 + SO_NO_OFFLOAD = 0x4000 + SO_OOBINLINE = 0x100 + SO_PEERLABEL = 0x1010 + SO_RCVBUF = 0x1002 + SO_RCVLOWAT = 0x1004 + SO_RCVTIMEO = 0x1006 + SO_REUSEADDR = 0x4 + SO_REUSEPORT = 0x200 + SO_SETFIB = 0x1014 + SO_SNDBUF = 0x1001 + SO_SNDLOWAT = 0x1003 + SO_SNDTIMEO = 0x1005 + SO_TIMESTAMP = 0x400 + SO_TYPE = 0x1008 + SO_USELOOPBACK = 0x40 + TCP_CA_NAME_MAX = 0x10 + TCP_CONGESTION = 0x40 + TCP_INFO = 0x20 + TCP_MAXBURST = 0x4 + TCP_MAXHLEN = 0x3c + TCP_MAXOLEN = 0x28 + TCP_MAXSEG = 0x2 + TCP_MAXWIN = 0xffff + TCP_MAX_SACK = 0x4 + TCP_MAX_WINSHIFT = 0xe + TCP_MD5SIG = 0x10 + TCP_MINMSS = 0xd8 + TCP_MSS = 0x200 + TCP_NODELAY = 0x1 + TCP_NOOPT = 0x8 + TCP_NOPUSH = 0x4 + WCONTINUED = 0x4 + WCOREFLAG = 0x80 + WLINUXCLONE = 0x80000000 + WNOHANG = 0x1 + WNOWAIT = 0x8 + WSTOPPED = 0x2 + WUNTRACED = 0x2 ) // Types diff --git a/src/pkg/syscall/zerrors_linux_386.go b/src/pkg/syscall/zerrors_linux_386.go index a73a94961..3fc7cc738 100644 --- a/src/pkg/syscall/zerrors_linux_386.go +++ b/src/pkg/syscall/zerrors_linux_386.go @@ -48,6 +48,15 @@ const ( AF_UNSPEC = 0 AF_WANPIPE = 0x19 AF_X25 = 0x9 + DT_BLK = 0x6 + DT_CHR = 0x2 + DT_DIR = 0x4 + DT_FIFO = 0x1 + DT_LNK = 0xa + DT_REG = 0x8 + DT_SOCK = 0xc + DT_UNKNOWN = 0 + DT_WHT = 0xe E2BIG = 0x7 EACCES = 0xd EADDRINUSE = 0x62 @@ -408,6 +417,27 @@ const ( IP_TOS = 0x1 IP_TTL = 0x2 IP_UNBLOCK_SOURCE = 0x25 + LINUX_REBOOT_CMD_CAD_OFF = 0 + LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef + LINUX_REBOOT_CMD_HALT = 0xcdef0123 + LINUX_REBOOT_CMD_KEXEC = 0x45584543 + LINUX_REBOOT_CMD_POWER_OFF = 0x4321fedc + LINUX_REBOOT_CMD_RESTART = 0x1234567 + LINUX_REBOOT_CMD_RESTART2 = 0xa1b2c3d4 + LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2 + LINUX_REBOOT_MAGIC1 = 0xfee1dead + LINUX_REBOOT_MAGIC2 = 0x28121969 + MADV_DOFORK = 0xb + MADV_DONTFORK = 0xa + MADV_DONTNEED = 0x4 + MADV_HWPOISON = 0x64 + MADV_MERGEABLE = 0xc + MADV_NORMAL = 0 + MADV_RANDOM = 0x1 + MADV_REMOVE = 0x9 + MADV_SEQUENTIAL = 0x2 + MADV_UNMERGEABLE = 0xd + MADV_WILLNEED = 0x3 MAP_32BIT = 0x40 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 @@ -426,6 +456,9 @@ const ( MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 + MNT_DETACH = 0x2 + MNT_EXPIRE = 0x4 + MNT_FORCE = 0x1 MSG_CMSG_CLOEXEC = 0x40000000 MSG_CONFIRM = 0x800 MSG_CTRUNC = 0x8 @@ -444,6 +477,22 @@ const ( MSG_TRUNC = 0x20 MSG_TRYHARD = 0x4 MSG_WAITALL = 0x100 + MS_ASYNC = 0x1 + MS_BIND = 0x1000 + MS_INVALIDATE = 0x2 + MS_MANDLOCK = 0x40 + MS_MGC_MSK = 0xffff0000 + MS_MGC_VAL = 0xc0ed0000 + MS_NOATIME = 0x400 + MS_NODEV = 0x4 + MS_NODIRATIME = 0x800 + MS_NOEXEC = 0x8 + MS_NOSUID = 0x2 + MS_RDONLY = 0x1 + MS_REMOUNT = 0x20 + MS_RMT_MASK = 0xc51 + MS_SYNC = 0x4 + MS_SYNCHRONOUS = 0x10 NAME_MAX = 0xff O_ACCMODE = 0x3 O_APPEND = 0x400 @@ -702,6 +751,7 @@ const ( SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 + S_APPEND = 0x100 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 @@ -712,6 +762,7 @@ const ( S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 + S_IMMUTABLE = 0x200 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 @@ -729,6 +780,7 @@ const ( S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 + S_WRITE = 0x80 TCP_CONGESTION = 0xd TCP_CORK = 0x3 TCP_DEFER_ACCEPT = 0x9 diff --git a/src/pkg/syscall/zerrors_linux_amd64.go b/src/pkg/syscall/zerrors_linux_amd64.go index eea55a275..d5efdf55d 100644 --- a/src/pkg/syscall/zerrors_linux_amd64.go +++ b/src/pkg/syscall/zerrors_linux_amd64.go @@ -48,6 +48,15 @@ const ( AF_UNSPEC = 0 AF_WANPIPE = 0x19 AF_X25 = 0x9 + DT_BLK = 0x6 + DT_CHR = 0x2 + DT_DIR = 0x4 + DT_FIFO = 0x1 + DT_LNK = 0xa + DT_REG = 0x8 + DT_SOCK = 0xc + DT_UNKNOWN = 0 + DT_WHT = 0xe E2BIG = 0x7 EACCES = 0xd EADDRINUSE = 0x62 @@ -408,6 +417,27 @@ const ( IP_TOS = 0x1 IP_TTL = 0x2 IP_UNBLOCK_SOURCE = 0x25 + LINUX_REBOOT_CMD_CAD_OFF = 0 + LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef + LINUX_REBOOT_CMD_HALT = 0xcdef0123 + LINUX_REBOOT_CMD_KEXEC = 0x45584543 + LINUX_REBOOT_CMD_POWER_OFF = 0x4321fedc + LINUX_REBOOT_CMD_RESTART = 0x1234567 + LINUX_REBOOT_CMD_RESTART2 = 0xa1b2c3d4 + LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2 + LINUX_REBOOT_MAGIC1 = 0xfee1dead + LINUX_REBOOT_MAGIC2 = 0x28121969 + MADV_DOFORK = 0xb + MADV_DONTFORK = 0xa + MADV_DONTNEED = 0x4 + MADV_HWPOISON = 0x64 + MADV_MERGEABLE = 0xc + MADV_NORMAL = 0 + MADV_RANDOM = 0x1 + MADV_REMOVE = 0x9 + MADV_SEQUENTIAL = 0x2 + MADV_UNMERGEABLE = 0xd + MADV_WILLNEED = 0x3 MAP_32BIT = 0x40 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 @@ -426,6 +456,9 @@ const ( MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 + MNT_DETACH = 0x2 + MNT_EXPIRE = 0x4 + MNT_FORCE = 0x1 MSG_CMSG_CLOEXEC = 0x40000000 MSG_CONFIRM = 0x800 MSG_CTRUNC = 0x8 @@ -444,6 +477,22 @@ const ( MSG_TRUNC = 0x20 MSG_TRYHARD = 0x4 MSG_WAITALL = 0x100 + MS_ASYNC = 0x1 + MS_BIND = 0x1000 + MS_INVALIDATE = 0x2 + MS_MANDLOCK = 0x40 + MS_MGC_MSK = 0xffff0000 + MS_MGC_VAL = 0xc0ed0000 + MS_NOATIME = 0x400 + MS_NODEV = 0x4 + MS_NODIRATIME = 0x800 + MS_NOEXEC = 0x8 + MS_NOSUID = 0x2 + MS_RDONLY = 0x1 + MS_REMOUNT = 0x20 + MS_RMT_MASK = 0xc51 + MS_SYNC = 0x4 + MS_SYNCHRONOUS = 0x10 NAME_MAX = 0xff O_ACCMODE = 0x3 O_APPEND = 0x400 @@ -703,6 +752,7 @@ const ( SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 + S_APPEND = 0x100 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 @@ -713,6 +763,7 @@ const ( S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 + S_IMMUTABLE = 0x200 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 @@ -730,6 +781,7 @@ const ( S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 + S_WRITE = 0x80 TCP_CONGESTION = 0xd TCP_CORK = 0x3 TCP_DEFER_ACCEPT = 0x9 diff --git a/src/pkg/syscall/zerrors_linux_arm.go b/src/pkg/syscall/zerrors_linux_arm.go index 1f8b1830b..356d51ca5 100644 --- a/src/pkg/syscall/zerrors_linux_arm.go +++ b/src/pkg/syscall/zerrors_linux_arm.go @@ -379,6 +379,35 @@ const ( IP_TOS = 0x1 IP_TTL = 0x2 IP_UNBLOCK_SOURCE = 0x25 + LINUX_REBOOT_CMD_CAD_OFF = 0 + LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef + LINUX_REBOOT_CMD_HALT = 0xcdef0123 + LINUX_REBOOT_CMD_KEXEC = 0x45584543 + LINUX_REBOOT_CMD_POWER_OFF = 0x4321fedc + LINUX_REBOOT_CMD_RESTART = 0x1234567 + LINUX_REBOOT_CMD_RESTART2 = 0xa1b2c3d4 + LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2 + LINUX_REBOOT_MAGIC1 = 0xfee1dead + LINUX_REBOOT_MAGIC2 = 0x28121969 + MNT_DETACH = 0x2 + MNT_EXPIRE = 0x4 + MNT_FORCE = 0x1 + MS_ASYNC = 0x1 + MS_BIND = 0x1000 + MS_INVALIDATE = 0x2 + MS_MANDLOCK = 0x40 + MS_MGC_MSK = 0xffff0000 + MS_MGC_VAL = 0xc0ed0000 + MS_NOATIME = 0x400 + MS_NODEV = 0x4 + MS_NODIRATIME = 0x800 + MS_NOEXEC = 0x8 + MS_NOSUID = 0x2 + MS_RDONLY = 0x1 + MS_REMOUNT = 0x20 + MS_RMT_MASK = 0xc51 + MS_SYNC = 0x4 + MS_SYNCHRONOUS = 0x10 NAME_MAX = 0xff O_ACCMODE = 0x3 O_APPEND = 0x400 @@ -542,6 +571,7 @@ const ( SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 + S_APPEND = 0x100 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 @@ -552,6 +582,7 @@ const ( S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 + S_IMMUTABLE = 0x200 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 @@ -569,6 +600,7 @@ const ( S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 + S_WRITE = 0x80 TCP_CONGESTION = 0xd TCP_CORK = 0x3 TCP_DEFER_ACCEPT = 0x9 diff --git a/src/pkg/syscall/zerrors_plan9_386.go b/src/pkg/syscall/zerrors_plan9_386.go new file mode 100644 index 000000000..78b5c72bb --- /dev/null +++ b/src/pkg/syscall/zerrors_plan9_386.go @@ -0,0 +1,25 @@ +package syscall + +// Constants +const ( + // Invented values to support what package os expects. + O_CREAT = 0x02000 + O_NOCTTY = 0x00000 + O_TRUNC = 0x00000 + O_NONBLOCK = 0x00000 + O_APPEND = 0x00000 + O_SYNC = 0x00000 + O_ASYNC = 0x00000 + + + S_IFMT = 0x1f000 + S_IFIFO = 0x1000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFBLK = 0x6000 + S_IFREG = 0x8000 + S_IFLNK = 0xa000 + S_IFSOCK = 0xc000 +) + +// Error table diff --git a/src/pkg/syscall/zsyscall_darwin_386.go b/src/pkg/syscall/zsyscall_darwin_386.go index 973f00ef8..2f5b2703b 100644 --- a/src/pkg/syscall/zsyscall_darwin_386.go +++ b/src/pkg/syscall/zsyscall_darwin_386.go @@ -1,4 +1,4 @@ -// mksyscall.sh -l32 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go +// mksyscall.pl -l32 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT package syscall @@ -8,7 +8,7 @@ import "unsafe" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, errno int) { - r0, _, e1 := Syscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) errno = int(e1) return @@ -17,7 +17,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (errno int) { - _, _, e1 := Syscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) errno = int(e1) return } @@ -34,7 +34,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, errno int) { - r0, r1, e1 := Syscall(SYS_PIPE, 0, 0, 0) + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) r = int(r0) w = int(r1) errno = int(e1) @@ -69,7 +69,7 @@ func connect(s int, addr uintptr, addrlen _Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) errno = int(e1) return @@ -77,6 +77,14 @@ func socket(domain int, typ int, proto int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) errno = int(e1) @@ -86,7 +94,7 @@ func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -94,7 +102,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -110,7 +118,7 @@ func Shutdown(s int, how int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) { - _, _, e1 := Syscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) errno = int(e1) return } @@ -194,6 +202,23 @@ func fcntl(fd int, cmd int, arg int) (val int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) { + r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) + ret = uintptr(r0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (errno int) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (errno int) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) errno = int(e1) @@ -267,7 +292,7 @@ func Close(fd int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) errno = int(e1) return @@ -276,7 +301,7 @@ func Dup(fd int) (nfd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (errno int) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + _, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0) errno = int(e1) return } @@ -403,7 +428,7 @@ func Getdtablesize() (size int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } @@ -411,7 +436,7 @@ func Getegid() (egid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { - r0, _, _ := Syscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } @@ -434,7 +459,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := Syscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } @@ -442,7 +467,7 @@ func Getgid() (gid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, errno int) { - r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) errno = int(e1) return @@ -451,7 +476,7 @@ func Getpgid(pid int) (pgid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { - r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } @@ -459,7 +484,7 @@ func Getpgrp() (pgrp int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } @@ -467,7 +492,7 @@ func Getpid() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } @@ -484,7 +509,7 @@ func Getpriority(which int, who int) (prio int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) errno = int(e1) return } @@ -492,7 +517,7 @@ func Getrlimit(which int, lim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (errno int) { - _, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) errno = int(e1) return } @@ -500,7 +525,7 @@ func Getrusage(who int, rusage *Rusage) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, errno int) { - r0, _, e1 := Syscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) errno = int(e1) return @@ -509,7 +534,7 @@ func Getsid(pid int) (sid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := Syscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } @@ -517,7 +542,7 @@ func Getuid() (uid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { - r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } @@ -717,7 +742,7 @@ func Setegid(egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETEUID, uintptr(euid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) errno = int(e1) return } @@ -725,7 +750,7 @@ func Seteuid(euid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (errno int) { - _, _, e1 := Syscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) errno = int(e1) return } @@ -741,7 +766,7 @@ func Setlogin(name string) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) errno = int(e1) return } @@ -765,7 +790,7 @@ func Setprivexec(flag int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) errno = int(e1) return } @@ -773,7 +798,7 @@ func Setregid(rgid int, egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) errno = int(e1) return } @@ -781,7 +806,7 @@ func Setreuid(ruid int, euid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) errno = int(e1) return } @@ -789,7 +814,7 @@ func Setrlimit(which int, lim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, errno int) { - r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) errno = int(e1) return @@ -798,7 +823,7 @@ func Setsid() (pid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) errno = int(e1) return } @@ -806,7 +831,7 @@ func Settimeofday(tp *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (errno int) { - _, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) errno = int(e1) return } @@ -919,7 +944,7 @@ func write(fd int, buf *byte, nbuf int) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tp *Timeval) (sec int32, usec int32, errno int) { - r0, r1, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) sec = int32(r0) usec = int32(r1) errno = int(e1) diff --git a/src/pkg/syscall/zsyscall_darwin_amd64.go b/src/pkg/syscall/zsyscall_darwin_amd64.go index f7a37b63e..995c710b4 100644 --- a/src/pkg/syscall/zsyscall_darwin_amd64.go +++ b/src/pkg/syscall/zsyscall_darwin_amd64.go @@ -1,4 +1,4 @@ -// mksyscall.sh syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go +// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT package syscall @@ -8,7 +8,7 @@ import "unsafe" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, errno int) { - r0, _, e1 := Syscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) errno = int(e1) return @@ -17,7 +17,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (errno int) { - _, _, e1 := Syscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) errno = int(e1) return } @@ -34,7 +34,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, errno int) { - r0, r1, e1 := Syscall(SYS_PIPE, 0, 0, 0) + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) r = int(r0) w = int(r1) errno = int(e1) @@ -69,7 +69,7 @@ func connect(s int, addr uintptr, addrlen _Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) errno = int(e1) return @@ -77,6 +77,14 @@ func socket(domain int, typ int, proto int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) errno = int(e1) @@ -86,7 +94,7 @@ func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -94,7 +102,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -110,7 +118,7 @@ func Shutdown(s int, how int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) { - _, _, e1 := Syscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) errno = int(e1) return } @@ -194,6 +202,23 @@ func fcntl(fd int, cmd int, arg int) (val int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) { + r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + ret = uintptr(r0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (errno int) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (errno int) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) errno = int(e1) @@ -267,7 +292,7 @@ func Close(fd int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) errno = int(e1) return @@ -276,7 +301,7 @@ func Dup(fd int) (nfd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (errno int) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + _, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0) errno = int(e1) return } @@ -403,7 +428,7 @@ func Getdtablesize() (size int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } @@ -411,7 +436,7 @@ func Getegid() (egid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { - r0, _, _ := Syscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } @@ -434,7 +459,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := Syscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } @@ -442,7 +467,7 @@ func Getgid() (gid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, errno int) { - r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) errno = int(e1) return @@ -451,7 +476,7 @@ func Getpgid(pid int) (pgid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { - r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } @@ -459,7 +484,7 @@ func Getpgrp() (pgrp int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } @@ -467,7 +492,7 @@ func Getpid() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } @@ -484,7 +509,7 @@ func Getpriority(which int, who int) (prio int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) errno = int(e1) return } @@ -492,7 +517,7 @@ func Getrlimit(which int, lim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (errno int) { - _, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) errno = int(e1) return } @@ -500,7 +525,7 @@ func Getrusage(who int, rusage *Rusage) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, errno int) { - r0, _, e1 := Syscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) errno = int(e1) return @@ -509,7 +534,7 @@ func Getsid(pid int) (sid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := Syscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } @@ -517,7 +542,7 @@ func Getuid() (uid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { - r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } @@ -717,7 +742,7 @@ func Setegid(egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETEUID, uintptr(euid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) errno = int(e1) return } @@ -725,7 +750,7 @@ func Seteuid(euid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (errno int) { - _, _, e1 := Syscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) errno = int(e1) return } @@ -741,7 +766,7 @@ func Setlogin(name string) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) errno = int(e1) return } @@ -765,7 +790,7 @@ func Setprivexec(flag int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) errno = int(e1) return } @@ -773,7 +798,7 @@ func Setregid(rgid int, egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) errno = int(e1) return } @@ -781,7 +806,7 @@ func Setreuid(ruid int, euid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) errno = int(e1) return } @@ -789,7 +814,7 @@ func Setrlimit(which int, lim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, errno int) { - r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) errno = int(e1) return @@ -798,7 +823,7 @@ func Setsid() (pid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) errno = int(e1) return } @@ -806,7 +831,7 @@ func Settimeofday(tp *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (errno int) { - _, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) errno = int(e1) return } @@ -919,7 +944,7 @@ func write(fd int, buf *byte, nbuf int) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tp *Timeval) (sec int64, usec int32, errno int) { - r0, r1, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) sec = int64(r0) usec = int32(r1) errno = int(e1) diff --git a/src/pkg/syscall/zsyscall_freebsd_386.go b/src/pkg/syscall/zsyscall_freebsd_386.go index 1fab5e2d2..0ffb9a4b9 100644 --- a/src/pkg/syscall/zsyscall_freebsd_386.go +++ b/src/pkg/syscall/zsyscall_freebsd_386.go @@ -1,4 +1,4 @@ -// mksyscall.sh -l32 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go +// mksyscall.pl -l32 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT package syscall @@ -8,7 +8,7 @@ import "unsafe" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, errno int) { - r0, _, e1 := Syscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) errno = int(e1) return @@ -17,7 +17,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (errno int) { - _, _, e1 := Syscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) errno = int(e1) return } @@ -34,7 +34,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, errno int) { - r0, r1, e1 := Syscall(SYS_PIPE, 0, 0, 0) + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) r = int(r0) w = int(r1) errno = int(e1) @@ -69,7 +69,7 @@ func connect(s int, addr uintptr, addrlen _Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) errno = int(e1) return @@ -77,6 +77,14 @@ func socket(domain int, typ int, proto int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) errno = int(e1) @@ -86,7 +94,7 @@ func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -94,7 +102,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -110,7 +118,7 @@ func Shutdown(s int, how int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) { - _, _, e1 := Syscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) errno = int(e1) return } @@ -194,6 +202,23 @@ func fcntl(fd int, cmd int, arg int) (val int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) { + r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) + ret = uintptr(r0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (errno int) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (errno int) { _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0) errno = int(e1) @@ -259,7 +284,7 @@ func Close(fd int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) errno = int(e1) return @@ -268,7 +293,7 @@ func Dup(fd int) (nfd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (errno int) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + _, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0) errno = int(e1) return } @@ -387,7 +412,7 @@ func Getdtablesize() (size int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } @@ -395,7 +420,7 @@ func Getegid() (egid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { - r0, _, _ := Syscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } @@ -418,7 +443,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := Syscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } @@ -426,7 +451,7 @@ func Getgid() (gid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, errno int) { - r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) errno = int(e1) return @@ -435,7 +460,7 @@ func Getpgid(pid int) (pgid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { - r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } @@ -443,7 +468,7 @@ func Getpgrp() (pgrp int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } @@ -451,7 +476,7 @@ func Getpid() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } @@ -468,7 +493,7 @@ func Getpriority(which int, who int) (prio int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) errno = int(e1) return } @@ -476,7 +501,7 @@ func Getrlimit(which int, lim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (errno int) { - _, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) errno = int(e1) return } @@ -484,7 +509,7 @@ func Getrusage(who int, rusage *Rusage) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, errno int) { - r0, _, e1 := Syscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) errno = int(e1) return @@ -493,7 +518,7 @@ func Getsid(pid int) (sid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) errno = int(e1) return } @@ -501,7 +526,7 @@ func Gettimeofday(tv *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := Syscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } @@ -717,7 +742,7 @@ func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (errno int) { - _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) errno = int(e1) return } @@ -725,7 +750,7 @@ func Setegid(egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETEUID, uintptr(euid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) errno = int(e1) return } @@ -733,7 +758,7 @@ func Seteuid(euid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (errno int) { - _, _, e1 := Syscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) errno = int(e1) return } @@ -749,7 +774,7 @@ func Setlogin(name string) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) errno = int(e1) return } @@ -765,7 +790,7 @@ func Setpriority(which int, who int, prio int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) errno = int(e1) return } @@ -773,7 +798,7 @@ func Setregid(rgid int, egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) errno = int(e1) return } @@ -781,7 +806,7 @@ func Setreuid(ruid int, euid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) errno = int(e1) return } @@ -789,7 +814,7 @@ func Setrlimit(which int, lim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, errno int) { - r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) errno = int(e1) return @@ -798,7 +823,7 @@ func Setsid() (pid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) errno = int(e1) return } @@ -806,7 +831,7 @@ func Settimeofday(tp *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (errno int) { - _, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) errno = int(e1) return } diff --git a/src/pkg/syscall/zsyscall_freebsd_amd64.go b/src/pkg/syscall/zsyscall_freebsd_amd64.go index 53434b263..38a06ae3b 100644 --- a/src/pkg/syscall/zsyscall_freebsd_amd64.go +++ b/src/pkg/syscall/zsyscall_freebsd_amd64.go @@ -1,4 +1,4 @@ -// mksyscall.sh syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go +// mksyscall.pl syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT package syscall @@ -8,7 +8,7 @@ import "unsafe" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, errno int) { - r0, _, e1 := Syscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) errno = int(e1) return @@ -17,7 +17,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (errno int) { - _, _, e1 := Syscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) errno = int(e1) return } @@ -34,7 +34,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, errno int) { - r0, r1, e1 := Syscall(SYS_PIPE, 0, 0, 0) + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) r = int(r0) w = int(r1) errno = int(e1) @@ -69,7 +69,7 @@ func connect(s int, addr uintptr, addrlen _Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) errno = int(e1) return @@ -77,6 +77,14 @@ func socket(domain int, typ int, proto int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) errno = int(e1) @@ -86,7 +94,7 @@ func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -94,7 +102,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -110,7 +118,7 @@ func Shutdown(s int, how int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) { - _, _, e1 := Syscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) errno = int(e1) return } @@ -194,6 +202,23 @@ func fcntl(fd int, cmd int, arg int) (val int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) { + r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + ret = uintptr(r0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (errno int) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (errno int) { _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0) errno = int(e1) @@ -259,7 +284,7 @@ func Close(fd int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) errno = int(e1) return @@ -268,7 +293,7 @@ func Dup(fd int) (nfd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (errno int) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + _, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0) errno = int(e1) return } @@ -387,7 +412,7 @@ func Getdtablesize() (size int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } @@ -395,7 +420,7 @@ func Getegid() (egid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { - r0, _, _ := Syscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } @@ -418,7 +443,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := Syscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } @@ -426,7 +451,7 @@ func Getgid() (gid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, errno int) { - r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) errno = int(e1) return @@ -435,7 +460,7 @@ func Getpgid(pid int) (pgid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { - r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } @@ -443,7 +468,7 @@ func Getpgrp() (pgrp int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } @@ -451,7 +476,7 @@ func Getpid() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } @@ -468,7 +493,7 @@ func Getpriority(which int, who int) (prio int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) errno = int(e1) return } @@ -476,7 +501,7 @@ func Getrlimit(which int, lim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (errno int) { - _, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) errno = int(e1) return } @@ -484,7 +509,7 @@ func Getrusage(who int, rusage *Rusage) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, errno int) { - r0, _, e1 := Syscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) errno = int(e1) return @@ -493,7 +518,7 @@ func Getsid(pid int) (sid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) errno = int(e1) return } @@ -501,7 +526,7 @@ func Gettimeofday(tv *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := Syscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } @@ -717,7 +742,7 @@ func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (errno int) { - _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) errno = int(e1) return } @@ -725,7 +750,7 @@ func Setegid(egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETEUID, uintptr(euid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) errno = int(e1) return } @@ -733,7 +758,7 @@ func Seteuid(euid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (errno int) { - _, _, e1 := Syscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) errno = int(e1) return } @@ -749,7 +774,7 @@ func Setlogin(name string) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) errno = int(e1) return } @@ -765,7 +790,7 @@ func Setpriority(which int, who int, prio int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) errno = int(e1) return } @@ -773,7 +798,7 @@ func Setregid(rgid int, egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) errno = int(e1) return } @@ -781,7 +806,7 @@ func Setreuid(ruid int, euid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) errno = int(e1) return } @@ -789,7 +814,7 @@ func Setrlimit(which int, lim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, errno int) { - r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) errno = int(e1) return @@ -798,7 +823,7 @@ func Setsid() (pid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) errno = int(e1) return } @@ -806,7 +831,7 @@ func Settimeofday(tp *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (errno int) { - _, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) errno = int(e1) return } diff --git a/src/pkg/syscall/zsyscall_linux_386.go b/src/pkg/syscall/zsyscall_linux_386.go index 005cc1542..83f3bade1 100644 --- a/src/pkg/syscall/zsyscall_linux_386.go +++ b/src/pkg/syscall/zsyscall_linux_386.go @@ -1,4 +1,4 @@ -// mksyscall.sh -l32 syscall_linux.go syscall_linux_386.go +// mksyscall.pl -l32 syscall_linux.go syscall_linux_386.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT package syscall @@ -26,7 +26,7 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (errno int) { - _, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) + _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) errno = int(e1) return } @@ -81,6 +81,14 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func reboot(magic1 uint, magic2 uint, cmd int, arg string) (errno int) { + _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(StringBytePtr(arg))), 0, 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (errno int) { _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0) errno = int(e1) @@ -148,7 +156,7 @@ func Creat(path string, mode uint32) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) + r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) errno = int(e1) return @@ -157,7 +165,7 @@ func Dup(oldfd int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) + r0, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) fd = int(r0) errno = int(e1) return @@ -166,7 +174,7 @@ func Dup2(oldfd int, newfd int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate(size int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) + r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) fd = int(r0) errno = int(e1) return @@ -175,7 +183,7 @@ func EpollCreate(size int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) { - _, _, e1 := Syscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) + _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) errno = int(e1) return } @@ -293,7 +301,7 @@ func Getdents(fd int, buf []byte) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, errno int) { - r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) errno = int(e1) return @@ -302,7 +310,7 @@ func Getpgid(pid int) (pgid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pid int) { - r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pid = int(r0) return } @@ -310,7 +318,7 @@ func Getpgrp() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } @@ -318,7 +326,7 @@ func Getpid() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } @@ -326,7 +334,7 @@ func Getppid() (ppid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) errno = int(e1) return } @@ -334,7 +342,7 @@ func Getrlimit(resource int, rlim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (errno int) { - _, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) errno = int(e1) return } @@ -342,7 +350,7 @@ func Getrusage(who int, rusage *Rusage) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettid() (tid int) { - r0, _, _ := Syscall(SYS_GETTID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) tid = int(r0) return } @@ -359,7 +367,7 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit() (fd int, errno int) { - r0, _, e1 := Syscall(SYS_INOTIFY_INIT, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) fd = int(r0) errno = int(e1) return @@ -368,7 +376,7 @@ func InotifyInit() (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit1(flags int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) + r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) fd = int(r0) errno = int(e1) return @@ -377,7 +385,7 @@ func InotifyInit1(flags int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) { - r0, _, e1 := Syscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) + r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) success = int(r0) errno = int(e1) return @@ -386,7 +394,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig int) (errno int) { - _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) + _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) errno = int(e1) return } @@ -448,6 +456,14 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(source string, target string, fstype string, flags int, data string) (errno int) { + _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(StringBytePtr(source))), uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(unsafe.Pointer(StringBytePtr(fstype))), uintptr(flags), uintptr(unsafe.Pointer(StringBytePtr(data))), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (errno int) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) errno = int(e1) @@ -555,7 +571,7 @@ func Sethostname(p []byte) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) errno = int(e1) return } @@ -563,7 +579,7 @@ func Setpgid(pid int, pgid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(resource int, rlim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) errno = int(e1) return } @@ -571,7 +587,7 @@ func Setrlimit(resource int, rlim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, errno int) { - r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) errno = int(e1) return @@ -580,7 +596,7 @@ func Setsid() (pid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) errno = int(e1) return } @@ -588,7 +604,7 @@ func Settimeofday(tv *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (errno int) { - _, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) errno = int(e1) return } @@ -611,7 +627,7 @@ func Sync() { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sysinfo(info *Sysinfo_t) (errno int) { - _, _, e1 := Syscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) + _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) errno = int(e1) return } @@ -628,7 +644,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tgkill(tgid int, tid int, sig int) (errno int) { - _, _, e1 := Syscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) + _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) errno = int(e1) return } @@ -636,7 +652,7 @@ func Tgkill(tgid int, tid int, sig int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, errno int) { - r0, _, e1 := Syscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) + r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) ticks = uintptr(r0) errno = int(e1) return @@ -645,7 +661,7 @@ func Times(tms *Tms) (ticks uintptr, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { - r0, _, _ := Syscall(SYS_UMASK, uintptr(mask), 0, 0) + r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } @@ -653,7 +669,7 @@ func Umask(mask int) (oldmask int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (errno int) { - _, _, e1 := Syscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) + _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) errno = int(e1) return } @@ -676,6 +692,14 @@ func Unlinkat(dirfd int, path string) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unmount(target string, flags int) (errno int) { + _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(flags), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unshare(flags int) (errno int) { _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) errno = int(e1) @@ -741,6 +765,14 @@ func write(fd int, p *byte, np int) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func munmap(addr uintptr, length uintptr) (errno int) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chown(path string, uid int, gid int) (errno int) { _, _, e1 := Syscall(SYS_CHOWN32, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid)) errno = int(e1) @@ -774,7 +806,7 @@ func Ftruncate(fd int, length int64) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := Syscall(SYS_GETEGID32, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEGID32, 0, 0, 0) egid = int(r0) return } @@ -782,7 +814,7 @@ func Getegid() (egid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { - r0, _, _ := Syscall(SYS_GETEUID32, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEUID32, 0, 0, 0) euid = int(r0) return } @@ -790,7 +822,7 @@ func Geteuid() (euid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := Syscall(SYS_GETGID32, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETGID32, 0, 0, 0) gid = int(r0) return } @@ -798,7 +830,7 @@ func Getgid() (gid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := Syscall(SYS_GETUID32, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETUID32, 0, 0, 0) uid = int(r0) return } @@ -884,7 +916,7 @@ func Setfsuid(uid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (errno int) { - _, _, e1 := Syscall(SYS_SETGID32, uintptr(gid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETGID32, uintptr(gid), 0, 0) errno = int(e1) return } @@ -892,7 +924,7 @@ func Setgid(gid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0) errno = int(e1) return } @@ -900,7 +932,7 @@ func Setregid(rgid int, egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid)) + _, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid)) errno = int(e1) return } @@ -908,7 +940,7 @@ func Setresgid(rgid int, egid int, sgid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (errno int) { - _, _, e1 := Syscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid)) + _, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid)) errno = int(e1) return } @@ -916,7 +948,7 @@ func Setresuid(ruid int, euid int, suid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0) errno = int(e1) return } @@ -957,7 +989,7 @@ func Truncate(path string, length int64) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, errno int) { - r0, _, e1 := Syscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) errno = int(e1) return @@ -966,7 +998,7 @@ func getgroups(n int, list *_Gid_t) (nn int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (errno int) { - _, _, e1 := Syscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + _, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) errno = int(e1) return } @@ -982,8 +1014,17 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, errno int) { + r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) + xaddr = uintptr(r0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Gettimeofday(tv *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) errno = int(e1) return } @@ -991,7 +1032,7 @@ func Gettimeofday(tv *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, errno int) { - r0, _, e1 := Syscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) + r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) tt = Time_t(r0) errno = int(e1) return diff --git a/src/pkg/syscall/zsyscall_linux_amd64.go b/src/pkg/syscall/zsyscall_linux_amd64.go index d449a3bfe..c054349c6 100644 --- a/src/pkg/syscall/zsyscall_linux_amd64.go +++ b/src/pkg/syscall/zsyscall_linux_amd64.go @@ -1,4 +1,4 @@ -// mksyscall.sh syscall_linux.go syscall_linux_amd64.go +// mksyscall.pl syscall_linux.go syscall_linux_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT package syscall @@ -26,7 +26,7 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (errno int) { - _, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) + _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) errno = int(e1) return } @@ -81,6 +81,14 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func reboot(magic1 uint, magic2 uint, cmd int, arg string) (errno int) { + _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(StringBytePtr(arg))), 0, 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (errno int) { _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0) errno = int(e1) @@ -148,7 +156,7 @@ func Creat(path string, mode uint32) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) + r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) errno = int(e1) return @@ -157,7 +165,7 @@ func Dup(oldfd int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) + r0, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) fd = int(r0) errno = int(e1) return @@ -166,7 +174,7 @@ func Dup2(oldfd int, newfd int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate(size int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) + r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) fd = int(r0) errno = int(e1) return @@ -175,7 +183,7 @@ func EpollCreate(size int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) { - _, _, e1 := Syscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) + _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) errno = int(e1) return } @@ -293,7 +301,7 @@ func Getdents(fd int, buf []byte) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, errno int) { - r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) errno = int(e1) return @@ -302,7 +310,7 @@ func Getpgid(pid int) (pgid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pid int) { - r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pid = int(r0) return } @@ -310,7 +318,7 @@ func Getpgrp() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } @@ -318,7 +326,7 @@ func Getpid() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } @@ -326,7 +334,7 @@ func Getppid() (ppid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) errno = int(e1) return } @@ -334,7 +342,7 @@ func Getrlimit(resource int, rlim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (errno int) { - _, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) errno = int(e1) return } @@ -342,7 +350,7 @@ func Getrusage(who int, rusage *Rusage) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettid() (tid int) { - r0, _, _ := Syscall(SYS_GETTID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) tid = int(r0) return } @@ -359,7 +367,7 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit() (fd int, errno int) { - r0, _, e1 := Syscall(SYS_INOTIFY_INIT, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) fd = int(r0) errno = int(e1) return @@ -368,7 +376,7 @@ func InotifyInit() (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit1(flags int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) + r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) fd = int(r0) errno = int(e1) return @@ -377,7 +385,7 @@ func InotifyInit1(flags int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) { - r0, _, e1 := Syscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) + r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) success = int(r0) errno = int(e1) return @@ -386,7 +394,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig int) (errno int) { - _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) + _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) errno = int(e1) return } @@ -448,6 +456,14 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(source string, target string, fstype string, flags int, data string) (errno int) { + _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(StringBytePtr(source))), uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(unsafe.Pointer(StringBytePtr(fstype))), uintptr(flags), uintptr(unsafe.Pointer(StringBytePtr(data))), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (errno int) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) errno = int(e1) @@ -555,7 +571,7 @@ func Sethostname(p []byte) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) errno = int(e1) return } @@ -563,7 +579,7 @@ func Setpgid(pid int, pgid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(resource int, rlim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) errno = int(e1) return } @@ -571,7 +587,7 @@ func Setrlimit(resource int, rlim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, errno int) { - r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) errno = int(e1) return @@ -580,7 +596,7 @@ func Setsid() (pid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) errno = int(e1) return } @@ -588,7 +604,7 @@ func Settimeofday(tv *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (errno int) { - _, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) errno = int(e1) return } @@ -611,7 +627,7 @@ func Sync() { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sysinfo(info *Sysinfo_t) (errno int) { - _, _, e1 := Syscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) + _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) errno = int(e1) return } @@ -628,7 +644,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tgkill(tgid int, tid int, sig int) (errno int) { - _, _, e1 := Syscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) + _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) errno = int(e1) return } @@ -636,7 +652,7 @@ func Tgkill(tgid int, tid int, sig int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, errno int) { - r0, _, e1 := Syscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) + r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) ticks = uintptr(r0) errno = int(e1) return @@ -645,7 +661,7 @@ func Times(tms *Tms) (ticks uintptr, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { - r0, _, _ := Syscall(SYS_UMASK, uintptr(mask), 0, 0) + r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } @@ -653,7 +669,7 @@ func Umask(mask int) (oldmask int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (errno int) { - _, _, e1 := Syscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) + _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) errno = int(e1) return } @@ -676,6 +692,14 @@ func Unlinkat(dirfd int, path string) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unmount(target string, flags int) (errno int) { + _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(flags), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unshare(flags int) (errno int) { _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) errno = int(e1) @@ -741,6 +765,14 @@ func write(fd int, p *byte, np int) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func munmap(addr uintptr, length uintptr) (errno int) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chown(path string, uid int, gid int) (errno int) { _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid)) errno = int(e1) @@ -782,7 +814,7 @@ func Ftruncate(fd int, length int64) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } @@ -790,7 +822,7 @@ func Getegid() (egid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { - r0, _, _ := Syscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } @@ -798,7 +830,7 @@ func Geteuid() (euid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := Syscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } @@ -806,7 +838,7 @@ func Getgid() (gid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := Syscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } @@ -918,7 +950,7 @@ func Setfsuid(uid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (errno int) { - _, _, e1 := Syscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) errno = int(e1) return } @@ -926,7 +958,7 @@ func Setgid(gid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) errno = int(e1) return } @@ -934,7 +966,7 @@ func Setregid(rgid int, egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) + _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) errno = int(e1) return } @@ -942,7 +974,7 @@ func Setresgid(rgid int, egid int, sgid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (errno int) { - _, _, e1 := Syscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) + _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) errno = int(e1) return } @@ -950,7 +982,7 @@ func Setresuid(ruid int, euid int, suid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) errno = int(e1) return } @@ -1032,7 +1064,7 @@ func connect(s int, addr uintptr, addrlen _Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, errno int) { - r0, _, e1 := Syscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) errno = int(e1) return @@ -1041,7 +1073,15 @@ func getgroups(n int, list *_Gid_t) (nn int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (errno int) { - _, _, e1 := Syscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) errno = int(e1) return } @@ -1057,7 +1097,7 @@ func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) errno = int(e1) return @@ -1066,7 +1106,7 @@ func socket(domain int, typ int, proto int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) { - _, _, e1 := Syscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) errno = int(e1) return } @@ -1074,7 +1114,7 @@ func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -1082,7 +1122,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -1132,3 +1172,12 @@ func sendmsg(s int, msg *Msghdr, flags int) (errno int) { errno = int(e1) return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, errno int) { + r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) + xaddr = uintptr(r0) + errno = int(e1) + return +} diff --git a/src/pkg/syscall/zsyscall_linux_arm.go b/src/pkg/syscall/zsyscall_linux_arm.go index 22b736bfa..49d164a3c 100644 --- a/src/pkg/syscall/zsyscall_linux_arm.go +++ b/src/pkg/syscall/zsyscall_linux_arm.go @@ -1,4 +1,4 @@ -// mksyscall.sh -b32 syscall_linux.go syscall_linux_arm.go +// mksyscall.pl -b32 syscall_linux.go syscall_linux_arm.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT package syscall @@ -26,7 +26,7 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (errno int) { - _, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) + _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) errno = int(e1) return } @@ -81,6 +81,14 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func reboot(magic1 uint, magic2 uint, cmd int, arg string) (errno int) { + _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(StringBytePtr(arg))), 0, 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (errno int) { _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0) errno = int(e1) @@ -148,7 +156,7 @@ func Creat(path string, mode uint32) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) + r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) errno = int(e1) return @@ -157,7 +165,7 @@ func Dup(oldfd int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) + r0, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) fd = int(r0) errno = int(e1) return @@ -166,7 +174,7 @@ func Dup2(oldfd int, newfd int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate(size int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) + r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) fd = int(r0) errno = int(e1) return @@ -175,7 +183,7 @@ func EpollCreate(size int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) { - _, _, e1 := Syscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) + _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) errno = int(e1) return } @@ -293,7 +301,7 @@ func Getdents(fd int, buf []byte) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, errno int) { - r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) errno = int(e1) return @@ -302,7 +310,7 @@ func Getpgid(pid int) (pgid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pid int) { - r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pid = int(r0) return } @@ -310,7 +318,7 @@ func Getpgrp() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } @@ -318,7 +326,7 @@ func Getpid() (pid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } @@ -326,7 +334,7 @@ func Getppid() (ppid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) errno = int(e1) return } @@ -334,7 +342,7 @@ func Getrlimit(resource int, rlim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (errno int) { - _, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) errno = int(e1) return } @@ -342,7 +350,7 @@ func Getrusage(who int, rusage *Rusage) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettid() (tid int) { - r0, _, _ := Syscall(SYS_GETTID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) tid = int(r0) return } @@ -359,7 +367,7 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit() (fd int, errno int) { - r0, _, e1 := Syscall(SYS_INOTIFY_INIT, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) fd = int(r0) errno = int(e1) return @@ -368,7 +376,7 @@ func InotifyInit() (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit1(flags int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) + r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) fd = int(r0) errno = int(e1) return @@ -377,7 +385,7 @@ func InotifyInit1(flags int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) { - r0, _, e1 := Syscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) + r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) success = int(r0) errno = int(e1) return @@ -386,7 +394,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig int) (errno int) { - _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) + _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) errno = int(e1) return } @@ -448,6 +456,14 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(source string, target string, fstype string, flags int, data string) (errno int) { + _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(StringBytePtr(source))), uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(unsafe.Pointer(StringBytePtr(fstype))), uintptr(flags), uintptr(unsafe.Pointer(StringBytePtr(data))), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (errno int) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) errno = int(e1) @@ -555,7 +571,7 @@ func Sethostname(p []byte) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) errno = int(e1) return } @@ -563,7 +579,7 @@ func Setpgid(pid int, pgid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(resource int, rlim *Rlimit) (errno int) { - _, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) errno = int(e1) return } @@ -571,7 +587,7 @@ func Setrlimit(resource int, rlim *Rlimit) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, errno int) { - r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) errno = int(e1) return @@ -580,7 +596,7 @@ func Setsid() (pid int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) errno = int(e1) return } @@ -588,7 +604,7 @@ func Settimeofday(tv *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (errno int) { - _, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) errno = int(e1) return } @@ -611,7 +627,7 @@ func Sync() { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sysinfo(info *Sysinfo_t) (errno int) { - _, _, e1 := Syscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) + _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) errno = int(e1) return } @@ -628,7 +644,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tgkill(tgid int, tid int, sig int) (errno int) { - _, _, e1 := Syscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) + _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) errno = int(e1) return } @@ -636,7 +652,7 @@ func Tgkill(tgid int, tid int, sig int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, errno int) { - r0, _, e1 := Syscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) + r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) ticks = uintptr(r0) errno = int(e1) return @@ -645,7 +661,7 @@ func Times(tms *Tms) (ticks uintptr, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { - r0, _, _ := Syscall(SYS_UMASK, uintptr(mask), 0, 0) + r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } @@ -653,7 +669,7 @@ func Umask(mask int) (oldmask int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (errno int) { - _, _, e1 := Syscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) + _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) errno = int(e1) return } @@ -676,6 +692,14 @@ func Unlinkat(dirfd int, path string) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unmount(target string, flags int) (errno int) { + _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(flags), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unshare(flags int) (errno int) { _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) errno = int(e1) @@ -741,6 +765,14 @@ func write(fd int, p *byte, np int) (n int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func munmap(addr uintptr, length uintptr) (errno int) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) @@ -767,7 +799,7 @@ func connect(s int, addr uintptr, addrlen _Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, errno int) { - r0, _, e1 := Syscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) errno = int(e1) return @@ -776,7 +808,15 @@ func getgroups(n int, list *_Gid_t) (nn int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (errno int) { - _, _, e1 := Syscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + _, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) errno = int(e1) return } @@ -792,7 +832,7 @@ func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, errno int) { - r0, _, e1 := Syscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) errno = int(e1) return @@ -801,7 +841,7 @@ func socket(domain int, typ int, proto int) (fd int, errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -809,7 +849,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { - _, _, e1 := Syscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) errno = int(e1) return } @@ -846,7 +886,7 @@ func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno i // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, flags int, fd *[2]int) (errno int) { - _, _, e1 := Syscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0) errno = int(e1) return } @@ -911,7 +951,7 @@ func Ftruncate(fd int, length int64) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } @@ -919,7 +959,7 @@ func Getegid() (egid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { - r0, _, _ := Syscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } @@ -927,7 +967,7 @@ func Geteuid() (euid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := Syscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } @@ -935,7 +975,7 @@ func Getgid() (gid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := Syscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } @@ -992,7 +1032,7 @@ func Setfsuid(uid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (errno int) { - _, _, e1 := Syscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) errno = int(e1) return } @@ -1000,7 +1040,7 @@ func Setgid(gid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) errno = int(e1) return } @@ -1008,7 +1048,7 @@ func Setregid(rgid int, egid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (errno int) { - _, _, e1 := Syscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) + _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) errno = int(e1) return } @@ -1016,7 +1056,7 @@ func Setresgid(rgid int, egid int, sgid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (errno int) { - _, _, e1 := Syscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) + _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) errno = int(e1) return } @@ -1024,7 +1064,7 @@ func Setresuid(ruid int, euid int, suid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (errno int) { - _, _, e1 := Syscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) errno = int(e1) return } @@ -1073,7 +1113,7 @@ func Truncate(path string, length int64) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (errno int) { - _, _, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) errno = int(e1) return } @@ -1081,8 +1121,17 @@ func Gettimeofday(tv *Timeval) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, errno int) { - r0, _, e1 := Syscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) + r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) tt = Time_t(r0) errno = int(e1) return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, errno int) { + r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) + xaddr = uintptr(r0) + errno = int(e1) + return +} diff --git a/src/pkg/syscall/zsyscall_plan9_386.go b/src/pkg/syscall/zsyscall_plan9_386.go new file mode 100644 index 000000000..75c411ad6 --- /dev/null +++ b/src/pkg/syscall/zsyscall_plan9_386.go @@ -0,0 +1,267 @@ +// mksyscall.pl -l32 -plan9 syscall_plan9.go syscall_plan9_386.go +// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT + +package syscall + +import "unsafe" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func exits(msg *byte) { + Syscall(SYS_EXITS, uintptr(unsafe.Pointer(msg)), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fd2path(fd int, buf []byte) (err Error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf))) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe(p *[2]_C_int) (err Error) { + r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sleep(millisecs int32) (err Error) { + r0, _, e1 := Syscall(SYS_SLEEP, uintptr(millisecs), 0, 0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func await(s []byte) (n int, err Error) { + var _p0 unsafe.Pointer + if len(s) > 0 { + _p0 = unsafe.Pointer(&s[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0) + n = int(r0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(oldfd int, newfd int) (fd int, err Error) { + r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0) + fd = int(r0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Open(path string, mode int) (fd int, err Error) { + r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0) + fd = int(r0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Create(path string, mode int, perm uint32) (fd int, err Error) { + r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm)) + fd = int(r0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Remove(path string) (err Error) { + r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err Error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) + n = int(r0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pwrite(fd int, p []byte, offset int64) (n int, err Error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) + n = int(r0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Close(fd int) (err Error) { + r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err Error) { + r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Bind(name string, old string, flag int) (err Error) { + r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(StringBytePtr(name))), uintptr(unsafe.Pointer(StringBytePtr(old))), uintptr(flag)) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mount(fd int, afd int, old string, flag int, aname string) (err Error) { + r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(StringBytePtr(old))), uintptr(flag), uintptr(unsafe.Pointer(StringBytePtr(aname))), 0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, edir []byte) (n int, err Error) { + var _p0 unsafe.Pointer + if len(edir) > 0 { + _p0 = unsafe.Pointer(&edir[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(edir))) + n = int(r0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, edir []byte) (n int, err Error) { + var _p0 unsafe.Pointer + if len(edir) > 0 { + _p0 = unsafe.Pointer(&edir[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) + n = int(r0) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Wstat(path string, edir []byte) (err Error) { + var _p0 unsafe.Pointer + if len(edir) > 0 { + _p0 = unsafe.Pointer(&edir[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(edir))) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fwstat(fd int, edir []byte) (err Error) { + var _p0 unsafe.Pointer + if len(edir) > 0 { + _p0 = unsafe.Pointer(&edir[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) + err = nil + if int(r0) == -1 { + err = NewError(e1) + } + return +} diff --git a/src/pkg/syscall/zsyscall_windows_386.go b/src/pkg/syscall/zsyscall_windows_386.go index 543992ea6..f4cfdeed8 100644 --- a/src/pkg/syscall/zsyscall_windows_386.go +++ b/src/pkg/syscall/zsyscall_windows_386.go @@ -1,4 +1,4 @@ -// mksyscall_windows.sh -l32 syscall_windows.go syscall_windows_386.go +// mksyscall_windows.pl -l32 syscall_windows.go syscall_windows_386.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT package syscall @@ -69,6 +69,7 @@ var ( procLocalFree = getSysProcAddr(modkernel32, "LocalFree") procSetHandleInformation = getSysProcAddr(modkernel32, "SetHandleInformation") procFlushFileBuffers = getSysProcAddr(modkernel32, "FlushFileBuffers") + procGetFullPathNameW = getSysProcAddr(modkernel32, "GetFullPathNameW") procWSAStartup = getSysProcAddr(modwsock32, "WSAStartup") procWSACleanup = getSysProcAddr(modwsock32, "WSACleanup") procsocket = getSysProcAddr(modwsock32, "socket") @@ -515,7 +516,7 @@ func CancelIo(s uint32) (errno int) { return } -func CreateProcess(appName *int16, commandLine *uint16, procSecurity *int16, threadSecurity *int16, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (errno int) { +func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (errno int) { var _p0 uint32 if inheritHandles { _p0 = 1 @@ -885,6 +886,21 @@ func FlushFileBuffers(handle int32) (errno int) { return } +func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, errno int) { + r0, _, e1 := Syscall6(procGetFullPathNameW, 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0) + n = uint32(r0) + if n == 0 { + if e1 != 0 { + errno = int(e1) + } else { + errno = EINVAL + } + } else { + errno = 0 + } + return +} + func WSAStartup(verreq uint32, data *WSAData) (sockerrno int) { r0, _, _ := Syscall(procWSAStartup, 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0) sockerrno = int(r0) diff --git a/src/pkg/syscall/zsysnum_darwin_amd64.go b/src/pkg/syscall/zsysnum_darwin_amd64.go index 8d5c93478..f9c6e077d 100644 --- a/src/pkg/syscall/zsysnum_darwin_amd64.go +++ b/src/pkg/syscall/zsysnum_darwin_amd64.go @@ -1,4 +1,4 @@ -// mksysnum_darwin.sh /home/rsc/pub/xnu-1228/bsd/kern/syscalls.master +// mksysnum_darwin.pl /home/rsc/pub/xnu-1228/bsd/kern/syscalls.master // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT package syscall diff --git a/src/pkg/syscall/zsysnum_linux_386.go b/src/pkg/syscall/zsysnum_linux_386.go index 55529adaa..71e21c7a5 100644 --- a/src/pkg/syscall/zsysnum_linux_386.go +++ b/src/pkg/syscall/zsysnum_linux_386.go @@ -1,4 +1,4 @@ -// mksysnum_linux.sh /usr/include/asm/unistd_32.h +// mksysnum_linux.pl /usr/include/asm/unistd_32.h // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT package syscall diff --git a/src/pkg/syscall/zsysnum_linux_amd64.go b/src/pkg/syscall/zsysnum_linux_amd64.go index 2621999c7..77d4eea9e 100644 --- a/src/pkg/syscall/zsysnum_linux_amd64.go +++ b/src/pkg/syscall/zsysnum_linux_amd64.go @@ -1,4 +1,4 @@ -// mksysnum_linux.sh /usr/include/asm/unistd_64.h +// mksysnum_linux.pl /usr/include/asm/unistd_64.h // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT package syscall diff --git a/src/pkg/syscall/zsysnum_plan9_386.go b/src/pkg/syscall/zsysnum_plan9_386.go new file mode 100644 index 000000000..4135b8d81 --- /dev/null +++ b/src/pkg/syscall/zsysnum_plan9_386.go @@ -0,0 +1,47 @@ +// mksysnum_plan9.sh /media/sys/src/libc/9syscall/sys.h +// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT + +package syscall + +const ( + SYS_SYSR1 = 0 + SYS_BIND = 2 + SYS_CHDIR = 3 + SYS_CLOSE = 4 + SYS_DUP = 5 + SYS_ALARM = 6 + SYS_EXEC = 7 + SYS_EXITS = 8 + SYS_FAUTH = 10 + SYS_SEGBRK = 12 + SYS_OPEN = 14 + SYS_OSEEK = 16 + SYS_SLEEP = 17 + SYS_RFORK = 19 + SYS_PIPE = 21 + SYS_CREATE = 22 + SYS_FD2PATH = 23 + SYS_BRK_ = 24 + SYS_REMOVE = 25 + SYS_NOTIFY = 28 + SYS_NOTED = 29 + SYS_SEGATTACH = 30 + SYS_SEGDETACH = 31 + SYS_SEGFREE = 32 + SYS_SEGFLUSH = 33 + SYS_RENDEZVOUS = 34 + SYS_UNMOUNT = 35 + SYS_SEMACQUIRE = 37 + SYS_SEMRELEASE = 38 + SYS_SEEK = 39 + SYS_FVERSION = 40 + SYS_ERRSTR = 41 + SYS_STAT = 42 + SYS_FSTAT = 43 + SYS_WSTAT = 44 + SYS_FWSTAT = 45 + SYS_MOUNT = 46 + SYS_AWAIT = 47 + SYS_PREAD = 50 + SYS_PWRITE = 51 +) diff --git a/src/pkg/syscall/ztypes_darwin_amd64.go b/src/pkg/syscall/ztypes_darwin_amd64.go index 91ee45796..936a4e804 100644 --- a/src/pkg/syscall/ztypes_darwin_amd64.go +++ b/src/pkg/syscall/ztypes_darwin_amd64.go @@ -229,7 +229,7 @@ type Msghdr struct { Name *byte Namelen uint32 Pad_godefs_0 [4]byte - Iov *Iovec + Iov uint64 Iovlen int32 Pad_godefs_1 [4]byte Control *byte diff --git a/src/pkg/syscall/ztypes_freebsd_386.go b/src/pkg/syscall/ztypes_freebsd_386.go index 0f8e37abb..f4d256f4e 100644 --- a/src/pkg/syscall/ztypes_freebsd_386.go +++ b/src/pkg/syscall/ztypes_freebsd_386.go @@ -43,6 +43,13 @@ const ( SizeofIfaMsghdr = 0x14 SizeofRtMsghdr = 0x5c SizeofRtMetrics = 0x38 + SizeofBpfVersion = 0x4 + SizeofBpfStat = 0x8 + SizeofBpfZbuf = 0xc + SizeofBpfProgram = 0x8 + SizeofBpfInsn = 0x8 + SizeofBpfHdr = 0x14 + SizeofBpfZbufHeader = 0x20 ) // Types @@ -326,3 +333,46 @@ type RtMetrics struct { Weight uint32 Filler [3]uint32 } + +type BpfVersion struct { + Major uint16 + Minor uint16 +} + +type BpfStat struct { + Recv uint32 + Drop uint32 +} + +type BpfZbuf struct { + Bufa *byte + Bufb *byte + Buflen uint32 +} + +type BpfProgram struct { + Len uint32 + Insns *BpfInsn +} + +type BpfInsn struct { + Code uint16 + Jt uint8 + Jf uint8 + K uint32 +} + +type BpfHdr struct { + Tstamp Timeval + Caplen uint32 + Datalen uint32 + Hdrlen uint16 + Pad_godefs_0 [2]byte +} + +type BpfZbufHeader struct { + Kernel_gen uint32 + Kernel_len uint32 + User_gen uint32 + X_bzh_pad [5]uint32 +} diff --git a/src/pkg/syscall/ztypes_freebsd_amd64.go b/src/pkg/syscall/ztypes_freebsd_amd64.go index 83a54f66b..cf6355caf 100644 --- a/src/pkg/syscall/ztypes_freebsd_amd64.go +++ b/src/pkg/syscall/ztypes_freebsd_amd64.go @@ -43,6 +43,13 @@ const ( SizeofIfaMsghdr = 0x14 SizeofRtMsghdr = 0x98 SizeofRtMetrics = 0x70 + SizeofBpfVersion = 0x4 + SizeofBpfStat = 0x8 + SizeofBpfZbuf = 0x18 + SizeofBpfProgram = 0x10 + SizeofBpfInsn = 0x8 + SizeofBpfHdr = 0x20 + SizeofBpfZbufHeader = 0x20 ) // Types @@ -329,3 +336,47 @@ type RtMetrics struct { Weight uint64 Filler [3]uint64 } + +type BpfVersion struct { + Major uint16 + Minor uint16 +} + +type BpfStat struct { + Recv uint32 + Drop uint32 +} + +type BpfZbuf struct { + Bufa *byte + Bufb *byte + Buflen uint64 +} + +type BpfProgram struct { + Len uint32 + Pad_godefs_0 [4]byte + Insns *BpfInsn +} + +type BpfInsn struct { + Code uint16 + Jt uint8 + Jf uint8 + K uint32 +} + +type BpfHdr struct { + Tstamp Timeval + Caplen uint32 + Datalen uint32 + Hdrlen uint16 + Pad_godefs_0 [6]byte +} + +type BpfZbufHeader struct { + Kernel_gen uint32 + Kernel_len uint32 + User_gen uint32 + X_bzh_pad [5]uint32 +} diff --git a/src/pkg/syscall/ztypes_plan9_386.go b/src/pkg/syscall/ztypes_plan9_386.go new file mode 100644 index 000000000..8f823ba65 --- /dev/null +++ b/src/pkg/syscall/ztypes_plan9_386.go @@ -0,0 +1,74 @@ +// godefs -gsyscall -f -m32 types_plan9.c + +// MACHINE GENERATED - DO NOT EDIT. + +package syscall + +// Constants +const ( + O_RDONLY = 0 + O_WRONLY = 0x1 + O_RDWR = 0x2 + O_CLOEXEC = 0x20 + O_EXCL = 0x1000 + STATMAX = 0xffff + ERRMAX = 0x80 + MORDER = 0x3 + MREPL = 0 + MBEFORE = 0x1 + MAFTER = 0x2 + MCREATE = 0x4 + MCACHE = 0x10 + MMASK = 0x17 + RFNAMEG = 0x1 + RFENVG = 0x2 + RFFDG = 0x4 + RFNOTEG = 0x8 + RFPROC = 0x10 + RFMEM = 0x20 + RFNOWAIT = 0x40 + RFCNAMEG = 0x400 + RFCENVG = 0x800 + RFCFDG = 0x1000 + RFREND = 0x2000 + RFNOMNT = 0x4000 + QTDIR = 0x80 + QTAPPEND = 0x40 + QTEXCL = 0x20 + QTMOUNT = 0x10 + QTAUTH = 0x8 + QTTMP = 0x4 + QTFILE = 0 + DMDIR = 0x80000000 + DMAPPEND = 0x40000000 + DMEXCL = 0x20000000 + DMMOUNT = 0x10000000 + DMAUTH = 0x8000000 + DMTMP = 0x4000000 + DMREAD = 0x4 + DMWRITE = 0x2 + DMEXEC = 0x1 + STATFIXLEN = 0x31 +) + +// Types + +type _C_int int32 + +type Prof struct { + Pp *[0]byte /* sPlink */ + Next *[0]byte /* sPlink */ + Last *[0]byte /* sPlink */ + First *[0]byte /* sPlink */ + Pid uint32 + What uint32 +} + +type Tos struct { + Prof Prof + Cyclefreq uint64 + Kcycles int64 + Pcycles int64 + Pid uint32 + Clock uint32 +} diff --git a/src/pkg/syscall/ztypes_windows_386.go b/src/pkg/syscall/ztypes_windows_386.go index ff367a858..56d4198dc 100644 --- a/src/pkg/syscall/ztypes_windows_386.go +++ b/src/pkg/syscall/ztypes_windows_386.go @@ -482,6 +482,10 @@ type DNSSRVData struct { Pad uint16 } +type DNSPTRData struct { + Host *uint16 +} + type DNSRecord struct { Next *DNSRecord Name *uint16 |