Commit fd1add27 authored by Russ Cox's avatar Russ Cox

syscall cleanup.

 * rename PORT.sh -> mkall.sh (hopefully more obvious),
   change behavior: run commands by default.
 * pull more constants out of #defines automatically,
   instead of editing large lists by hand.
 * add Recvfrom, Sendto

add os.O_EXCL.

R=r
http://go/go-review/1017009
parent 52232183
......@@ -376,7 +376,7 @@ main(int argc, char **argv)
snprint(nambuf, sizeof nambuf, "Pad%d", npad++);
name = nambuf;
}
Bprint(bout, "\t%lT;\n", name, f->type);
Bprint(bout, "\t%#lT;\n", name, f->type);
if(t->kind == Union && lang == &go)
break;
}
......@@ -488,6 +488,8 @@ gotypefmt(Fmt *f)
name = va_arg(f->args, char*);
if('a' <= name[0] && name[0] <= 'z')
name[0] += 'A' - 'a';
if(name[0] == '_' && (f->flags & FmtSharp))
fmtprint(f, "X");
fmtprint(f, "%s ", name);
}
t = va_arg(f->args, Type*);
......
......@@ -60,6 +60,7 @@ const (
O_APPEND = syscall.O_APPEND; // open the file append-only.
O_ASYNC = syscall.O_ASYNC; // generate a signal when I/O is available.
O_CREAT = syscall.O_CREAT; // create a new file if none exists.
O_EXCL = syscall.O_EXCL; // used with O_CREAT, file must not exist
O_NOCTTY = syscall.O_NOCTTY; // do not make file the controlling tty.
O_NONBLOCK = syscall.O_NONBLOCK; // open in non-blocking mode.
O_NDELAY = O_NONBLOCK; // synonym for O_NONBLOCK
......@@ -115,7 +116,6 @@ var EOF Error = eofError(0)
// Read reads up to len(b) bytes from the File.
// It returns the number of bytes read and an Error, if any.
// EOF is signaled by a zero count with err set to EOF.
// TODO(r): Add Pread, Pwrite (maybe ReadAt, WriteAt).
func (file *File) Read(b []byte) (n int, err Error) {
if file == nil {
return 0, EINVAL;
......
......@@ -133,7 +133,7 @@ func forkAndExecInChild(argv0 *byte, argv []*byte, envv []*byte, traceme bool, d
// Enable tracing if requested.
if traceme {
_, _, err1 = RawSyscall(SYS_PTRACE, uintptr(_PTRACE_TRACEME), 0, 0);
_, _, err1 = RawSyscall(SYS_PTRACE, uintptr(PTRACE_TRACEME), 0, 0);
if err1 != 0 {
goto childerror;
}
......
......@@ -10,7 +10,7 @@
# much of the process. The auto-generated files have names
# beginning with z.
#
# This script prints suggested commands to generate z files
# This script runs or (given -n) prints suggested commands to generate z files
# for the current system. Running those commands is not automatic.
# This script is documentation more than anything else.
#
......@@ -78,6 +78,21 @@ GOOSARCH="${GOOS}_${GOARCH}"
# defaults
mksyscall="mksyscall.sh"
mkerrors="mkerrors.sh"
run="sh"
case "$1" in
-n)
run="cat"
shift
esac
case "$#" in
0)
;;
*)
echo 'usage: mkall.sh [-n]' 1>&2
exit 2
esac
case "$GOOSARCH" in
_* | *_ | _)
......@@ -126,7 +141,9 @@ linux_arm)
;;
esac
echo "$mkerrors |gofmt >zerrors_$GOOSARCH.go"
echo "$mksyscall syscall_$GOOS.go syscall_$GOOSARCH.go |gofmt >zsyscall_$GOOSARCH.go"
echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"
echo "$mktypes types_$GOOS.c |gofmt >ztypes_$GOOSARCH.go"
(
echo "$mkerrors |gofmt >zerrors_$GOOSARCH.go"
echo "$mksyscall syscall_$GOOS.go syscall_$GOOSARCH.go |gofmt >zsyscall_$GOOSARCH.go"
echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"
echo "$mktypes types_$GOOS.c |gofmt >ztypes_$GOOSARCH.go"
) | $run
#!/bin/sh
#!/bin/bash
# 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.
# Generate Go code listing error values (ENAMETOOLONG etc)
# and signal values (SIGALRM etc). They're unrelated except
# that we use the same method for finding them.
# Generate Go code listing errors and other #defined constant
# values (ENAMETOOLONG etc.), by asking the preprocessor
# about the definitions.
case "$GOARCH" in
arm)
......@@ -16,39 +16,81 @@ arm)
;;
esac
errors=$(
echo '#include <errno.h>' |
# The gcc command line prints all the #defines
# it encounters while processing the input
$GCC -x c - -E -dM |
egrep -h '#define E[A-Z0-9_]+ ' $files |
sed 's/#define //; s/ .*//'
)
uname=$(uname)
signals=$(
echo '#include <sys/signal.h>' |
$GCC -x c - -E -dM |
egrep -h '#define SIG[^_]' |
egrep -v '#define (SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))' |
sed 's/#define //; s/ .*//'
)
includes_Linux='
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/epoll.h>
#include <linux/ptrace.h>
#include <linux/wait.h>
'
includes_Darwin='
#define __DARWIN_UNIX03 0
#define KERNEL
#define _DARWIN_USE_64_BIT_INODE
#include <sys/wait.h>
#include <sys/event.h>
'
includes='
#include <sys/types.h>
#include <fcntl.h>
#include <dirent.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <errno.h>
#include <sys/signal.h>
#include <signal.h>
'
# Write godefs input.
(
echo '#include <errno.h>'
echo '#include <signal.h>'
indirect="includes_$(uname)"
echo "${!indirect} $includes"
echo
echo 'enum {'
for i in $errors $signals
do
echo '$'"$i = $i,"
done
# The gcc command line prints all the #defines
# it encounters while processing the input
echo "${!indirect} $includes" | $GCC -x c - -E -dM |
awk '
$1 != "#define" || $2 ~ /\(/ {next}
$2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}
$2 ~ /^E[A-Z0-9_]+$/ ||
$2 ~ /^SIG[^_]/ ||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|TCP|EVFILT|EV)_/ ||
$2 == "SOMAXCONN" ||
$2 == "NAME_MAX" ||
$2 ~ /^(O|F|FD|NAME|S|PTRACE)_/ ||
$2 ~ /^W[A-Z0-9]+$/ {printf("\t$%s = %s,\n", $2, $2)}
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t$%s = %s,\n", substr($2,3), $2)}
{next}
' | sort
echo '};'
) >_errors.c
) >_const.c
# Pull out just the error names for later.
errors=$(
echo '#include <errno.h>' | $GCC -x c - -E -dM |
awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }'
)
echo '// mkerrors.sh' "$@"
echo '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'
echo
godefs -gsyscall "$@" _errors.c
godefs -gsyscall "$@" _const.c
# Run C program to print error strings.
(
......@@ -95,9 +137,10 @@ main(void)
next:;
}
printf("}\n\n");
return 0;
}
'
) >_errors.c
gcc -o _errors _errors.c && ./_errors && rm -f _errors.c _errors
gcc -o _errors _errors.c && ./_errors && rm -f _errors.c _errors _const.c
......@@ -138,6 +138,7 @@ func (w WaitStatus) TrapCause() int {
}
//sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int)
func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int) {
var status _C_int;
wpid, errno = wait4(pid, &status, options, rusage);
......@@ -148,6 +149,7 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int,
}
//sys pipe() (r int, w int, errno int)
func Pipe(p []int) (errno int) {
if len(p) != 2 {
return EINVAL;
......@@ -351,7 +353,31 @@ func SetsockoptLinger(fd, level, opt int, l *Linger) (errno int) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l));
}
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int)
func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, errno int) {
var rsa RawSockaddrAny;
var len _Socklen = SizeofSockaddrAny;
if n, errno = recvfrom(fd, p, flags, &rsa, &len); errno != 0 {
return;
}
from, errno = anyToSockaddr(&rsa);
return;
}
//sys sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int)
func Sendto(fd int, p []byte, flags int, to Sockaddr) (errno int) {
ptr, n, err := to.sockaddr();
if err != 0 {
return err;
}
return sendto(fd, p, flags, ptr, n);
}
//sys kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int)
func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, errno int) {
var change, event uintptr;
if len(changes) > 0 {
......@@ -449,10 +475,8 @@ func SysctlUint32(name string) (value uint32, 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)
// Recvfrom(s int, buf *byte, nbuf int, flags int, from *Sockaddr, fromlen *int) (n int, errno int)
// Recvmsg(s int, msg *Msghdr, flags int) (n int, errno int)
// Sendmsg(s int, msg *Msghdr, flags int) (n int, errno int)
// Sendto(s int, buf *byte, nbuf int, flags int, to *Sockaddr, addrlen int) (errno int)
// Utimes(path string, timeval *Timeval) (errno int) // Pointer to 2 timevals!
//sys fcntl(fd int, cmd int, arg int) (val int, errno int)
......
......@@ -375,6 +375,24 @@ func SetsockoptLinger(fd, level, opt int, l *Linger) (errno int) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l));
}
func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, errno int) {
var rsa RawSockaddrAny;
var len _Socklen = SizeofSockaddrAny;
if n, errno = recvfrom(fd, p, flags, &rsa, &len); errno != 0 {
return;
}
from, errno = anyToSockaddr(&rsa);
return;
}
func Sendto(fd int, p []byte, flags int, to Sockaddr) (errno int) {
ptr, n, err := to.sockaddr();
if err != 0 {
return err;
}
return sendto(fd, p, flags, ptr, n);
}
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (errno int)
// See bytes.Copy.
......@@ -429,11 +447,11 @@ func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, errno in
}
func PtracePeekText(pid int, addr uintptr, out []byte) (count int, errno int) {
return ptracePeek(_PTRACE_PEEKTEXT, pid, addr, out);
return ptracePeek(PTRACE_PEEKTEXT, pid, addr, out);
}
func PtracePeekData(pid int, addr uintptr, out []byte) (count int, errno int) {
return ptracePeek(_PTRACE_PEEKDATA, pid, addr, out);
return ptracePeek(PTRACE_PEEKDATA, pid, addr, out);
}
func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, errno int) {
......@@ -488,46 +506,46 @@ func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (c
}
func PtracePokeText(pid int, addr uintptr, data []byte) (count int, errno int) {
return ptracePoke(_PTRACE_POKETEXT, _PTRACE_PEEKTEXT, pid, addr, data);
return ptracePoke(PTRACE_POKETEXT, PTRACE_PEEKTEXT, pid, addr, data);
}
func PtracePokeData(pid int, addr uintptr, data []byte) (count int, errno int) {
return ptracePoke(_PTRACE_POKEDATA, _PTRACE_PEEKDATA, pid, addr, data);
return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data);
}
func PtraceGetRegs(pid int, regsout *PtraceRegs) (errno int) {
return ptrace(_PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)));
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)));
}
func PtraceSetRegs(pid int, regs *PtraceRegs) (errno int) {
return ptrace(_PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)));
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)));
}
func PtraceSetOptions(pid int, options int) (errno int) {
return ptrace(_PTRACE_SETOPTIONS, pid, 0, uintptr(options));
return ptrace(PTRACE_SETOPTIONS, pid, 0, uintptr(options));
}
func PtraceGetEventMsg(pid int) (msg uint, errno int) {
var data _C_long;
errno = ptrace(_PTRACE_GETEVENTMSG, pid, 0, uintptr(unsafe.Pointer(&data)));
errno = ptrace(PTRACE_GETEVENTMSG, pid, 0, uintptr(unsafe.Pointer(&data)));
msg = uint(data);
return;
}
func PtraceCont(pid int, signal int) (errno int) {
return ptrace(_PTRACE_CONT, pid, 0, uintptr(signal));
return ptrace(PTRACE_CONT, pid, 0, uintptr(signal));
}
func PtraceSingleStep(pid int) (errno int) {
return ptrace(_PTRACE_SINGLESTEP, pid, 0, 0);
return ptrace(PTRACE_SINGLESTEP, pid, 0, 0);
}
func PtraceAttach(pid int) (errno int) {
return ptrace(_PTRACE_ATTACH, pid, 0, 0);
return ptrace(PTRACE_ATTACH, pid, 0, 0);
}
func PtraceDetach(pid int) (errno int) {
return ptrace(_PTRACE_DETACH, pid, 0, 0);
return ptrace(PTRACE_DETACH, pid, 0, 0);
}
// Sendto
......
......@@ -57,7 +57,6 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
//sys SyncFileRange(fd int, off int64, n int64, flags int) (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
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) = SYS__NEWSELECT
// Underlying system call writes to newoffset via pointer.
......@@ -100,25 +99,21 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
}
func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
var _ int;
_, errno = socketcall(_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) {
var _ int;
_, errno = socketcall(_GETPEERNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0);
return;
}
func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
var _ int;
_, errno = socketcall(_BIND, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0);
return;
}
func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
var _ int;
_, errno = socketcall(_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0);
return;
}
......@@ -129,13 +124,29 @@ func socket(domain int, typ int, proto int) (fd int, errno int) {
}
func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) {
var _ int;
_, errno = socketcall(_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0);
return;
}
func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
var base uintptr;
if len(p) > 0 {
base = uintptr(unsafe.Pointer(&p));
}
n, errno = socketcall(_RECVFROM, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)));
return;
}
func sendto(s int, p []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
var base uintptr;
if len(p) > 0 {
base = uintptr(unsafe.Pointer(&p));
}
_, errno = socketcall(_SENDTO, uintptr(s), base, uintptr(len(p)), uintptr(flags), to, uintptr(addrlen));
return;
}
func Listen(s int, n int) (errno int) {
var _ int;
_, errno = socketcall(_LISTEN, uintptr(s), uintptr(n), 0, 0, 0, 0);
return;
}
......
......@@ -39,6 +39,8 @@ package syscall
//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)
//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)
func Getpagesize() int {
return 4096
......
......@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
/*
Input to godefs. See PORT.sh
Input to godefs. See also mkerrors.sh and mkall.sh
*/
#define __DARWIN_UNIX03 0
......@@ -68,111 +68,28 @@ typedef gid_t $_Gid_t;
enum
{
$O_RDONLY = O_RDONLY,
$O_WRONLY = O_WRONLY,
$O_RDWR = O_RDWR,
$O_APPEND = O_APPEND,
$O_ASYNC = O_ASYNC,
$O_CREAT = O_CREAT,
$O_NOCTTY = O_NOCTTY,
$O_NONBLOCK = O_NONBLOCK,
$O_SYNC = O_SYNC,
$O_TRUNC = O_TRUNC,
$O_CLOEXEC = 0, // not supported
$F_GETFD = F_GETFD,
$F_SETFD = F_SETFD,
$F_GETFL = F_GETFL,
$F_SETFL = F_SETFL,
$FD_CLOEXEC = FD_CLOEXEC,
$NAME_MAX = NAME_MAX
};
enum
{ // Directory mode bits
$S_IFMT = S_IFMT,
$S_IFIFO = S_IFIFO,
$S_IFCHR = S_IFCHR,
$S_IFDIR = S_IFDIR,
$S_IFBLK = S_IFBLK,
$S_IFREG = S_IFREG,
$S_IFLNK = S_IFLNK,
$S_IFSOCK = S_IFSOCK,
$S_IFWHT = S_IFWHT,
$S_ISUID = S_ISUID,
$S_ISGID = S_ISGID,
$S_ISVTX = S_ISVTX,
$S_IRUSR = S_IRUSR,
$S_IWUSR = S_IWUSR,
$S_IXUSR = S_IXUSR,
};
typedef struct stat64 $Stat_t;
typedef struct statfs64 $Statfs_t;
typedef struct flock $Flock_t;
typedef struct fstore $Fstore_t;
typedef struct radvisory $Radvisory_t;
typedef struct fbootstraptransfer $Fbootstraptransfer_t;
typedef struct log2phys $Log2phys_t;
typedef struct dirent $Dirent;
// Wait status.
enum
{
$WNOHANG = WNOHANG,
$WUNTRACED = WUNTRACED,
$WEXITED = WEXITED,
$WSTOPPED = WSTOPPED,
$WCONTINUED = WCONTINUED,
$WNOWAIT = WNOWAIT,
};
// Sockets
enum
{
$AF_UNIX = AF_UNIX,
$AF_INET = AF_INET,
$AF_DATAKIT = AF_DATAKIT,
$AF_INET6 = AF_INET6,
$SOCK_STREAM = SOCK_STREAM,
$SOCK_DGRAM = SOCK_DGRAM,
$SOCK_RAW = SOCK_RAW,
$SOCK_SEQPACKET = SOCK_SEQPACKET,
$SOL_SOCKET = SOL_SOCKET,
$SO_REUSEADDR = SO_REUSEADDR,
$SO_KEEPALIVE = SO_KEEPALIVE,
$SO_DONTROUTE = SO_DONTROUTE,
$SO_BROADCAST = SO_BROADCAST,
$SO_USELOOPBACK = SO_USELOOPBACK,
$SO_LINGER = SO_LINGER,
$SO_REUSEPORT = SO_REUSEPORT,
$SO_SNDBUF = SO_SNDBUF,
$SO_RCVBUF = SO_RCVBUF,
$SO_SNDTIMEO = SO_SNDTIMEO,
$SO_RCVTIMEO = SO_RCVTIMEO,
$SO_NOSIGPIPE = SO_NOSIGPIPE,
$IPPROTO_TCP = IPPROTO_TCP,
$IPPROTO_UDP = IPPROTO_UDP,
$TCP_NODELAY = TCP_NODELAY,
$SOMAXCONN = SOMAXCONN
};
typedef struct sockaddr_in $RawSockaddrInet4;
typedef struct sockaddr_in6 $RawSockaddrInet6;
typedef struct sockaddr_un $RawSockaddrUnix;
typedef struct sockaddr $RawSockaddr;
union sockaddr_all {
struct sockaddr s1; // this one gets used for fields
struct sockaddr_in s2; // these pad it out
struct sockaddr_in6 s3;
struct sockaddr_un s4;
};
struct sockaddr_any {
......@@ -180,59 +97,37 @@ struct sockaddr_any {
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
};
typedef struct sockaddr_in $RawSockaddrInet4;
typedef struct sockaddr_in6 $RawSockaddrInet6;
typedef struct sockaddr_un $RawSockaddrUnix;
typedef struct sockaddr $RawSockaddr;
typedef struct sockaddr_any $RawSockaddrAny;
typedef socklen_t $_Socklen;
typedef struct linger $Linger;
typedef struct iovec $Iovec;
typedef struct msghdr $Msghdr;
typedef struct cmsghdr $Cmsghdr;
enum {
$SizeofSockaddrInet4 = sizeof(struct sockaddr_in),
$SizeofSockaddrInet6 = sizeof(struct sockaddr_in6),
$SizeofSockaddrAny = sizeof(struct sockaddr_any),
$SizeofSockaddrUnix = sizeof(struct sockaddr_un),
$SizeofLinger = sizeof(struct linger),
$SizeofMsghdr = sizeof(struct msghdr),
$SizeofCmsghdr = sizeof(struct cmsghdr),
};
typedef struct sockaddr_any $RawSockaddrAny;
typedef socklen_t $_Socklen;
typedef struct linger $Linger;
// Ptrace requests
enum {
$_PTRACE_TRACEME = PT_TRACE_ME,
$_PTRACE_CONT = PT_CONTINUE,
$_PTRACE_KILL = PT_KILL,
$PTRACE_TRACEME = PT_TRACE_ME,
$PTRACE_CONT = PT_CONTINUE,
$PTRACE_KILL = PT_KILL,
};
// Events (kqueue, kevent)
enum {
// filters
$EVFILT_READ = EVFILT_READ,
$EVFILT_WRITE = EVFILT_WRITE,
$EVFILT_AIO = EVFILT_AIO,
$EVFILT_VNODE = EVFILT_VNODE,
$EVFILT_PROC = EVFILT_PROC,
$EVFILT_SIGNAL = EVFILT_SIGNAL,
$EVFILT_TIMER = EVFILT_TIMER,
$EVFILT_MACHPORT = EVFILT_MACHPORT,
$EVFILT_FS = EVFILT_FS,
$EVFILT_SYSCOUNT = EVFILT_SYSCOUNT,
// actions
$EV_ADD = EV_ADD,
$EV_DELETE = EV_DELETE,
$EV_DISABLE = EV_DISABLE,
$EV_RECEIPT = EV_RECEIPT,
// flags
$EV_ONESHOT = EV_ONESHOT,
$EV_CLEAR = EV_CLEAR,
$EV_SYSFLAGS = EV_SYSFLAGS,
$EV_FLAG0 = EV_FLAG0,
$EV_FLAG1 = EV_FLAG1,
// returned values
$EV_EOF = EV_EOF,
$EV_ERROR = EV_ERROR,
};
typedef struct kevent $Kevent_t;
// Select
......
......@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
/*
Input to godefs. See PORT.sh
Input to godefs. See also mkerrors.sh and mkall.sh
*/
#define _LARGEFILE_SOURCE
......@@ -78,113 +78,18 @@ typedef gid_t $_Gid_t;
// Files
enum
{
$O_RDONLY = O_RDONLY,
$O_WRONLY = O_WRONLY,
$O_RDWR = O_RDWR,
$O_APPEND = O_APPEND,
$O_ASYNC = O_ASYNC,
$O_CREAT = O_CREAT,
$O_NOCTTY = O_NOCTTY,
$O_NONBLOCK = O_NONBLOCK,
$O_SYNC = O_SYNC,
$O_TRUNC = O_TRUNC,
$O_CLOEXEC = 0, // not supported
$F_GETFD = F_GETFD,
$F_SETFD = F_SETFD,
$F_GETFL = F_GETFL,
$F_SETFL = F_SETFL,
$FD_CLOEXEC = FD_CLOEXEC,
$NAME_MAX = NAME_MAX
};
enum
{ // Directory mode bits
$S_IFMT = S_IFMT,
$S_IFIFO = S_IFIFO,
$S_IFCHR = S_IFCHR,
$S_IFDIR = S_IFDIR,
$S_IFBLK = S_IFBLK,
$S_IFREG = S_IFREG,
$S_IFLNK = S_IFLNK,
$S_IFSOCK = S_IFSOCK,
$S_ISUID = S_ISUID,
$S_ISGID = S_ISGID,
$S_ISVTX = S_ISVTX,
$S_IRUSR = S_IRUSR,
$S_IWUSR = S_IWUSR,
$S_IXUSR = S_IXUSR,
};
typedef struct stat $Stat_t;
typedef struct statfs $Statfs_t;
typedef struct dirent $Dirent;
// Wait status.
enum
{
$WNOHANG = WNOHANG,
$WUNTRACED = WUNTRACED,
$WEXITED = WEXITED,
$WSTOPPED = WSTOPPED,
$WCONTINUED = WCONTINUED,
$WNOWAIT = WNOWAIT,
// Linux-specific
$WCLONE = __WCLONE,
$WALL = __WALL,
$WNOTHREAD = __WNOTHREAD,
};
// Sockets
enum
{
$AF_UNIX = AF_UNIX,
$AF_INET = AF_INET,
$AF_INET6 = AF_INET6,
$SOCK_STREAM = SOCK_STREAM,
$SOCK_DGRAM = SOCK_DGRAM,
$SOCK_RAW = SOCK_RAW,
$SOCK_SEQPACKET = SOCK_SEQPACKET,
$SOL_SOCKET = SOL_SOCKET,
$SO_REUSEADDR = SO_REUSEADDR,
$SO_KEEPALIVE = SO_KEEPALIVE,
$SO_DONTROUTE = SO_DONTROUTE,
$SO_BROADCAST = SO_BROADCAST,
$SO_LINGER = SO_LINGER,
$SO_SNDBUF = SO_SNDBUF,
$SO_RCVBUF = SO_RCVBUF,
$SO_SNDTIMEO = SO_SNDTIMEO,
$SO_RCVTIMEO = SO_RCVTIMEO,
$IPPROTO_TCP = IPPROTO_TCP,
$IPPROTO_UDP = IPPROTO_UDP,
$TCP_NODELAY = TCP_NODELAY,
$SOMAXCONN = SOMAXCONN
};
typedef struct sockaddr_in $RawSockaddrInet4;
typedef struct sockaddr_in6 $RawSockaddrInet6;
typedef struct sockaddr_un $RawSockaddrUnix;
typedef struct sockaddr $RawSockaddr;
union sockaddr_all {
struct sockaddr s1; // this one gets used for fields
struct sockaddr_in s2; // these pad it out
struct sockaddr_in6 s3;
struct sockaddr_un s4;
};
struct sockaddr_any {
......@@ -192,83 +97,35 @@ struct sockaddr_any {
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
};
typedef struct sockaddr_in $RawSockaddrInet4;
typedef struct sockaddr_in6 $RawSockaddrInet6;
typedef struct sockaddr_un $RawSockaddrUnix;
typedef struct sockaddr $RawSockaddr;
typedef struct sockaddr_any $RawSockaddrAny;
typedef socklen_t $_Socklen;
typedef struct linger $Linger;
typedef struct iovec $Iovec;
typedef struct msghdr $Msghdr;
typedef struct cmsghdr $Cmsghdr;
enum {
$SizeofSockaddrInet4 = sizeof(struct sockaddr_in),
$SizeofSockaddrInet6 = sizeof(struct sockaddr_in6),
$SizeofSockaddrAny = sizeof(struct sockaddr_any),
$SizeofSockaddrUnix = sizeof(struct sockaddr_un),
$SizeofLinger = sizeof(struct linger),
$SizeofMsghdr = sizeof(struct msghdr),
$SizeofCmsghdr = sizeof(struct cmsghdr),
};
typedef struct sockaddr_any $RawSockaddrAny;
typedef socklen_t $_Socklen;
typedef struct linger $Linger;
// Ptrace
// Ptrace requests
enum {
$_PTRACE_TRACEME = PTRACE_TRACEME,
$_PTRACE_PEEKTEXT = PTRACE_PEEKTEXT,
$_PTRACE_PEEKDATA = PTRACE_PEEKDATA,
$_PTRACE_PEEKUSER = PTRACE_PEEKUSER,
$_PTRACE_POKETEXT = PTRACE_POKETEXT,
$_PTRACE_POKEDATA = PTRACE_POKEDATA,
$_PTRACE_POKEUSER = PTRACE_POKEUSER,
$_PTRACE_CONT = PTRACE_CONT,
$_PTRACE_KILL = PTRACE_KILL,
$_PTRACE_SINGLESTEP = PTRACE_SINGLESTEP,
$_PTRACE_GETREGS = PTRACE_GETREGS,
$_PTRACE_SETREGS = PTRACE_SETREGS,
$_PTRACE_GETFPREGS = PTRACE_GETFPREGS,
$_PTRACE_SETFPREGS = PTRACE_SETFPREGS,
$_PTRACE_ATTACH = PTRACE_ATTACH,
$_PTRACE_DETACH = PTRACE_DETACH,
$_PTRACE_GETFPXREGS = PTRACE_GETFPXREGS,
$_PTRACE_SETFPXREGS = PTRACE_SETFPXREGS,
$_PTRACE_SYSCALL = PTRACE_SYSCALL,
$_PTRACE_SETOPTIONS = PTRACE_SETOPTIONS,
$_PTRACE_GETEVENTMSG = PTRACE_GETEVENTMSG,
$_PTRACE_GETSIGINFO = PTRACE_GETSIGINFO,
$_PTRACE_SETSIGINFO = PTRACE_SETSIGINFO,
};
// PTRACE_SETOPTIONS options
enum {
$PTRACE_O_TRACESYSGOOD = PTRACE_O_TRACESYSGOOD,
$PTRACE_O_TRACEFORK = PTRACE_O_TRACEFORK,
$PTRACE_O_TRACEVFORK = PTRACE_O_TRACEVFORK,
$PTRACE_O_TRACECLONE = PTRACE_O_TRACECLONE,
$PTRACE_O_TRACEEXEC = PTRACE_O_TRACEEXEC,
$PTRACE_O_TRACEVFORKDONE = PTRACE_O_TRACEVFORKDONE,
$PTRACE_O_TRACEEXIT = PTRACE_O_TRACEEXIT,
$PTRACE_O_MASK = PTRACE_O_MASK,
};
// Extended result codes
enum {
$PTRACE_EVENT_FORK = PTRACE_EVENT_FORK,
$PTRACE_EVENT_VFORK = PTRACE_EVENT_VFORK,
$PTRACE_EVENT_CLONE = PTRACE_EVENT_CLONE,
$PTRACE_EVENT_EXEC = PTRACE_EVENT_EXEC,
$PTRACE_EVENT_VFORK_DONE = PTRACE_EVENT_VFORK_DONE,
$PTRACE_EVENT_EXIT = PTRACE_EVENT_EXIT,
};
// Register structures
typedef struct user_regs_struct $PtraceRegs;
// Misc
enum {
$EPOLLIN = EPOLLIN,
$EPOLLRDHUP = EPOLLRDHUP,
$EPOLLOUT = EPOLLOUT,
$EPOLLONESHOT = EPOLLONESHOT,
$EPOLL_CTL_MOD = EPOLL_CTL_MOD,
$EPOLL_CTL_ADD = EPOLL_CTL_ADD,
$EPOLL_CTL_DEL = EPOLL_CTL_DEL,
};
typedef fd_set $FdSet;
typedef struct sysinfo $Sysinfo_t;
typedef struct utsname $Utsname;
......
......@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
/*
Input to godefs. See PORT.sh
Input to godefs. See also mkerrors.sh and mkall.sh
*/
#define _LARGEFILE_SOURCE
......@@ -88,6 +88,7 @@ enum
$O_NONBLOCK = O_NONBLOCK,
$O_SYNC = O_SYNC,
$O_TRUNC = O_TRUNC,
$O_EXCL = O_EXCL,
$O_CLOEXEC = 0, // not supported
$F_GETFD = F_GETFD,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -77,6 +77,27 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
return;
}
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)));
n = int(r0);
errno = int(e1);
return;
}
func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
var _p0 *byte;
if len(buf) > 0 {
_p0 = &buf[0];
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen));
errno = int(e1);
return;
}
func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) {
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)));
n = int(r0);
......
......@@ -77,6 +77,27 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
return;
}
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)));
n = int(r0);
errno = int(e1);
return;
}
func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
var _p0 *byte;
if len(buf) > 0 {
_p0 = &buf[0];
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen));
errno = int(e1);
return;
}
func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) {
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)));
n = int(r0);
......
......@@ -261,18 +261,6 @@ func Gettimeofday(tv *Timeval) (errno int) {
return;
}
func Ioperm(from int, num int, on int) (errno int) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on));
errno = int(e1);
return;
}
func Iopl(level int) (errno int) {
_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0);
errno = int(e1);
return;
}
func Kill(pid int, sig int) (errno int) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(sig), 0);
errno = int(e1);
......@@ -481,12 +469,6 @@ func Sync() {
return;
}
func SyncFileRange(fd int, off int64, n int64, flags int) (errno int) {
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags));
errno = int(e1);
return;
}
func Sysinfo(info *Sysinfo_t) (errno int) {
_, _, e1 := Syscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0);
errno = int(e1);
......@@ -646,6 +628,18 @@ func Getuid() (uid int) {
return;
}
func Ioperm(from int, num int, on int) (errno int) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on));
errno = int(e1);
return;
}
func Iopl(level int) (errno int) {
_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0);
errno = int(e1);
return;
}
func Lchown(path string, uid int, gid int) (errno int) {
_, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid));
errno = int(e1);
......@@ -712,6 +706,12 @@ func Statfs(path string, buf *Statfs_t) (errno int) {
return;
}
func SyncFileRange(fd int, off int64, n int64, flags int) (errno int) {
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags));
errno = int(e1);
return;
}
func getgroups(n int, list *_Gid_t) (nn int, errno int) {
r0, _, e1 := Syscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0);
nn = int(r0);
......
......@@ -261,18 +261,6 @@ func Gettimeofday(tv *Timeval) (errno int) {
return;
}
func Ioperm(from int, num int, on int) (errno int) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on));
errno = int(e1);
return;
}
func Iopl(level int) (errno int) {
_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0);
errno = int(e1);
return;
}
func Kill(pid int, sig int) (errno int) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(sig), 0);
errno = int(e1);
......@@ -482,12 +470,6 @@ func Sync() {
return;
}
func SyncFileRange(fd int, off int64, n int64, flags int) (errno int) {
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0);
errno = int(e1);
return;
}
func Sysinfo(info *Sysinfo_t) (errno int) {
_, _, e1 := Syscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0);
errno = int(e1);
......@@ -648,6 +630,18 @@ func Getuid() (uid int) {
return;
}
func Ioperm(from int, num int, on int) (errno int) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on));
errno = int(e1);
return;
}
func Iopl(level int) (errno int) {
_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0);
errno = int(e1);
return;
}
func Lchown(path string, uid int, gid int) (errno int) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid));
errno = int(e1);
......@@ -740,6 +734,12 @@ func Statfs(path string, buf *Statfs_t) (errno int) {
return;
}
func SyncFileRange(fd int, off int64, n int64, flags int) (errno int) {
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0);
errno = int(e1);
return;
}
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);
......@@ -796,3 +796,24 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
errno = int(e1);
return;
}
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)));
n = int(r0);
errno = int(e1);
return;
}
func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
var _p0 *byte;
if len(buf) > 0 {
_p0 = &buf[0];
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen));
errno = int(e1);
return;
}
......@@ -163,7 +163,7 @@ const (
SYS_FUTIMES = 139; // { int futimes(int fd, struct timeval *tptr); }
SYS_ADJTIME = 140; // { int adjtime(struct timeval *delta, struct timeval *olddelta); }
// SYS_NOSYS = 141; // { int nosys(void); } { old getpeername }
SYS_GETHOSTUUID = 142; // { int gethostuuid(unsigned char *uuid_buf, const struct timespec *timeoutp); }
SYS_GETHOSTUUID = 142; // { int gethostuuid(unsigned char *uuid_buf, const struct timespec *timeoutp); }
// SYS_NOSYS = 143; // { int nosys(void); } { old sethostid }
// SYS_NOSYS = 144; // { int nosys(void); } { old getrlimit }
// SYS_NOSYS = 145; // { int nosys(void); } { old setrlimit }
......@@ -215,19 +215,19 @@ const (
SYS_PATHCONF = 191; // { int pathconf(char *path, int name); }
SYS_FPATHCONF = 192; // { int fpathconf(int fd, int name); }
// SYS_NOSYS = 193; // { int nosys(void); }
SYS_GETRLIMIT = 194; // { int getrlimit(u_int which, struct rlimit *rlp); }
SYS_SETRLIMIT = 195; // { int setrlimit(u_int which, struct rlimit *rlp); }
SYS_GETDIRENTRIES = 196; // { int getdirentries(int fd, char *buf, u_int count, long *basep); }
SYS_MMAP = 197; // { user_addr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); }
SYS_GETRLIMIT = 194; // { int getrlimit(u_int which, struct rlimit *rlp); }
SYS_SETRLIMIT = 195; // { int setrlimit(u_int which, struct rlimit *rlp); }
SYS_GETDIRENTRIES = 196; // { int getdirentries(int fd, char *buf, u_int count, long *basep); }
SYS_MMAP = 197; // { user_addr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); }
// SYS_NOSYS = 198; // { int nosys(void); } { __syscall }
SYS_LSEEK = 199; // { off_t lseek(int fd, off_t offset, int whence); }
SYS_TRUNCATE = 200; // { int truncate(char *path, off_t length); }
SYS_FTRUNCATE = 201; // { int ftruncate(int fd, off_t length); }
SYS___SYSCTL = 202; // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); }
SYS_MLOCK = 203; // { int mlock(caddr_t addr, size_t len); }
SYS_MUNLOCK = 204; // { int munlock(caddr_t addr, size_t len); }
SYS_UNDELETE = 205; // { int undelete(user_addr_t path); }
SYS_ATSOCKET = 206; // { int ATsocket(int proto); }
SYS_LSEEK = 199; // { off_t lseek(int fd, off_t offset, int whence); }
SYS_TRUNCATE = 200; // { int truncate(char *path, off_t length); }
SYS_FTRUNCATE = 201; // { int ftruncate(int fd, off_t length); }
SYS___SYSCTL = 202; // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); }
SYS_MLOCK = 203; // { int mlock(caddr_t addr, size_t len); }
SYS_MUNLOCK = 204; // { int munlock(caddr_t addr, size_t len); }
SYS_UNDELETE = 205; // { int undelete(user_addr_t path); }
SYS_ATSOCKET = 206; // { int ATsocket(int proto); }
// SYS_NOSYS = 213; // { int nosys(void); } { Reserved for AppleTalk }
// SYS_NOSYS = 206; // { int nosys(void); }
// SYS_NOSYS = 207; // { int nosys(void); }
......
......@@ -163,7 +163,7 @@ const (
SYS_FUTIMES = 139; // { int futimes(int fd, struct timeval *tptr); }
SYS_ADJTIME = 140; // { int adjtime(struct timeval *delta, struct timeval *olddelta); }
// SYS_NOSYS = 141; // { int nosys(void); } { old getpeername }
SYS_GETHOSTUUID = 142; // { int gethostuuid(unsigned char *uuid_buf, const struct timespec *timeoutp); }
SYS_GETHOSTUUID = 142; // { int gethostuuid(unsigned char *uuid_buf, const struct timespec *timeoutp); }
// SYS_NOSYS = 143; // { int nosys(void); } { old sethostid }
// SYS_NOSYS = 144; // { int nosys(void); } { old getrlimit }
// SYS_NOSYS = 145; // { int nosys(void); } { old setrlimit }
......@@ -215,19 +215,19 @@ const (
SYS_PATHCONF = 191; // { int pathconf(char *path, int name); }
SYS_FPATHCONF = 192; // { int fpathconf(int fd, int name); }
// SYS_NOSYS = 193; // { int nosys(void); }
SYS_GETRLIMIT = 194; // { int getrlimit(u_int which, struct rlimit *rlp); }
SYS_SETRLIMIT = 195; // { int setrlimit(u_int which, struct rlimit *rlp); }
SYS_GETDIRENTRIES = 196; // { int getdirentries(int fd, char *buf, u_int count, long *basep); }
SYS_MMAP = 197; // { user_addr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); }
SYS_GETRLIMIT = 194; // { int getrlimit(u_int which, struct rlimit *rlp); }
SYS_SETRLIMIT = 195; // { int setrlimit(u_int which, struct rlimit *rlp); }
SYS_GETDIRENTRIES = 196; // { int getdirentries(int fd, char *buf, u_int count, long *basep); }
SYS_MMAP = 197; // { user_addr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); }
// SYS_NOSYS = 198; // { int nosys(void); } { __syscall }
SYS_LSEEK = 199; // { off_t lseek(int fd, off_t offset, int whence); }
SYS_TRUNCATE = 200; // { int truncate(char *path, off_t length); }
SYS_FTRUNCATE = 201; // { int ftruncate(int fd, off_t length); }
SYS___SYSCTL = 202; // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); }
SYS_MLOCK = 203; // { int mlock(caddr_t addr, size_t len); }
SYS_MUNLOCK = 204; // { int munlock(caddr_t addr, size_t len); }
SYS_UNDELETE = 205; // { int undelete(user_addr_t path); }
SYS_ATSOCKET = 206; // { int ATsocket(int proto); }
SYS_LSEEK = 199; // { off_t lseek(int fd, off_t offset, int whence); }
SYS_TRUNCATE = 200; // { int truncate(char *path, off_t length); }
SYS_FTRUNCATE = 201; // { int ftruncate(int fd, off_t length); }
SYS___SYSCTL = 202; // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); }
SYS_MLOCK = 203; // { int mlock(caddr_t addr, size_t len); }
SYS_MUNLOCK = 204; // { int munlock(caddr_t addr, size_t len); }
SYS_UNDELETE = 205; // { int undelete(user_addr_t path); }
SYS_ATSOCKET = 206; // { int ATsocket(int proto); }
// SYS_NOSYS = 213; // { int nosys(void); } { Reserved for AppleTalk }
// SYS_NOSYS = 206; // { int nosys(void); }
// SYS_NOSYS = 207; // { int nosys(void); }
......
......@@ -11,97 +11,17 @@ const (
sizeofInt = 0x4;
sizeofLong = 0x4;
sizeofLongLong = 0x8;
O_RDONLY = 0;
O_WRONLY = 0x1;
O_RDWR = 0x2;
O_APPEND = 0x8;
O_ASYNC = 0x40;
O_CREAT = 0x200;
O_NOCTTY = 0x20000;
O_NONBLOCK = 0x4;
O_SYNC = 0x80;
O_TRUNC = 0x400;
O_CLOEXEC = 0;
F_GETFD = 0x1;
F_SETFD = 0x2;
F_GETFL = 0x3;
F_SETFL = 0x4;
FD_CLOEXEC = 0x1;
NAME_MAX = 0xff;
S_IFMT = 0xf000;
S_IFIFO = 0x1000;
S_IFCHR = 0x2000;
S_IFDIR = 0x4000;
S_IFBLK = 0x6000;
S_IFREG = 0x8000;
S_IFLNK = 0xa000;
S_IFSOCK = 0xc000;
S_IFWHT = 0xe000;
S_ISUID = 0x800;
S_ISGID = 0x400;
S_ISVTX = 0x200;
S_IRUSR = 0x100;
S_IWUSR = 0x80;
S_IXUSR = 0x40;
WNOHANG = 0x1;
WUNTRACED = 0x2;
WEXITED = 0x4;
WSTOPPED = 0x7f;
WCONTINUED = 0x10;
WNOWAIT = 0x20;
AF_UNIX = 0x1;
AF_INET = 0x2;
AF_DATAKIT = 0x9;
AF_INET6 = 0x1e;
SOCK_STREAM = 0x1;
SOCK_DGRAM = 0x2;
SOCK_RAW = 0x3;
SOCK_SEQPACKET = 0x5;
SOL_SOCKET = 0xffff;
SO_REUSEADDR = 0x4;
SO_KEEPALIVE = 0x8;
SO_DONTROUTE = 0x10;
SO_BROADCAST = 0x20;
SO_USELOOPBACK = 0x40;
SO_LINGER = 0x80;
SO_REUSEPORT = 0x200;
SO_SNDBUF = 0x1001;
SO_RCVBUF = 0x1002;
SO_SNDTIMEO = 0x1005;
SO_RCVTIMEO = 0x1006;
SO_NOSIGPIPE = 0x1022;
IPPROTO_TCP = 0x6;
IPPROTO_UDP = 0x11;
TCP_NODELAY = 0x1;
SOMAXCONN = 0x80;
SizeofSockaddrInet4 = 0x10;
SizeofSockaddrInet6 = 0x1c;
SizeofSockaddrAny = 0x1c;
SizeofSockaddrAny = 0x6c;
SizeofSockaddrUnix = 0x6a;
_PTRACE_TRACEME = 0;
_PTRACE_CONT = 0x7;
_PTRACE_KILL = 0x8;
EVFILT_READ = -0x1;
EVFILT_WRITE = -0x2;
EVFILT_AIO = -0x3;
EVFILT_VNODE = -0x4;
EVFILT_PROC = -0x5;
EVFILT_SIGNAL = -0x6;
EVFILT_TIMER = -0x7;
EVFILT_MACHPORT = -0x8;
EVFILT_FS = -0x9;
EVFILT_SYSCOUNT = 0x9;
EV_ADD = 0x1;
EV_DELETE = 0x2;
EV_DISABLE = 0x8;
EV_RECEIPT = 0x40;
EV_ONESHOT = 0x10;
EV_CLEAR = 0x20;
EV_SYSFLAGS = 0xf000;
EV_FLAG0 = 0x1000;
EV_FLAG1 = 0x2000;
EV_EOF = 0x8000;
EV_ERROR = 0x4000;
SizeofLinger = 0x8;
SizeofMsghdr = 0x1c;
SizeofCmsghdr = 0xc;
PTRACE_TRACEME = 0;
PTRACE_CONT = 0x7;
PTRACE_KILL = 0x8;
)
// Types
......@@ -190,6 +110,39 @@ type Statfs_t struct {
Reserved [8]uint32;
}
type Flock_t struct {
Start int64;
Len int64;
Pid int32;
Type int16;
Whence int16;
}
type Fstore_t struct {
Flags uint32;
Posmode int32;
Offset int64;
Length int64;
Bytesalloc int64;
}
type Radvisory_t struct {
Offset int64;
Count int32;
}
type Fbootstraptransfer_t struct {
Offset int64;
Length uint32;
Buffer *byte;
}
type Log2phys_t struct {
Flags uint32;
Contigbytes int64;
Devoffset int64;
}
type Dirent struct {
Ino uint64;
Seekoff uint64;
......@@ -231,7 +184,7 @@ type RawSockaddr struct {
type RawSockaddrAny struct {
Addr RawSockaddr;
Pad [12]int8;
Pad [92]int8;
}
type _Socklen uint32
......@@ -241,6 +194,27 @@ type Linger struct {
Linger int32;
}
type Iovec struct {
Base *byte;
Len uint32;
}
type Msghdr struct {
Name *byte;
Namelen uint32;
Iov *Iovec;
Iovlen int32;
Control *byte;
Controllen uint32;
Flags int32;
}
type Cmsghdr struct {
Len uint32;
Level int32;
Type int32;
}
type Kevent_t struct {
Ident uint32;
Filter int16;
......
......@@ -11,97 +11,17 @@ const (
sizeofInt = 0x4;
sizeofLong = 0x8;
sizeofLongLong = 0x8;
O_RDONLY = 0;
O_WRONLY = 0x1;
O_RDWR = 0x2;
O_APPEND = 0x8;
O_ASYNC = 0x40;
O_CREAT = 0x200;
O_NOCTTY = 0x20000;
O_NONBLOCK = 0x4;
O_SYNC = 0x80;
O_TRUNC = 0x400;
O_CLOEXEC = 0;
F_GETFD = 0x1;
F_SETFD = 0x2;
F_GETFL = 0x3;
F_SETFL = 0x4;
FD_CLOEXEC = 0x1;
NAME_MAX = 0xff;
S_IFMT = 0xf000;
S_IFIFO = 0x1000;
S_IFCHR = 0x2000;
S_IFDIR = 0x4000;
S_IFBLK = 0x6000;
S_IFREG = 0x8000;
S_IFLNK = 0xa000;
S_IFSOCK = 0xc000;
S_IFWHT = 0xe000;
S_ISUID = 0x800;
S_ISGID = 0x400;
S_ISVTX = 0x200;
S_IRUSR = 0x100;
S_IWUSR = 0x80;
S_IXUSR = 0x40;
WNOHANG = 0x1;
WUNTRACED = 0x2;
WEXITED = 0x4;
WSTOPPED = 0x7f;
WCONTINUED = 0x10;
WNOWAIT = 0x20;
AF_UNIX = 0x1;
AF_INET = 0x2;
AF_DATAKIT = 0x9;
AF_INET6 = 0x1e;
SOCK_STREAM = 0x1;
SOCK_DGRAM = 0x2;
SOCK_RAW = 0x3;
SOCK_SEQPACKET = 0x5;
SOL_SOCKET = 0xffff;
SO_REUSEADDR = 0x4;
SO_KEEPALIVE = 0x8;
SO_DONTROUTE = 0x10;
SO_BROADCAST = 0x20;
SO_USELOOPBACK = 0x40;
SO_LINGER = 0x80;
SO_REUSEPORT = 0x200;
SO_SNDBUF = 0x1001;
SO_RCVBUF = 0x1002;
SO_SNDTIMEO = 0x1005;
SO_RCVTIMEO = 0x1006;
SO_NOSIGPIPE = 0x1022;
IPPROTO_TCP = 0x6;
IPPROTO_UDP = 0x11;
TCP_NODELAY = 0x1;
SOMAXCONN = 0x80;
SizeofSockaddrInet4 = 0x10;
SizeofSockaddrInet6 = 0x1c;
SizeofSockaddrAny = 0x1c;
SizeofSockaddrAny = 0x6c;
SizeofSockaddrUnix = 0x6a;
_PTRACE_TRACEME = 0;
_PTRACE_CONT = 0x7;
_PTRACE_KILL = 0x8;
EVFILT_READ = -0x1;
EVFILT_WRITE = -0x2;
EVFILT_AIO = -0x3;
EVFILT_VNODE = -0x4;
EVFILT_PROC = -0x5;
EVFILT_SIGNAL = -0x6;
EVFILT_TIMER = -0x7;
EVFILT_MACHPORT = -0x8;
EVFILT_FS = -0x9;
EVFILT_SYSCOUNT = 0x9;
EV_ADD = 0x1;
EV_DELETE = 0x2;
EV_DISABLE = 0x8;
EV_RECEIPT = 0x40;
EV_ONESHOT = 0x10;
EV_CLEAR = 0x20;
EV_SYSFLAGS = 0xf000;
EV_FLAG0 = 0x1000;
EV_FLAG1 = 0x2000;
EV_EOF = 0x8000;
EV_ERROR = 0x4000;
SizeofLinger = 0x8;
SizeofMsghdr = 0x30;
SizeofCmsghdr = 0xc;
PTRACE_TRACEME = 0;
PTRACE_CONT = 0x7;
PTRACE_KILL = 0x8;
)
// Types
......@@ -192,6 +112,40 @@ type Statfs_t struct {
Reserved [8]uint32;
}
type Flock_t struct {
Start int64;
Len int64;
Pid int32;
Type int16;
Whence int16;
}
type Fstore_t struct {
Flags uint32;
Posmode int32;
Offset int64;
Length int64;
Bytesalloc int64;
}
type Radvisory_t struct {
Offset int64;
Count int32;
Pad0 [4]byte;
}
type Fbootstraptransfer_t struct {
Offset int64;
Length uint64;
Buffer *byte;
}
type Log2phys_t struct {
Flags uint32;
Contigbytes int64;
Devoffset int64;
}
type Dirent struct {
Ino uint64;
Seekoff uint64;
......@@ -233,7 +187,7 @@ type RawSockaddr struct {
type RawSockaddrAny struct {
Addr RawSockaddr;
Pad [12]int8;
Pad [92]int8;
}
type _Socklen uint32
......@@ -243,6 +197,29 @@ type Linger struct {
Linger int32;
}
type Iovec struct {
Base *byte;
Len uint64;
}
type Msghdr struct {
Name *byte;
Namelen uint32;
Pad0 [4]byte;
Iov *Iovec;
Iovlen int32;
Pad1 [4]byte;
Control *byte;
Controllen uint32;
Flags int32;
}
type Cmsghdr struct {
Len uint32;
Level int32;
Type int32;
}
type Kevent_t struct {
Ident uint64;
Filter int16;
......
......@@ -12,115 +12,13 @@ const (
sizeofLong = 0x4;
sizeofLongLong = 0x8;
PathMax = 0x1000;
O_RDONLY = 0;
O_WRONLY = 0x1;
O_RDWR = 0x2;
O_APPEND = 0x400;
O_ASYNC = 0x2000;
O_CREAT = 0x40;
O_NOCTTY = 0x100;
O_NONBLOCK = 0x800;
O_SYNC = 0x1000;
O_TRUNC = 0x200;
O_CLOEXEC = 0;
F_GETFD = 0x1;
F_SETFD = 0x2;
F_GETFL = 0x3;
F_SETFL = 0x4;
FD_CLOEXEC = 0x1;
NAME_MAX = 0xff;
S_IFMT = 0xf000;
S_IFIFO = 0x1000;
S_IFCHR = 0x2000;
S_IFDIR = 0x4000;
S_IFBLK = 0x6000;
S_IFREG = 0x8000;
S_IFLNK = 0xa000;
S_IFSOCK = 0xc000;
S_ISUID = 0x800;
S_ISGID = 0x400;
S_ISVTX = 0x200;
S_IRUSR = 0x100;
S_IWUSR = 0x80;
S_IXUSR = 0x40;
WNOHANG = 0x1;
WUNTRACED = 0x2;
WEXITED = 0x4;
WSTOPPED = 0x2;
WCONTINUED = 0x8;
WNOWAIT = 0x1000000;
WCLONE = 0x80000000;
WALL = 0x40000000;
WNOTHREAD = 0x20000000;
AF_UNIX = 0x1;
AF_INET = 0x2;
AF_INET6 = 0xa;
SOCK_STREAM = 0x1;
SOCK_DGRAM = 0x2;
SOCK_RAW = 0x3;
SOCK_SEQPACKET = 0x5;
SOL_SOCKET = 0x1;
SO_REUSEADDR = 0x2;
SO_KEEPALIVE = 0x9;
SO_DONTROUTE = 0x5;
SO_BROADCAST = 0x6;
SO_LINGER = 0xd;
SO_SNDBUF = 0x7;
SO_RCVBUF = 0x8;
SO_SNDTIMEO = 0x15;
SO_RCVTIMEO = 0x14;
IPPROTO_TCP = 0x6;
IPPROTO_UDP = 0x11;
TCP_NODELAY = 0x1;
SOMAXCONN = 0x80;
SizeofSockaddrInet4 = 0x10;
SizeofSockaddrInet6 = 0x1c;
SizeofSockaddrAny = 0x1c;
SizeofSockaddrAny = 0x70;
SizeofSockaddrUnix = 0x6e;
_PTRACE_TRACEME = 0;
_PTRACE_PEEKTEXT = 0x1;
_PTRACE_PEEKDATA = 0x2;
_PTRACE_PEEKUSER = 0x3;
_PTRACE_POKETEXT = 0x4;
_PTRACE_POKEDATA = 0x5;
_PTRACE_POKEUSER = 0x6;
_PTRACE_CONT = 0x7;
_PTRACE_KILL = 0x8;
_PTRACE_SINGLESTEP = 0x9;
_PTRACE_GETREGS = 0xc;
_PTRACE_SETREGS = 0xd;
_PTRACE_GETFPREGS = 0xe;
_PTRACE_SETFPREGS = 0xf;
_PTRACE_ATTACH = 0x10;
_PTRACE_DETACH = 0x11;
_PTRACE_GETFPXREGS = 0x12;
_PTRACE_SETFPXREGS = 0x13;
_PTRACE_SYSCALL = 0x18;
_PTRACE_SETOPTIONS = 0x4200;
_PTRACE_GETEVENTMSG = 0x4201;
_PTRACE_GETSIGINFO = 0x4202;
_PTRACE_SETSIGINFO = 0x4203;
PTRACE_O_TRACESYSGOOD = 0x1;
PTRACE_O_TRACEFORK = 0x2;
PTRACE_O_TRACEVFORK = 0x4;
PTRACE_O_TRACECLONE = 0x8;
PTRACE_O_TRACEEXEC = 0x10;
PTRACE_O_TRACEVFORKDONE = 0x20;
PTRACE_O_TRACEEXIT = 0x40;
PTRACE_O_MASK = 0x7f;
PTRACE_EVENT_FORK = 0x1;
PTRACE_EVENT_VFORK = 0x2;
PTRACE_EVENT_CLONE = 0x3;
PTRACE_EVENT_EXEC = 0x4;
PTRACE_EVENT_VFORK_DONE = 0x5;
PTRACE_EVENT_EXIT = 0x6;
EPOLLIN = 0x1;
EPOLLRDHUP = 0x2000;
EPOLLOUT = 0x4;
EPOLLONESHOT = 0x40000000;
EPOLL_CTL_MOD = 0x3;
EPOLL_CTL_ADD = 0x1;
EPOLL_CTL_DEL = 0x2;
SizeofLinger = 0x8;
SizeofMsghdr = 0x1c;
SizeofCmsghdr = 0xc;
)
// Types
......@@ -219,15 +117,15 @@ type _Gid_t uint32
type Stat_t struct {
Dev uint64;
__pad1 uint16;
X__pad1 uint16;
Pad0 [2]byte;
__st_ino uint32;
X__st_ino uint32;
Mode uint32;
Nlink uint32;
Uid uint32;
Gid uint32;
Rdev uint64;
__pad2 uint16;
X__pad2 uint16;
Pad1 [2]byte;
Size int64;
Blksize int32;
......@@ -288,7 +186,7 @@ type RawSockaddr struct {
type RawSockaddrAny struct {
Addr RawSockaddr;
Pad [12]int8;
Pad [96]int8;
}
type _Socklen uint32
......@@ -298,6 +196,27 @@ type Linger struct {
Linger int32;
}
type Iovec struct {
Base *byte;
Len uint32;
}
type Msghdr struct {
Name *byte;
Namelen uint32;
Iov *Iovec;
Iovlen uint32;
Control *byte;
Controllen uint32;
Flags int32;
}
type Cmsghdr struct {
Len uint32;
Level int32;
Type int32;
}
type PtraceRegs struct {
Ebx int32;
Ecx int32;
......@@ -342,7 +261,7 @@ type Sysinfo_t struct {
Totalhigh uint32;
Freehigh uint32;
Unit uint32;
_f [8]int8;
X_f [8]int8;
}
type Utsname struct {
......
......@@ -12,115 +12,13 @@ const (
sizeofLong = 0x8;
sizeofLongLong = 0x8;
PathMax = 0x1000;
O_RDONLY = 0;
O_WRONLY = 0x1;
O_RDWR = 0x2;
O_APPEND = 0x400;
O_ASYNC = 0x2000;
O_CREAT = 0x40;
O_NOCTTY = 0x100;
O_NONBLOCK = 0x800;
O_SYNC = 0x1000;
O_TRUNC = 0x200;
O_CLOEXEC = 0;
F_GETFD = 0x1;
F_SETFD = 0x2;
F_GETFL = 0x3;
F_SETFL = 0x4;
FD_CLOEXEC = 0x1;
NAME_MAX = 0xff;
S_IFMT = 0xf000;
S_IFIFO = 0x1000;
S_IFCHR = 0x2000;
S_IFDIR = 0x4000;
S_IFBLK = 0x6000;
S_IFREG = 0x8000;
S_IFLNK = 0xa000;
S_IFSOCK = 0xc000;
S_ISUID = 0x800;
S_ISGID = 0x400;
S_ISVTX = 0x200;
S_IRUSR = 0x100;
S_IWUSR = 0x80;
S_IXUSR = 0x40;
WNOHANG = 0x1;
WUNTRACED = 0x2;
WEXITED = 0x4;
WSTOPPED = 0x2;
WCONTINUED = 0x8;
WNOWAIT = 0x1000000;
WCLONE = 0x80000000;
WALL = 0x40000000;
WNOTHREAD = 0x20000000;
AF_UNIX = 0x1;
AF_INET = 0x2;
AF_INET6 = 0xa;
SOCK_STREAM = 0x1;
SOCK_DGRAM = 0x2;
SOCK_RAW = 0x3;
SOCK_SEQPACKET = 0x5;
SOL_SOCKET = 0x1;
SO_REUSEADDR = 0x2;
SO_KEEPALIVE = 0x9;
SO_DONTROUTE = 0x5;
SO_BROADCAST = 0x6;
SO_LINGER = 0xd;
SO_SNDBUF = 0x7;
SO_RCVBUF = 0x8;
SO_SNDTIMEO = 0x15;
SO_RCVTIMEO = 0x14;
IPPROTO_TCP = 0x6;
IPPROTO_UDP = 0x11;
TCP_NODELAY = 0x1;
SOMAXCONN = 0x80;
SizeofSockaddrInet4 = 0x10;
SizeofSockaddrInet6 = 0x1c;
SizeofSockaddrAny = 0x1c;
SizeofSockaddrAny = 0x70;
SizeofSockaddrUnix = 0x6e;
_PTRACE_TRACEME = 0;
_PTRACE_PEEKTEXT = 0x1;
_PTRACE_PEEKDATA = 0x2;
_PTRACE_PEEKUSER = 0x3;
_PTRACE_POKETEXT = 0x4;
_PTRACE_POKEDATA = 0x5;
_PTRACE_POKEUSER = 0x6;
_PTRACE_CONT = 0x7;
_PTRACE_KILL = 0x8;
_PTRACE_SINGLESTEP = 0x9;
_PTRACE_GETREGS = 0xc;
_PTRACE_SETREGS = 0xd;
_PTRACE_GETFPREGS = 0xe;
_PTRACE_SETFPREGS = 0xf;
_PTRACE_ATTACH = 0x10;
_PTRACE_DETACH = 0x11;
_PTRACE_GETFPXREGS = 0x12;
_PTRACE_SETFPXREGS = 0x13;
_PTRACE_SYSCALL = 0x18;
_PTRACE_SETOPTIONS = 0x4200;
_PTRACE_GETEVENTMSG = 0x4201;
_PTRACE_GETSIGINFO = 0x4202;
_PTRACE_SETSIGINFO = 0x4203;
PTRACE_O_TRACESYSGOOD = 0x1;
PTRACE_O_TRACEFORK = 0x2;
PTRACE_O_TRACEVFORK = 0x4;
PTRACE_O_TRACECLONE = 0x8;
PTRACE_O_TRACEEXEC = 0x10;
PTRACE_O_TRACEVFORKDONE = 0x20;
PTRACE_O_TRACEEXIT = 0x40;
PTRACE_O_MASK = 0x7f;
PTRACE_EVENT_FORK = 0x1;
PTRACE_EVENT_VFORK = 0x2;
PTRACE_EVENT_CLONE = 0x3;
PTRACE_EVENT_EXEC = 0x4;
PTRACE_EVENT_VFORK_DONE = 0x5;
PTRACE_EVENT_EXIT = 0x6;
EPOLLIN = 0x1;
EPOLLRDHUP = 0x2000;
EPOLLOUT = 0x4;
EPOLLONESHOT = 0x40000000;
EPOLL_CTL_MOD = 0x3;
EPOLL_CTL_ADD = 0x1;
EPOLL_CTL_DEL = 0x2;
SizeofLinger = 0x8;
SizeofMsghdr = 0x38;
SizeofCmsghdr = 0x10;
)
// Types
......@@ -288,7 +186,7 @@ type RawSockaddr struct {
type RawSockaddrAny struct {
Addr RawSockaddr;
Pad [12]int8;
Pad [96]int8;
}
type _Socklen uint32
......@@ -298,6 +196,29 @@ type Linger struct {
Linger int32;
}
type Iovec struct {
Base *byte;
Len uint64;
}
type Msghdr struct {
Name *byte;
Namelen uint32;
Pad0 [4]byte;
Iov *Iovec;
Iovlen uint64;
Control *byte;
Controllen uint64;
Flags int32;
Pad1 [4]byte;
}
type Cmsghdr struct {
Len uint64;
Level int32;
Type int32;
}
type PtraceRegs struct {
R15 uint64;
R14 uint64;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment