mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: openbsd amd64 syscall support
Add support for syscalls on openbsd amd64. This is based on the existing freebsd amd64 implementation. R=mikioh.mikioh, rsc, yourcomputerpal CC=golang-dev https://golang.org/cl/4798060
This commit is contained in:
parent
be00d38a35
commit
bf2d403de8
14 changed files with 3641 additions and 2 deletions
|
|
@ -42,6 +42,15 @@ GOFILES_linux=\
|
||||||
sockcmsg_unix.go\
|
sockcmsg_unix.go\
|
||||||
syscall_unix.go\
|
syscall_unix.go\
|
||||||
|
|
||||||
|
GOFILES_openbsd=\
|
||||||
|
bpf_bsd.go\
|
||||||
|
exec_unix.go\
|
||||||
|
route_bsd.go\
|
||||||
|
route_openbsd.go\
|
||||||
|
sockcmsg_unix.go\
|
||||||
|
syscall_bsd.go\
|
||||||
|
syscall_unix.go\
|
||||||
|
|
||||||
GOFILES_windows=\
|
GOFILES_windows=\
|
||||||
exec_windows.go\
|
exec_windows.go\
|
||||||
zerrors_windows.go\
|
zerrors_windows.go\
|
||||||
|
|
|
||||||
130
src/pkg/syscall/asm_openbsd_amd64.s
Normal file
130
src/pkg/syscall/asm_openbsd_amd64.s
Normal file
|
|
@ -0,0 +1,130 @@
|
||||||
|
// 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 AMD64, OpenBSD
|
||||||
|
//
|
||||||
|
|
||||||
|
// func Syscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
|
||||||
|
// func Syscall6(trap int64, a1, a2, a3, a4, a5, a6 int64) (r1, r2, err int64);
|
||||||
|
// func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64);
|
||||||
|
// Trap # in AX, args in DI SI DX, return in AX DX
|
||||||
|
|
||||||
|
TEXT ·Syscall(SB),7,$0
|
||||||
|
CALL runtime·entersyscall(SB)
|
||||||
|
MOVQ 8(SP), AX // syscall entry
|
||||||
|
MOVQ 16(SP), DI
|
||||||
|
MOVQ 24(SP), SI
|
||||||
|
MOVQ 32(SP), DX
|
||||||
|
MOVQ $0, R10
|
||||||
|
MOVQ $0, R8
|
||||||
|
MOVQ $0, R9
|
||||||
|
SYSCALL
|
||||||
|
JCC ok
|
||||||
|
MOVQ $-1, 40(SP) // r1
|
||||||
|
MOVQ $0, 48(SP) // r2
|
||||||
|
MOVQ AX, 56(SP) // errno
|
||||||
|
CALL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
ok:
|
||||||
|
MOVQ AX, 40(SP) // r1
|
||||||
|
MOVQ DX, 48(SP) // r2
|
||||||
|
MOVQ $0, 56(SP) // errno
|
||||||
|
CALL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·Syscall6(SB),7,$0
|
||||||
|
CALL runtime·entersyscall(SB)
|
||||||
|
MOVQ 8(SP), AX // syscall entry
|
||||||
|
MOVQ 16(SP), DI
|
||||||
|
MOVQ 24(SP), SI
|
||||||
|
MOVQ 32(SP), DX
|
||||||
|
MOVQ 40(SP), R10
|
||||||
|
MOVQ 48(SP), R8
|
||||||
|
MOVQ 56(SP), R9
|
||||||
|
SYSCALL
|
||||||
|
JCC ok6
|
||||||
|
MOVQ $-1, 64(SP) // r1
|
||||||
|
MOVQ $0, 72(SP) // r2
|
||||||
|
MOVQ AX, 80(SP) // errno
|
||||||
|
CALL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
ok6:
|
||||||
|
MOVQ AX, 64(SP) // r1
|
||||||
|
MOVQ DX, 72(SP) // r2
|
||||||
|
MOVQ $0, 80(SP) // errno
|
||||||
|
CALL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·Syscall9(SB),7,$0
|
||||||
|
CALL runtime·entersyscall(SB)
|
||||||
|
MOVQ 8(SP), AX // syscall entry
|
||||||
|
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 64(SP), R11
|
||||||
|
MOVQ 72(SP), R12
|
||||||
|
MOVQ 80(SP), R13
|
||||||
|
SUBQ $32, SP
|
||||||
|
MOVQ R11, 8(SP) // arg 7
|
||||||
|
MOVQ R12, 16(SP) // arg 8
|
||||||
|
MOVQ R13, 24(SP) // arg 9
|
||||||
|
SYSCALL
|
||||||
|
JCC ok9
|
||||||
|
ADDQ $32, SP
|
||||||
|
MOVQ $-1, 64(SP) // r1
|
||||||
|
MOVQ $0, 72(SP) // r2
|
||||||
|
MOVQ AX, 80(SP) // errno
|
||||||
|
CALL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
ok9:
|
||||||
|
ADDQ $32, SP
|
||||||
|
MOVQ AX, 64(SP) // r1
|
||||||
|
MOVQ DX, 72(SP) // r2
|
||||||
|
MOVQ $0, 80(SP) // errno
|
||||||
|
CALL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·RawSyscall(SB),7,$0
|
||||||
|
MOVQ 16(SP), DI
|
||||||
|
MOVQ 24(SP), SI
|
||||||
|
MOVQ 32(SP), DX
|
||||||
|
MOVQ $0, R10
|
||||||
|
MOVQ $0, R8
|
||||||
|
MOVQ $0, R9
|
||||||
|
MOVQ 8(SP), AX // syscall entry
|
||||||
|
SYSCALL
|
||||||
|
JCC ok1
|
||||||
|
MOVQ $-1, 40(SP) // r1
|
||||||
|
MOVQ $0, 48(SP) // r2
|
||||||
|
MOVQ AX, 56(SP) // errno
|
||||||
|
RET
|
||||||
|
ok1:
|
||||||
|
MOVQ AX, 40(SP) // r1
|
||||||
|
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
|
||||||
|
|
@ -166,6 +166,12 @@ plan9_386)
|
||||||
mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h"
|
mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h"
|
||||||
mktypes="godefs -gsyscall -f -m32"
|
mktypes="godefs -gsyscall -f -m32"
|
||||||
;;
|
;;
|
||||||
|
openbsd_amd64)
|
||||||
|
mkerrors="$mkerrors -f -m64"
|
||||||
|
mksyscall="./mksyscall.pl -openbsd"
|
||||||
|
mksysnum="curl -s 'http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl"
|
||||||
|
mktypes="godefs -gsyscall -f-m64"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2
|
echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -176,7 +182,7 @@ esac
|
||||||
if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi
|
if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi
|
||||||
syscall_goos="syscall_$GOOS.go"
|
syscall_goos="syscall_$GOOS.go"
|
||||||
case "$GOOS" in
|
case "$GOOS" in
|
||||||
darwin | freebsd)
|
darwin | freebsd | openbsd)
|
||||||
syscall_goos="syscall_bsd.go $syscall_goos"
|
syscall_goos="syscall_bsd.go $syscall_goos"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,28 @@ includes_FreeBSD='
|
||||||
#include <netinet/ip_mroute.h>
|
#include <netinet/ip_mroute.h>
|
||||||
'
|
'
|
||||||
|
|
||||||
|
includes_OpenBSD='
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/event.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <sys/sockio.h>
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
#include <sys/termios.h>
|
||||||
|
#include <sys/ttycom.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <net/bpf.h>
|
||||||
|
#include <net/if.h>
|
||||||
|
#include <net/if_types.h>
|
||||||
|
#include <net/route.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/in_systm.h>
|
||||||
|
#include <netinet/ip.h>
|
||||||
|
#include <netinet/ip_mroute.h>
|
||||||
|
#include <netinet/if_ether.h>
|
||||||
|
#include <net/if_bridge.h>
|
||||||
|
'
|
||||||
|
|
||||||
includes='
|
includes='
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
@ -120,7 +142,7 @@ done
|
||||||
# it encounters while processing the input
|
# it encounters while processing the input
|
||||||
echo "${!indirect} $includes" | $GCC -x c - -E -dM $ccflags |
|
echo "${!indirect} $includes" | $GCC -x c - -E -dM $ccflags |
|
||||||
awk '
|
awk '
|
||||||
$1 != "#define" || $2 ~ /\(/ {next}
|
$1 != "#define" || $2 ~ /\(/ || $3 == "" {next}
|
||||||
|
|
||||||
$2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers
|
$2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers
|
||||||
$2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}
|
$2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ my $cmdline = "mksyscall.pl " . join(' ', @ARGV);
|
||||||
my $errors = 0;
|
my $errors = 0;
|
||||||
my $_32bit = "";
|
my $_32bit = "";
|
||||||
my $plan9 = 0;
|
my $plan9 = 0;
|
||||||
|
my $openbsd = 0;
|
||||||
|
|
||||||
if($ARGV[0] eq "-b32") {
|
if($ARGV[0] eq "-b32") {
|
||||||
$_32bit = "big-endian";
|
$_32bit = "big-endian";
|
||||||
|
|
@ -37,6 +38,10 @@ if($ARGV[0] eq "-plan9") {
|
||||||
$plan9 = 1;
|
$plan9 = 1;
|
||||||
shift;
|
shift;
|
||||||
}
|
}
|
||||||
|
if($ARGV[0] eq "-openbsd") {
|
||||||
|
$openbsd = 1;
|
||||||
|
shift;
|
||||||
|
}
|
||||||
|
|
||||||
if($ARGV[0] =~ /^-/) {
|
if($ARGV[0] =~ /^-/) {
|
||||||
print STDERR "usage: mksyscall.pl [-b32 | -l32] [file ...]\n";
|
print STDERR "usage: mksyscall.pl [-b32 | -l32] [file ...]\n";
|
||||||
|
|
@ -115,6 +120,8 @@ while(<>) {
|
||||||
$text .= "\n";
|
$text .= "\n";
|
||||||
push @args, "uintptr(_p$n)", "uintptr(len($name))";
|
push @args, "uintptr(_p$n)", "uintptr(len($name))";
|
||||||
$n++;
|
$n++;
|
||||||
|
} elsif($type eq "int64" && $openbsd) {
|
||||||
|
push @args, "0", "uintptr($name)";
|
||||||
} elsif($type eq "int64" && $_32bit ne "") {
|
} elsif($type eq "int64" && $_32bit ne "") {
|
||||||
if($_32bit eq "big-endian") {
|
if($_32bit eq "big-endian") {
|
||||||
push @args, "uintptr($name>>32)", "uintptr($name)";
|
push @args, "uintptr($name>>32)", "uintptr($name)";
|
||||||
|
|
|
||||||
43
src/pkg/syscall/mksysnum_openbsd.pl
Executable file
43
src/pkg/syscall/mksysnum_openbsd.pl
Executable file
|
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
# 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 system call table for OpenBSD from master list
|
||||||
|
# (for example, /usr/src/sys/kern/syscalls.master).
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $command = "mksysnum_openbsd.pl " . join(' ', @ARGV);
|
||||||
|
|
||||||
|
print <<EOF;
|
||||||
|
// $command
|
||||||
|
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
||||||
|
|
||||||
|
package syscall
|
||||||
|
|
||||||
|
const (
|
||||||
|
EOF
|
||||||
|
|
||||||
|
while(<>){
|
||||||
|
if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){
|
||||||
|
my $num = $1;
|
||||||
|
my $proto = $3;
|
||||||
|
my $name = $4;
|
||||||
|
$name =~ y/a-z/A-Z/;
|
||||||
|
|
||||||
|
# There are multiple entries for enosys and nosys, so comment them out.
|
||||||
|
if($name =~ /^SYS_E?NOSYS$/){
|
||||||
|
$name = "// $name";
|
||||||
|
}
|
||||||
|
if($name eq 'SYS_SYS_EXIT'){
|
||||||
|
$name = 'SYS_EXIT';
|
||||||
|
}
|
||||||
|
|
||||||
|
print " $name = $num; // $proto\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print <<EOF;
|
||||||
|
)
|
||||||
|
EOF
|
||||||
35
src/pkg/syscall/route_openbsd.go
Normal file
35
src/pkg/syscall/route_openbsd.go
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
// Routing sockets and messages for OpenBSD
|
||||||
|
|
||||||
|
package syscall
|
||||||
|
|
||||||
|
import (
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (any *anyMessage) toRoutingMessage(buf []byte) RoutingMessage {
|
||||||
|
switch any.Type {
|
||||||
|
case RTM_ADD, RTM_DELETE, RTM_CHANGE, RTM_GET, RTM_LOSING, RTM_REDIRECT, RTM_MISS, RTM_LOCK, RTM_RESOLVE:
|
||||||
|
p := (*RouteMessage)(unsafe.Pointer(any))
|
||||||
|
rtm := &RouteMessage{}
|
||||||
|
rtm.Header = p.Header
|
||||||
|
rtm.Data = buf[SizeofRtMsghdr:any.Msglen]
|
||||||
|
return rtm
|
||||||
|
case RTM_IFINFO:
|
||||||
|
p := (*InterfaceMessage)(unsafe.Pointer(any))
|
||||||
|
ifm := &InterfaceMessage{}
|
||||||
|
ifm.Header = p.Header
|
||||||
|
ifm.Data = buf[SizeofIfMsghdr:any.Msglen]
|
||||||
|
return ifm
|
||||||
|
case RTM_NEWADDR, RTM_DELADDR:
|
||||||
|
p := (*InterfaceAddrMessage)(unsafe.Pointer(any))
|
||||||
|
ifam := &InterfaceAddrMessage{}
|
||||||
|
ifam.Header = p.Header
|
||||||
|
ifam.Data = buf[SizeofIfaMsghdr:any.Msglen]
|
||||||
|
return ifam
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
261
src/pkg/syscall/syscall_openbsd.go
Normal file
261
src/pkg/syscall/syscall_openbsd.go
Normal file
|
|
@ -0,0 +1,261 @@
|
||||||
|
// Copyright 2009,2010 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.
|
||||||
|
|
||||||
|
// OpenBSD 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, either here or in
|
||||||
|
// syscall_bsd.go or syscall_unix.go.
|
||||||
|
|
||||||
|
package syscall
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
const OS = "openbsd"
|
||||||
|
|
||||||
|
type SockaddrDatalink struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Index uint16
|
||||||
|
Type uint8
|
||||||
|
Nlen uint8
|
||||||
|
Alen uint8
|
||||||
|
Slen uint8
|
||||||
|
Data [24]int8
|
||||||
|
raw RawSockaddrDatalink
|
||||||
|
}
|
||||||
|
|
||||||
|
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr)
|
||||||
|
|
||||||
|
// 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
|
||||||
|
}
|
||||||
|
|
||||||
|
//sysnb pipe(p *[2]_C_int) (errno int)
|
||||||
|
func Pipe(p []int) (errno int) {
|
||||||
|
if len(p) != 2 {
|
||||||
|
return EINVAL
|
||||||
|
}
|
||||||
|
var pp [2]_C_int
|
||||||
|
errno = pipe(&pp)
|
||||||
|
p[0] = int(pp[0])
|
||||||
|
p[1] = int(pp[1])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
|
||||||
|
return -1, ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Exposed directly
|
||||||
|
*/
|
||||||
|
//sys Access(path string, mode uint32) (errno int)
|
||||||
|
//sys Adjtime(delta *Timeval, olddelta *Timeval) (errno int)
|
||||||
|
//sys Chdir(path string) (errno int)
|
||||||
|
//sys Chflags(path string, flags int) (errno int)
|
||||||
|
//sys Chmod(path string, mode uint32) (errno int)
|
||||||
|
//sys Chown(path string, uid int, gid int) (errno int)
|
||||||
|
//sys Chroot(path string) (errno int)
|
||||||
|
//sys Close(fd 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)
|
||||||
|
//sys Fchmod(fd int, mode uint32) (errno int)
|
||||||
|
//sys Fchown(fd int, uid int, gid int) (errno int)
|
||||||
|
//sys Flock(fd int, how int) (errno int)
|
||||||
|
//sys Fpathconf(fd int, name int) (val int, errno int)
|
||||||
|
//sys Fstat(fd int, stat *Stat_t) (errno int)
|
||||||
|
//sys Fstatfs(fd int, stat *Statfs_t) (errno int)
|
||||||
|
//sys Fsync(fd int) (errno int)
|
||||||
|
//sys Ftruncate(fd int, length int64) (errno int)
|
||||||
|
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int)
|
||||||
|
//sysnb Getegid() (egid int)
|
||||||
|
//sysnb Geteuid() (uid int)
|
||||||
|
//sys Getfsstat(buf []Statfs_t, flags int) (n int, errno 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)
|
||||||
|
//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)
|
||||||
|
//sys Lchown(path string, uid int, gid int) (errno int)
|
||||||
|
//sys Link(path string, link string) (errno int)
|
||||||
|
//sys Listen(s int, backlog int) (errno int)
|
||||||
|
//sys Lstat(path string, stat *Stat_t) (errno int)
|
||||||
|
//sys Mkdir(path string, mode uint32) (errno int)
|
||||||
|
//sys Mkfifo(path string, mode uint32) (errno int)
|
||||||
|
//sys Mknod(path string, mode uint32, dev int) (errno int)
|
||||||
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (errno int)
|
||||||
|
//sys Open(path string, mode int, perm uint32) (fd int, errno int)
|
||||||
|
//sys Pathconf(path string, name int) (val int, errno int)
|
||||||
|
//sys Pread(fd int, p []byte, offset int64) (n int, errno int)
|
||||||
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, errno int)
|
||||||
|
//sys Read(fd int, p []byte) (n int, errno int)
|
||||||
|
//sys Readlink(path string, buf []byte) (n int, errno int)
|
||||||
|
//sys Rename(from string, to string) (errno int)
|
||||||
|
//sys Revoke(path string) (errno int)
|
||||||
|
//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)
|
||||||
|
//sysnb Setegid(egid int) (errno int)
|
||||||
|
//sysnb Seteuid(euid int) (errno int)
|
||||||
|
//sysnb Setgid(gid int) (errno int)
|
||||||
|
//sys Setlogin(name string) (errno int)
|
||||||
|
//sysnb Setpgid(pid int, pgid int) (errno int)
|
||||||
|
//sys Setpriority(which int, who int, prio 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)
|
||||||
|
//sys Sync() (errno int)
|
||||||
|
//sys Truncate(path string, length int64) (errno int)
|
||||||
|
//sys Umask(newmask int) (oldmask int)
|
||||||
|
//sys Unlink(path string) (errno int)
|
||||||
|
//sys Unmount(path string, flags int) (errno int)
|
||||||
|
//sys Write(fd int, p []byte) (n int, 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)
|
||||||
|
//sys read(fd int, buf *byte, nbuf int) (n int, errno int)
|
||||||
|
//sys write(fd int, buf *byte, nbuf int) (n int, errno int)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Unimplemented
|
||||||
|
*/
|
||||||
|
// __getcwd
|
||||||
|
// __semctl
|
||||||
|
// __syscall
|
||||||
|
// __sysctl
|
||||||
|
// adjfreq
|
||||||
|
// break
|
||||||
|
// clock_getres
|
||||||
|
// clock_gettime
|
||||||
|
// clock_settime
|
||||||
|
// closefrom
|
||||||
|
// execve
|
||||||
|
// faccessat
|
||||||
|
// fchmodat
|
||||||
|
// fchownat
|
||||||
|
// fcntl
|
||||||
|
// fhopen
|
||||||
|
// fhstat
|
||||||
|
// fhstatfs
|
||||||
|
// fork
|
||||||
|
// fstatat
|
||||||
|
// futimens
|
||||||
|
// getfh
|
||||||
|
// getgid
|
||||||
|
// getitimer
|
||||||
|
// getlogin
|
||||||
|
// getresgid
|
||||||
|
// getresuid
|
||||||
|
// getrtable
|
||||||
|
// getthrid
|
||||||
|
// ioctl
|
||||||
|
// ktrace
|
||||||
|
// lfs_bmapv
|
||||||
|
// lfs_markv
|
||||||
|
// lfs_segclean
|
||||||
|
// lfs_segwait
|
||||||
|
// linkat
|
||||||
|
// mincore
|
||||||
|
// minherit
|
||||||
|
// mkdirat
|
||||||
|
// mkfifoat
|
||||||
|
// mknodat
|
||||||
|
// mlock
|
||||||
|
// mlockall
|
||||||
|
// mount
|
||||||
|
// mquery
|
||||||
|
// msgctl
|
||||||
|
// msgget
|
||||||
|
// msgrcv
|
||||||
|
// msgsnd
|
||||||
|
// munlock
|
||||||
|
// munlockall
|
||||||
|
// nfssvc
|
||||||
|
// nnpfspioctl
|
||||||
|
// openat
|
||||||
|
// poll
|
||||||
|
// preadv
|
||||||
|
// profil
|
||||||
|
// pwritev
|
||||||
|
// quotactl
|
||||||
|
// readlinkat
|
||||||
|
// readv
|
||||||
|
// reboot
|
||||||
|
// renameat
|
||||||
|
// rfork
|
||||||
|
// sched_yield
|
||||||
|
// semget
|
||||||
|
// semop
|
||||||
|
// setgroups
|
||||||
|
// setitimer
|
||||||
|
// setresgid
|
||||||
|
// setresuid
|
||||||
|
// setrtable
|
||||||
|
// setsockopt
|
||||||
|
// shmat
|
||||||
|
// shmctl
|
||||||
|
// shmdt
|
||||||
|
// shmget
|
||||||
|
// sigaction
|
||||||
|
// sigaltstack
|
||||||
|
// sigpending
|
||||||
|
// sigprocmask
|
||||||
|
// sigreturn
|
||||||
|
// sigsuspend
|
||||||
|
// symlinkat
|
||||||
|
// sysarch
|
||||||
|
// syscall
|
||||||
|
// threxit
|
||||||
|
// thrsigdivert
|
||||||
|
// thrsleep
|
||||||
|
// thrwakeup
|
||||||
|
// unlinkat
|
||||||
|
// utimensat
|
||||||
|
// vfork
|
||||||
|
// writev
|
||||||
42
src/pkg/syscall/syscall_openbsd_amd64.go
Normal file
42
src/pkg/syscall/syscall_openbsd_amd64.go
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
// 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
|
||||||
|
|
||||||
|
func Getpagesize() int { return 4096 }
|
||||||
|
|
||||||
|
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
||||||
|
|
||||||
|
func NsecToTimespec(nsec int64) (ts Timespec) {
|
||||||
|
ts.Sec = int32(nsec / 1e9)
|
||||||
|
ts.Nsec = nsec % 1e9
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }
|
||||||
|
|
||||||
|
func NsecToTimeval(nsec int64) (tv Timeval) {
|
||||||
|
nsec += 999 // round up to microsecond
|
||||||
|
tv.Usec = nsec % 1e9 / 1e3
|
||||||
|
tv.Sec = int64(nsec / 1e9)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
k.Ident = uint32(fd)
|
||||||
|
k.Filter = int16(mode)
|
||||||
|
k.Flags = uint16(flags)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iov *Iovec) SetLen(length int) {
|
||||||
|
iov.Len = uint64(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (msghdr *Msghdr) SetControllen(length int) {
|
||||||
|
msghdr.Controllen = uint32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
|
cmsg.Len = uint32(length)
|
||||||
|
}
|
||||||
182
src/pkg/syscall/types_openbsd.c
Normal file
182
src/pkg/syscall/types_openbsd.c
Normal file
|
|
@ -0,0 +1,182 @@
|
||||||
|
// 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
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define KERNEL
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/event.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#include <sys/ptrace.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#include <sys/select.h>
|
||||||
|
#include <sys/signal.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/uio.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>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/tcp.h>
|
||||||
|
|
||||||
|
// Machine characteristics; for internal use.
|
||||||
|
|
||||||
|
enum {
|
||||||
|
$sizeofPtr = sizeof(void*),
|
||||||
|
$sizeofShort = sizeof(short),
|
||||||
|
$sizeofInt = sizeof(int),
|
||||||
|
$sizeofLong = sizeof(long),
|
||||||
|
$sizeofLongLong = sizeof(long long),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Basic types
|
||||||
|
|
||||||
|
typedef short $_C_short;
|
||||||
|
typedef int $_C_int;
|
||||||
|
typedef long $_C_long;
|
||||||
|
typedef long long $_C_long_long;
|
||||||
|
|
||||||
|
// Time
|
||||||
|
|
||||||
|
typedef struct timespec $Timespec;
|
||||||
|
typedef struct timeval $Timeval;
|
||||||
|
|
||||||
|
// Processes
|
||||||
|
|
||||||
|
typedef struct rusage $Rusage;
|
||||||
|
typedef struct rlimit $Rlimit;
|
||||||
|
|
||||||
|
typedef gid_t $_Gid_t;
|
||||||
|
|
||||||
|
// Files
|
||||||
|
|
||||||
|
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 flock $Flock_t;
|
||||||
|
|
||||||
|
typedef struct dirent $Dirent;
|
||||||
|
|
||||||
|
// Sockets
|
||||||
|
|
||||||
|
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_dl s5;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct sockaddr_any {
|
||||||
|
struct sockaddr addr;
|
||||||
|
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_dl $RawSockaddrDatalink;
|
||||||
|
typedef struct sockaddr $RawSockaddr;
|
||||||
|
typedef struct sockaddr_any $RawSockaddrAny;
|
||||||
|
typedef socklen_t $_Socklen;
|
||||||
|
typedef struct linger $Linger;
|
||||||
|
typedef struct iovec $Iovec;
|
||||||
|
typedef struct ip_mreq $IPMreq;
|
||||||
|
typedef struct ipv6_mreq $IPv6Mreq;
|
||||||
|
typedef struct msghdr $Msghdr;
|
||||||
|
typedef struct cmsghdr $Cmsghdr;
|
||||||
|
typedef struct in6_pktinfo $Inet6Pktinfo;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
$SizeofSockaddrInet4 = sizeof(struct sockaddr_in),
|
||||||
|
$SizeofSockaddrInet6 = sizeof(struct sockaddr_in6),
|
||||||
|
$SizeofSockaddrAny = sizeof(struct sockaddr_any),
|
||||||
|
$SizeofSockaddrUnix = sizeof(struct sockaddr_un),
|
||||||
|
$SizeofSockaddrDatalink = sizeof(struct sockaddr_dl),
|
||||||
|
$SizeofLinger = sizeof(struct linger),
|
||||||
|
$SizeofIPMreq = sizeof(struct ip_mreq),
|
||||||
|
$SizeofIPv6Mreq = sizeof(struct ipv6_mreq),
|
||||||
|
$SizeofMsghdr = sizeof(struct msghdr),
|
||||||
|
$SizeofCmsghdr = sizeof(struct cmsghdr),
|
||||||
|
$SizeofInet6Pktinfo = sizeof(struct in6_pktinfo),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Ptrace requests
|
||||||
|
|
||||||
|
enum {
|
||||||
|
$PTRACE_TRACEME = PT_TRACE_ME,
|
||||||
|
$PTRACE_CONT = PT_CONTINUE,
|
||||||
|
$PTRACE_KILL = PT_KILL,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Events (kqueue, kevent)
|
||||||
|
|
||||||
|
typedef struct kevent $Kevent_t;
|
||||||
|
|
||||||
|
// Select
|
||||||
|
|
||||||
|
typedef fd_set $FdSet;
|
||||||
|
|
||||||
|
// Routing and interface messages
|
||||||
|
|
||||||
|
enum {
|
||||||
|
$SizeofIfMsghdr = sizeof(struct if_msghdr),
|
||||||
|
$SizeofIfData = sizeof(struct if_data),
|
||||||
|
$SizeofIfaMsghdr = sizeof(struct ifa_msghdr),
|
||||||
|
$SizeofRtMsghdr = sizeof(struct rt_msghdr),
|
||||||
|
$SizeofRtMetrics = sizeof(struct rt_metrics),
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct if_msghdr $IfMsghdr;
|
||||||
|
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),
|
||||||
|
$SizeofBpfProgram = sizeof(struct bpf_program),
|
||||||
|
$SizeofBpfInsn = sizeof(struct bpf_insn),
|
||||||
|
$SizeofBpfHdr = sizeof(struct bpf_hdr),
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct bpf_version $BpfVersion;
|
||||||
|
typedef struct bpf_stat $BpfStat;
|
||||||
|
typedef struct bpf_program $BpfProgram;
|
||||||
|
typedef struct bpf_insn $BpfInsn;
|
||||||
|
typedef struct bpf_hdr $BpfHdr;
|
||||||
|
typedef struct bpf_timeval $BpfTimeval;
|
||||||
1367
src/pkg/syscall/zerrors_openbsd_amd64.go
Normal file
1367
src/pkg/syscall/zerrors_openbsd_amd64.go
Normal file
File diff suppressed because it is too large
Load diff
941
src/pkg/syscall/zsyscall_openbsd_amd64.go
Normal file
941
src/pkg/syscall/zsyscall_openbsd_amd64.go
Normal file
|
|
@ -0,0 +1,941 @@
|
||||||
|
// mksyscall.pl -openbsd syscall_bsd.go syscall_openbsd.go syscall_openbsd_amd64.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 getgroups(ngid int, gid *_Gid_t) (n int, errno int) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func setgroups(ngid int, gid *_Gid_t) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
|
||||||
|
wpid = int(r0)
|
||||||
|
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)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
|
||||||
|
fd = int(r0)
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int) {
|
||||||
|
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Shutdown(s int, how int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(p) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&p[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func sendmsg(s int, msg *Msghdr, flags int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
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)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(mib) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&mib[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func utimes(path string, timeval *[2]Timeval) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(timeval)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func futimes(fd int, timeval *[2]Timeval) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func fcntl(fd int, cmd int, arg int) (val int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||||
|
val = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func pipe(p *[2]_C_int) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 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)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Adjtime(delta *Timeval, olddelta *Timeval) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Chdir(path string) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Chflags(path string, flags int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Chmod(path string, mode uint32) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 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)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Chroot(path string) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Close(fd int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Dup(fd int) (nfd int, errno int) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
|
||||||
|
nfd = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Dup2(from int, to int) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Exit(code int) {
|
||||||
|
Syscall(SYS_EXIT, uintptr(code), 0, 0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fchdir(fd int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fchflags(path string, flags int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fchmod(fd int, mode uint32) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fchown(fd int, uid int, gid int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Flock(fd int, how int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fpathconf(fd int, name int) (val int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
|
||||||
|
val = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fstat(fd int, stat *Stat_t) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fstatfs(fd int, stat *Statfs_t) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fsync(fd int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Ftruncate(fd int, length int64) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getegid() (egid int) {
|
||||||
|
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
|
||||||
|
egid = int(r0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Geteuid() (uid int) {
|
||||||
|
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
|
||||||
|
uid = int(r0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getgid() (gid int) {
|
||||||
|
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
|
||||||
|
gid = int(r0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getpgid(pid int) (pgid int, errno int) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
|
||||||
|
pgid = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getpgrp() (pgrp int) {
|
||||||
|
r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
|
||||||
|
pgrp = int(r0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getpid() (pid int) {
|
||||||
|
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
|
||||||
|
pid = int(r0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getppid() (ppid int) {
|
||||||
|
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
|
||||||
|
ppid = int(r0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getpriority(which int, who int) (prio int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
|
||||||
|
prio = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getrlimit(which int, lim *Rlimit) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getrusage(who int, rusage *Rusage) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getsid(pid int) (sid int, errno int) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
|
||||||
|
sid = int(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 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Getuid() (uid int) {
|
||||||
|
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
|
||||||
|
uid = int(r0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Issetugid() (tainted bool) {
|
||||||
|
r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)
|
||||||
|
tainted = bool(r0 != 0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Kill(pid int, signum int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Kqueue() (fd int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
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)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Link(path string, link string) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Listen(s int, backlog int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lstat(path string, stat *Stat_t) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Mkdir(path string, mode uint32) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Mkfifo(path string, mode uint32) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Mknod(path string, mode uint32, dev int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
|
||||||
|
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)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Open(path string, mode int, perm uint32) (fd int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
|
||||||
|
fd = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Pathconf(path string, name int) (val int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(name), 0)
|
||||||
|
val = int(r0)
|
||||||
|
errno = int(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, errno int) {
|
||||||
|
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)), 0, uintptr(offset), 0)
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(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, errno int) {
|
||||||
|
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)), 0, uintptr(offset), 0)
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Read(fd int, p []byte) (n int, errno int) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(p) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&p[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Readlink(path string, buf []byte) (n int, errno int) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(buf)))
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Rename(from string, to string) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(from))), uintptr(unsafe.Pointer(StringBytePtr(to))), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Revoke(path string) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Rmdir(path string) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0)
|
||||||
|
newoffset = int64(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) {
|
||||||
|
_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setegid(egid int) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Seteuid(euid int) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setgid(gid int) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setlogin(name string) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setpgid(pid int, pgid int) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setpriority(which int, who int, prio int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setregid(rgid int, egid int) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setreuid(ruid int, euid int) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setrlimit(which int, lim *Rlimit) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setsid() (pid int, errno int) {
|
||||||
|
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
|
||||||
|
pid = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Settimeofday(tp *Timeval) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Setuid(uid int) (errno int) {
|
||||||
|
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Stat(path string, stat *Stat_t) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Statfs(path string, stat *Statfs_t) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Symlink(path string, link string) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Sync() (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Truncate(path string, length int64) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, uintptr(length))
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Umask(newmask int) (oldmask int) {
|
||||||
|
r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
|
||||||
|
oldmask = int(r0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Unlink(path string) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Unmount(path string, flags int) (errno int) {
|
||||||
|
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Write(fd int, p []byte) (n int, errno int) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(p) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&p[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
||||||
|
n = int(r0)
|
||||||
|
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, 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), 0, uintptr(pos), 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 read(fd int, buf *byte, nbuf int) (n int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func write(fd int, buf *byte, nbuf int) (n int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
||||||
|
n = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
204
src/pkg/syscall/zsysnum_openbsd_amd64.go
Normal file
204
src/pkg/syscall/zsysnum_openbsd_amd64.go
Normal file
|
|
@ -0,0 +1,204 @@
|
||||||
|
// mksysnum_openbsd.pl
|
||||||
|
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
||||||
|
|
||||||
|
package syscall
|
||||||
|
|
||||||
|
const (
|
||||||
|
SYS_EXIT = 1 // { void sys_exit(int rval); }
|
||||||
|
SYS_FORK = 2 // { int sys_fork(void); }
|
||||||
|
SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); }
|
||||||
|
SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, \
|
||||||
|
SYS_OPEN = 5 // { int sys_open(const char *path, \
|
||||||
|
SYS_CLOSE = 6 // { int sys_close(int fd); }
|
||||||
|
SYS_WAIT4 = 7 // { pid_t sys_wait4(pid_t pid, int *status, int options, \
|
||||||
|
SYS_LINK = 9 // { int sys_link(const char *path, const char *link); }
|
||||||
|
SYS_UNLINK = 10 // { int sys_unlink(const char *path); }
|
||||||
|
SYS_CHDIR = 12 // { int sys_chdir(const char *path); }
|
||||||
|
SYS_FCHDIR = 13 // { int sys_fchdir(int fd); }
|
||||||
|
SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, \
|
||||||
|
SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); }
|
||||||
|
SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, \
|
||||||
|
SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break
|
||||||
|
SYS_GETPID = 20 // { pid_t sys_getpid(void); }
|
||||||
|
SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, \
|
||||||
|
SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); }
|
||||||
|
SYS_SETUID = 23 // { int sys_setuid(uid_t uid); }
|
||||||
|
SYS_GETUID = 24 // { uid_t sys_getuid(void); }
|
||||||
|
SYS_GETEUID = 25 // { uid_t sys_geteuid(void); }
|
||||||
|
SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \
|
||||||
|
SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \
|
||||||
|
SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, \
|
||||||
|
SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \
|
||||||
|
SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, \
|
||||||
|
SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, \
|
||||||
|
SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, \
|
||||||
|
SYS_ACCESS = 33 // { int sys_access(const char *path, int flags); }
|
||||||
|
SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); }
|
||||||
|
SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); }
|
||||||
|
SYS_SYNC = 36 // { void sys_sync(void); }
|
||||||
|
SYS_KILL = 37 // { int sys_kill(int pid, int signum); }
|
||||||
|
SYS_GETPPID = 39 // { pid_t sys_getppid(void); }
|
||||||
|
SYS_DUP = 41 // { int sys_dup(int fd); }
|
||||||
|
SYS_GETEGID = 43 // { gid_t sys_getegid(void); }
|
||||||
|
SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, \
|
||||||
|
SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, \
|
||||||
|
SYS_SIGACTION = 46 // { int sys_sigaction(int signum, \
|
||||||
|
SYS_GETGID = 47 // { gid_t sys_getgid(void); }
|
||||||
|
SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); }
|
||||||
|
SYS_GETLOGIN = 49 // { int sys_getlogin(char *namebuf, u_int namelen); }
|
||||||
|
SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); }
|
||||||
|
SYS_ACCT = 51 // { int sys_acct(const char *path); }
|
||||||
|
SYS_SIGPENDING = 52 // { int sys_sigpending(void); }
|
||||||
|
SYS_IOCTL = 54 // { int sys_ioctl(int fd, \
|
||||||
|
SYS_REBOOT = 55 // { int sys_reboot(int opt); }
|
||||||
|
SYS_REVOKE = 56 // { int sys_revoke(const char *path); }
|
||||||
|
SYS_SYMLINK = 57 // { int sys_symlink(const char *path, \
|
||||||
|
SYS_READLINK = 58 // { int sys_readlink(const char *path, char *buf, \
|
||||||
|
SYS_EXECVE = 59 // { int sys_execve(const char *path, \
|
||||||
|
SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); }
|
||||||
|
SYS_CHROOT = 61 // { int sys_chroot(const char *path); }
|
||||||
|
SYS_VFORK = 66 // { int sys_vfork(void); }
|
||||||
|
SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); }
|
||||||
|
SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, \
|
||||||
|
SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, \
|
||||||
|
SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, \
|
||||||
|
SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, \
|
||||||
|
SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, \
|
||||||
|
SYS_GETPGRP = 81 // { int sys_getpgrp(void); }
|
||||||
|
SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, int pgid); }
|
||||||
|
SYS_SETITIMER = 83 // { int sys_setitimer(int which, \
|
||||||
|
SYS_GETITIMER = 86 // { int sys_getitimer(int which, \
|
||||||
|
SYS_DUP2 = 90 // { int sys_dup2(int from, int to); }
|
||||||
|
SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); }
|
||||||
|
SYS_SELECT = 93 // { int sys_select(int nd, fd_set *in, fd_set *ou, \
|
||||||
|
SYS_FSYNC = 95 // { int sys_fsync(int fd); }
|
||||||
|
SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); }
|
||||||
|
SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); }
|
||||||
|
SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, \
|
||||||
|
SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); }
|
||||||
|
SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); }
|
||||||
|
SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, \
|
||||||
|
SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, \
|
||||||
|
SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); }
|
||||||
|
SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); }
|
||||||
|
SYS_GETTIMEOFDAY = 116 // { int sys_gettimeofday(struct timeval *tp, \
|
||||||
|
SYS_GETRUSAGE = 117 // { int sys_getrusage(int who, struct rusage *rusage); }
|
||||||
|
SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, \
|
||||||
|
SYS_READV = 120 // { ssize_t sys_readv(int fd, \
|
||||||
|
SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, \
|
||||||
|
SYS_SETTIMEOFDAY = 122 // { int sys_settimeofday(const struct timeval *tv, \
|
||||||
|
SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }
|
||||||
|
SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); }
|
||||||
|
SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }
|
||||||
|
SYS_SETREGID = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }
|
||||||
|
SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); }
|
||||||
|
SYS_FLOCK = 131 // { int sys_flock(int fd, int how); }
|
||||||
|
SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); }
|
||||||
|
SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, \
|
||||||
|
SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); }
|
||||||
|
SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, \
|
||||||
|
SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); }
|
||||||
|
SYS_RMDIR = 137 // { int sys_rmdir(const char *path); }
|
||||||
|
SYS_UTIMES = 138 // { int sys_utimes(const char *path, \
|
||||||
|
SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, \
|
||||||
|
SYS_SETSID = 147 // { int sys_setsid(void); }
|
||||||
|
SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, \
|
||||||
|
SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); }
|
||||||
|
SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); }
|
||||||
|
SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); }
|
||||||
|
SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, \
|
||||||
|
SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \
|
||||||
|
SYS_SETGID = 181 // { int sys_setgid(gid_t gid); }
|
||||||
|
SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); }
|
||||||
|
SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); }
|
||||||
|
LFS_BMAPV = 184 // { int lfs_bmapv(fsid_t *fsidp, \
|
||||||
|
LFS_MARKV = 185 // { int lfs_markv(fsid_t *fsidp, \
|
||||||
|
LFS_SEGCLEAN = 186 // { int lfs_segclean(fsid_t *fsidp, u_long segment); }
|
||||||
|
LFS_SEGWAIT = 187 // { int lfs_segwait(fsid_t *fsidp, struct timeval *tv); }
|
||||||
|
SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); }
|
||||||
|
SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); }
|
||||||
|
SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); }
|
||||||
|
SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, \
|
||||||
|
SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, \
|
||||||
|
SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \
|
||||||
|
SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \
|
||||||
|
SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, \
|
||||||
|
SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); }
|
||||||
|
SYS___SYSCTL = 202 // { int sys___sysctl(int *name, u_int namelen, \
|
||||||
|
SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); }
|
||||||
|
SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); }
|
||||||
|
SYS_FUTIMES = 206 // { int sys_futimes(int fd, \
|
||||||
|
SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); }
|
||||||
|
SYS_NNPFSPIOCTL = 208 // { int sys_nnpfspioctl(int operation, char *a_pathP, \
|
||||||
|
SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); }
|
||||||
|
SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); }
|
||||||
|
SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \
|
||||||
|
SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \
|
||||||
|
SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \
|
||||||
|
SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); }
|
||||||
|
SYS_CLOCK_GETTIME = 232 // { int sys_clock_gettime(clockid_t clock_id, \
|
||||||
|
SYS_CLOCK_SETTIME = 233 // { int sys_clock_settime(clockid_t clock_id, \
|
||||||
|
SYS_CLOCK_GETRES = 234 // { int sys_clock_getres(clockid_t clock_id, \
|
||||||
|
SYS_NANOSLEEP = 240 // { int sys_nanosleep(const struct timespec *rqtp, \
|
||||||
|
SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, \
|
||||||
|
SYS_RFORK = 251 // { int sys_rfork(int flags); }
|
||||||
|
SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, \
|
||||||
|
SYS_ISSETUGID = 253 // { int sys_issetugid(void); }
|
||||||
|
SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); }
|
||||||
|
SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); }
|
||||||
|
SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); }
|
||||||
|
SYS_PIPE = 263 // { int sys_pipe(int *fdp); }
|
||||||
|
SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); }
|
||||||
|
SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, \
|
||||||
|
SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, \
|
||||||
|
SYS_KQUEUE = 269 // { int sys_kqueue(void); }
|
||||||
|
SYS_KEVENT = 270 // { int sys_kevent(int fd, \
|
||||||
|
SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); }
|
||||||
|
SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); }
|
||||||
|
SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \
|
||||||
|
SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \
|
||||||
|
SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \
|
||||||
|
SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \
|
||||||
|
SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \
|
||||||
|
SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); }
|
||||||
|
SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \
|
||||||
|
SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); }
|
||||||
|
SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, \
|
||||||
|
SYS_STAT = 291 // { int sys_stat(const char *path, struct stat *ub); }
|
||||||
|
SYS_FSTAT = 292 // { int sys_fstat(int fd, struct stat *sb); }
|
||||||
|
SYS_LSTAT = 293 // { int sys_lstat(const char *path, struct stat *ub); }
|
||||||
|
SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, \
|
||||||
|
SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, \
|
||||||
|
SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, \
|
||||||
|
SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, \
|
||||||
|
SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); }
|
||||||
|
SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); }
|
||||||
|
SYS_THRSLEEP = 300 // { int sys_thrsleep(void *ident, clockid_t clock_id, \
|
||||||
|
SYS_THRWAKEUP = 301 // { int sys_thrwakeup(void *ident, int n); }
|
||||||
|
SYS_THREXIT = 302 // { void sys_threxit(pid_t *notdead); }
|
||||||
|
SYS_THRSIGDIVERT = 303 // { int sys_thrsigdivert(sigset_t sigmask, \
|
||||||
|
SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); }
|
||||||
|
SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, \
|
||||||
|
SYS_GETFSSTAT = 306 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \
|
||||||
|
SYS_STATFS = 307 // { int sys_statfs(const char *path, \
|
||||||
|
SYS_FSTATFS = 308 // { int sys_fstatfs(int fd, struct statfs *buf); }
|
||||||
|
SYS_FHSTATFS = 309 // { int sys_fhstatfs(const fhandle_t *fhp, \
|
||||||
|
SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); }
|
||||||
|
SYS_GETRTABLE = 311 // { int sys_getrtable(void); }
|
||||||
|
SYS_GETDIRENTRIES = 312 // { int sys_getdirentries(int fd, char *buf, \
|
||||||
|
SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, \
|
||||||
|
SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, \
|
||||||
|
SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, \
|
||||||
|
SYS_FSTATAT = 316 // { int sys_fstatat(int fd, const char *path, \
|
||||||
|
SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \
|
||||||
|
SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, \
|
||||||
|
SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, \
|
||||||
|
SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, \
|
||||||
|
SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, \
|
||||||
|
SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \
|
||||||
|
SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, \
|
||||||
|
SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, \
|
||||||
|
SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, \
|
||||||
|
SYS_UTIMENSAT = 326 // { int sys_utimensat(int fd, const char *path, \
|
||||||
|
SYS_FUTIMENS = 327 // { int sys_futimens(int fd, \
|
||||||
|
)
|
||||||
390
src/pkg/syscall/ztypes_openbsd_amd64.go
Normal file
390
src/pkg/syscall/ztypes_openbsd_amd64.go
Normal file
|
|
@ -0,0 +1,390 @@
|
||||||
|
// godefs -gsyscall -f-m64 types_openbsd.c
|
||||||
|
|
||||||
|
// MACHINE GENERATED - DO NOT EDIT.
|
||||||
|
|
||||||
|
package syscall
|
||||||
|
|
||||||
|
// Constants
|
||||||
|
const (
|
||||||
|
sizeofPtr = 0x8
|
||||||
|
sizeofShort = 0x2
|
||||||
|
sizeofInt = 0x4
|
||||||
|
sizeofLong = 0x8
|
||||||
|
sizeofLongLong = 0x8
|
||||||
|
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
|
||||||
|
SizeofSockaddrInet4 = 0x10
|
||||||
|
SizeofSockaddrInet6 = 0x1c
|
||||||
|
SizeofSockaddrAny = 0x6c
|
||||||
|
SizeofSockaddrUnix = 0x6a
|
||||||
|
SizeofSockaddrDatalink = 0x20
|
||||||
|
SizeofLinger = 0x8
|
||||||
|
SizeofIPMreq = 0x8
|
||||||
|
SizeofIPv6Mreq = 0x14
|
||||||
|
SizeofMsghdr = 0x30
|
||||||
|
SizeofCmsghdr = 0xc
|
||||||
|
SizeofInet6Pktinfo = 0x14
|
||||||
|
PTRACE_TRACEME = 0
|
||||||
|
PTRACE_CONT = 0x7
|
||||||
|
PTRACE_KILL = 0x8
|
||||||
|
SizeofIfMsghdr = 0xf0
|
||||||
|
SizeofIfData = 0xd8
|
||||||
|
SizeofIfaMsghdr = 0x18
|
||||||
|
SizeofRtMsghdr = 0x58
|
||||||
|
SizeofRtMetrics = 0x30
|
||||||
|
SizeofBpfVersion = 0x4
|
||||||
|
SizeofBpfStat = 0x8
|
||||||
|
SizeofBpfProgram = 0x10
|
||||||
|
SizeofBpfInsn = 0x8
|
||||||
|
SizeofBpfHdr = 0x14
|
||||||
|
)
|
||||||
|
|
||||||
|
// Types
|
||||||
|
|
||||||
|
type _C_short int16
|
||||||
|
|
||||||
|
type _C_int int32
|
||||||
|
|
||||||
|
type _C_long int64
|
||||||
|
|
||||||
|
type _C_long_long int64
|
||||||
|
|
||||||
|
type Timespec struct {
|
||||||
|
Sec int32
|
||||||
|
Pad_godefs_0 [4]byte
|
||||||
|
Nsec int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Timeval struct {
|
||||||
|
Sec int64
|
||||||
|
Usec int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Rusage struct {
|
||||||
|
Utime Timeval
|
||||||
|
Stime Timeval
|
||||||
|
Maxrss int64
|
||||||
|
Ixrss int64
|
||||||
|
Idrss int64
|
||||||
|
Isrss int64
|
||||||
|
Minflt int64
|
||||||
|
Majflt int64
|
||||||
|
Nswap int64
|
||||||
|
Inblock int64
|
||||||
|
Oublock int64
|
||||||
|
Msgsnd int64
|
||||||
|
Msgrcv int64
|
||||||
|
Nsignals int64
|
||||||
|
Nvcsw int64
|
||||||
|
Nivcsw int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Rlimit struct {
|
||||||
|
Cur uint64
|
||||||
|
Max uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type _Gid_t uint32
|
||||||
|
|
||||||
|
type Stat_t struct {
|
||||||
|
Dev int32
|
||||||
|
Ino uint32
|
||||||
|
Mode uint32
|
||||||
|
Nlink uint32
|
||||||
|
Uid uint32
|
||||||
|
Gid uint32
|
||||||
|
Rdev int32
|
||||||
|
Lspare0 int32
|
||||||
|
Atim Timespec
|
||||||
|
Mtim Timespec
|
||||||
|
Ctim Timespec
|
||||||
|
Size int64
|
||||||
|
Blocks int64
|
||||||
|
Blksize uint32
|
||||||
|
Flags uint32
|
||||||
|
Gen uint32
|
||||||
|
Lspare1 int32
|
||||||
|
X__st_birthtim Timespec
|
||||||
|
Qspare [2]int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Statfs_t struct {
|
||||||
|
F_flags uint32
|
||||||
|
F_bsize uint32
|
||||||
|
F_iosize uint32
|
||||||
|
Pad_godefs_0 [4]byte
|
||||||
|
F_blocks uint64
|
||||||
|
F_bfree uint64
|
||||||
|
F_bavail int64
|
||||||
|
F_files uint64
|
||||||
|
F_ffree uint64
|
||||||
|
F_favail int64
|
||||||
|
F_syncwrites uint64
|
||||||
|
F_syncreads uint64
|
||||||
|
F_asyncwrites uint64
|
||||||
|
F_asyncreads uint64
|
||||||
|
F_fsid [8]byte /* fsid_t */
|
||||||
|
F_namemax uint32
|
||||||
|
F_owner uint32
|
||||||
|
F_ctime uint32
|
||||||
|
F_spare [3]uint32
|
||||||
|
F_fstypename [16]int8
|
||||||
|
F_mntonname [90]int8
|
||||||
|
F_mntfromname [90]int8
|
||||||
|
Pad_godefs_1 [4]byte
|
||||||
|
Mount_info [160]byte /* mount_info */
|
||||||
|
}
|
||||||
|
|
||||||
|
type Flock_t struct {
|
||||||
|
Start int64
|
||||||
|
Len int64
|
||||||
|
Pid int32
|
||||||
|
Type int16
|
||||||
|
Whence int16
|
||||||
|
}
|
||||||
|
|
||||||
|
type Dirent struct {
|
||||||
|
Fileno uint32
|
||||||
|
Reclen uint16
|
||||||
|
Type uint8
|
||||||
|
Namlen uint8
|
||||||
|
Name [256]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddrInet4 struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Port uint16
|
||||||
|
Addr [4]byte /* in_addr */
|
||||||
|
Zero [8]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddrInet6 struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Port uint16
|
||||||
|
Flowinfo uint32
|
||||||
|
Addr [16]byte /* in6_addr */
|
||||||
|
Scope_id uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddrUnix struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Path [104]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddrDatalink struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Index uint16
|
||||||
|
Type uint8
|
||||||
|
Nlen uint8
|
||||||
|
Alen uint8
|
||||||
|
Slen uint8
|
||||||
|
Data [24]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddr struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Data [14]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddrAny struct {
|
||||||
|
Addr RawSockaddr
|
||||||
|
Pad [92]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type _Socklen uint32
|
||||||
|
|
||||||
|
type Linger struct {
|
||||||
|
Onoff int32
|
||||||
|
Linger int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Iovec struct {
|
||||||
|
Base *byte
|
||||||
|
Len uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type IPMreq struct {
|
||||||
|
Multiaddr [4]byte /* in_addr */
|
||||||
|
Interface [4]byte /* in_addr */
|
||||||
|
}
|
||||||
|
|
||||||
|
type IPv6Mreq struct {
|
||||||
|
Multiaddr [16]byte /* in6_addr */
|
||||||
|
Interface uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Msghdr struct {
|
||||||
|
Name *byte
|
||||||
|
Namelen uint32
|
||||||
|
Pad_godefs_0 [4]byte
|
||||||
|
Iov *Iovec
|
||||||
|
Iovlen uint32
|
||||||
|
Pad_godefs_1 [4]byte
|
||||||
|
Control *byte
|
||||||
|
Controllen uint32
|
||||||
|
Flags int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Cmsghdr struct {
|
||||||
|
Len uint32
|
||||||
|
Level int32
|
||||||
|
Type int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Inet6Pktinfo struct {
|
||||||
|
Addr [16]byte /* in6_addr */
|
||||||
|
Ifindex uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Kevent_t struct {
|
||||||
|
Ident uint32
|
||||||
|
Filter int16
|
||||||
|
Flags uint16
|
||||||
|
Fflags uint32
|
||||||
|
Data int32
|
||||||
|
Udata *byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type FdSet struct {
|
||||||
|
Bits [32]int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type IfMsghdr struct {
|
||||||
|
Msglen uint16
|
||||||
|
Version uint8
|
||||||
|
Type uint8
|
||||||
|
Hdrlen uint16
|
||||||
|
Index uint16
|
||||||
|
Tableid uint16
|
||||||
|
Pad1 uint8
|
||||||
|
Pad2 uint8
|
||||||
|
Addrs int32
|
||||||
|
Flags int32
|
||||||
|
Xflags int32
|
||||||
|
Data IfData
|
||||||
|
}
|
||||||
|
|
||||||
|
type IfData struct {
|
||||||
|
Type uint8
|
||||||
|
Addrlen uint8
|
||||||
|
Hdrlen uint8
|
||||||
|
Link_state uint8
|
||||||
|
Mtu uint32
|
||||||
|
Metric uint32
|
||||||
|
Pad uint32
|
||||||
|
Baudrate uint64
|
||||||
|
Ipackets uint64
|
||||||
|
Ierrors uint64
|
||||||
|
Opackets uint64
|
||||||
|
Oerrors uint64
|
||||||
|
Collisions uint64
|
||||||
|
Ibytes uint64
|
||||||
|
Obytes uint64
|
||||||
|
Imcasts uint64
|
||||||
|
Omcasts uint64
|
||||||
|
Iqdrops uint64
|
||||||
|
Noproto uint64
|
||||||
|
Lastchange Timeval
|
||||||
|
Mclpool [7][12]byte /* mclpool */
|
||||||
|
Pad_godefs_0 [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type IfaMsghdr struct {
|
||||||
|
Msglen uint16
|
||||||
|
Version uint8
|
||||||
|
Type uint8
|
||||||
|
Hdrlen uint16
|
||||||
|
Index uint16
|
||||||
|
Tableid uint16
|
||||||
|
Pad1 uint8
|
||||||
|
Pad2 uint8
|
||||||
|
Addrs int32
|
||||||
|
Flags int32
|
||||||
|
Metric int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type RtMsghdr struct {
|
||||||
|
Msglen uint16
|
||||||
|
Version uint8
|
||||||
|
Type uint8
|
||||||
|
Hdrlen uint16
|
||||||
|
Index uint16
|
||||||
|
Tableid uint16
|
||||||
|
Priority uint8
|
||||||
|
Mpls uint8
|
||||||
|
Addrs int32
|
||||||
|
Flags int32
|
||||||
|
Fmask int32
|
||||||
|
Pid int32
|
||||||
|
Seq int32
|
||||||
|
Errno int32
|
||||||
|
Inits uint32
|
||||||
|
Rmx RtMetrics
|
||||||
|
}
|
||||||
|
|
||||||
|
type RtMetrics struct {
|
||||||
|
Pksent uint64
|
||||||
|
Locks uint32
|
||||||
|
Mtu uint32
|
||||||
|
Expire uint32
|
||||||
|
Refcnt uint32
|
||||||
|
Hopcount uint32
|
||||||
|
Recvpipe uint32
|
||||||
|
Sendpipe uint32
|
||||||
|
Ssthresh uint32
|
||||||
|
Rtt uint32
|
||||||
|
Rttvar uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpfVersion struct {
|
||||||
|
Major uint16
|
||||||
|
Minor uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpfStat struct {
|
||||||
|
Recv uint32
|
||||||
|
Drop uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
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 BpfTimeval
|
||||||
|
Caplen uint32
|
||||||
|
Datalen uint32
|
||||||
|
Hdrlen uint16
|
||||||
|
Pad_godefs_0 [2]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpfTimeval struct {
|
||||||
|
Sec uint32
|
||||||
|
Usec uint32
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue