Commit 471763f6 authored by Joel Sing's avatar Joel Sing

runtime, syscall: update for openbsd system ABI break

Update Go so that it continues to work past the OpenBSD system ABI
break, with 64-bit time_t:

  http://www.openbsd.org/faq/current.html#20130813

Note: this makes OpenBSD 5.5 (currently 5.4-current) the minimum
supported release for Go.

Fixes #7049.

R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/13368046
parent 5f341df9
......@@ -121,7 +121,7 @@ struct Sigcontext {
int32 sc_eflags;
int32 sc_esp;
int32 sc_ss;
int32 sc_onstack;
int32 __sc_unused;
int32 sc_mask;
int32 sc_trapno;
int32 sc_err;
......@@ -143,11 +143,11 @@ struct StackT {
};
struct Timespec {
int32 tv_sec;
int64 tv_sec;
int32 tv_nsec;
};
struct Timeval {
int32 tv_sec;
int64 tv_sec;
int32 tv_usec;
};
struct Itimerval {
......@@ -160,7 +160,7 @@ struct Kevent {
int16 filter;
uint16 flags;
uint32 fflags;
int32 data;
int64 data;
byte *udata;
};
......
......@@ -133,7 +133,7 @@ struct Sigcontext {
int64 sc_rsp;
int64 sc_ss;
void *sc_fpstate;
int32 sc_onstack;
int32 __sc_unused;
int32 sc_mask;
};
struct Siginfo {
......@@ -154,8 +154,7 @@ struct StackT {
};
struct Timespec {
int32 tv_sec;
byte Pad_cgo_0[4];
int64 tv_sec;
int64 tv_nsec;
};
struct Timeval {
......@@ -168,11 +167,11 @@ struct Itimerval {
};
struct Kevent {
uint32 ident;
uint64 ident;
int16 filter;
uint16 flags;
uint32 fflags;
int32 data;
int64 data;
byte *udata;
};
......
......@@ -45,21 +45,22 @@ TEXT runtime·write(SB),NOSPLIT,$-4
INT $0x80
RET
TEXT runtime·usleep(SB),NOSPLIT,$20
TEXT runtime·usleep(SB),NOSPLIT,$24
MOVL $0, DX
MOVL usec+0(FP), AX
MOVL $1000000, CX
DIVL CX
MOVL AX, 12(SP) // tv_sec
MOVL AX, 12(SP) // tv_sec - l32
MOVL $0, 16(SP) // tv_sec - h32
MOVL $1000, AX
MULL DX
MOVL AX, 16(SP) // tv_nsec
MOVL AX, 20(SP) // tv_nsec
MOVL $0, 0(SP)
LEAL 12(SP), AX
MOVL AX, 4(SP) // arg 1 - rqtp
MOVL $0, 8(SP) // arg 2 - rmtp
MOVL $240, AX // sys_nanosleep
MOVL $91, AX // sys_nanosleep
INT $0x80
RET
......@@ -107,43 +108,46 @@ TEXT runtime·madvise(SB),NOSPLIT,$-4
RET
TEXT runtime·setitimer(SB),NOSPLIT,$-4
MOVL $83, AX
MOVL $69, AX
INT $0x80
RET
// func now() (sec int64, nsec int32)
TEXT time·now(SB), NOSPLIT, $32
MOVL $232, AX
LEAL 12(SP), BX
MOVL $0, 4(SP)
MOVL BX, 8(SP)
MOVL $0, 4(SP) // arg 1 - clock_id
MOVL BX, 8(SP) // arg 2 - tp
MOVL $87, AX // sys_clock_gettime
INT $0x80
MOVL 12(SP), AX // sec
MOVL 16(SP), BX // nsec
// sec is in AX, nsec in BX
MOVL 12(SP), AX // sec - l32
MOVL AX, sec+0(FP)
MOVL $0, sec+4(FP)
MOVL 16(SP), AX // sec - h32
MOVL AX, sec+4(FP)
MOVL 20(SP), BX // nsec
MOVL BX, nsec+8(FP)
RET
// int64 nanotime(void) so really
// void nanotime(int64 *nsec)
TEXT runtime·nanotime(SB),NOSPLIT,$32
MOVL $232, AX
LEAL 12(SP), BX
MOVL $0, 4(SP)
MOVL BX, 8(SP)
MOVL $0, 4(SP) // arg 1 - clock_id
MOVL BX, 8(SP) // arg 2 - tp
MOVL $87, AX // sys_clock_gettime
INT $0x80
MOVL 12(SP), AX // sec
MOVL 16(SP), BX // nsec
// sec is in AX, nsec in BX
// convert to DX:AX nsec
MOVL $1000000000, CX
MULL CX
MOVL 16(SP), CX // sec - h32
IMULL $1000000000, CX
MOVL 12(SP), AX // sec - l32
MOVL $1000000000, BX
MULL BX // result in dx:ax
MOVL 20(SP), BX // nsec
ADDL BX, AX
ADCL $0, DX
ADCL CX, DX // add high bits with carry
MOVL ret+0(FP), DI
MOVL AX, 0(DI)
......@@ -325,7 +329,7 @@ TEXT runtime·osyield(SB),NOSPLIT,$-4
RET
TEXT runtime·thrsleep(SB),NOSPLIT,$-4
MOVL $300, AX // sys___thrsleep
MOVL $94, AX // sys___thrsleep
INT $0x80
RET
......@@ -362,7 +366,7 @@ TEXT runtime·kqueue(SB),NOSPLIT,$0
// int32 runtime·kevent(int kq, Kevent *changelist, int nchanges, Kevent *eventlist, int nevents, Timespec *timeout);
TEXT runtime·kevent(SB),NOSPLIT,$0
MOVL $270, AX
MOVL $72, AX // sys_kevent
INT $0x80
JAE 2(PC)
NEGL AX
......@@ -370,7 +374,7 @@ TEXT runtime·kevent(SB),NOSPLIT,$0
// int32 runtime·closeonexec(int32 fd);
TEXT runtime·closeonexec(SB),NOSPLIT,$32
MOVL $92, AX // fcntl
MOVL $92, AX // sys_fcntl
// 0(SP) is where the caller PC would be; kernel skips it
MOVL fd+0(FP), BX
MOVL BX, 4(SP) // fd
......
......@@ -62,7 +62,7 @@ TEXT runtime·thrsleep(SB),NOSPLIT,$0
MOVQ 24(SP), DX // arg 3 - tp
MOVQ 32(SP), R10 // arg 4 - lock
MOVQ 40(SP), R8 // arg 5 - abort
MOVL $300, AX // sys___thrsleep
MOVL $94, AX // sys___thrsleep
SYSCALL
RET
......@@ -130,7 +130,7 @@ TEXT runtime·usleep(SB),NOSPLIT,$16
MOVQ SP, DI // arg 1 - rqtp
MOVQ $0, SI // arg 2 - rmtp
MOVL $240, AX // sys_nanosleep
MOVL $91, AX // sys_nanosleep
SYSCALL
RET
......@@ -138,7 +138,7 @@ TEXT runtime·raise(SB),NOSPLIT,$16
MOVL $299, AX // sys_getthrid
SYSCALL
MOVQ AX, DI // arg 1 - pid
MOVL sig+0(FP), SI // arg 2 - signum
MOVL sig+0(FP), SI // arg 2 - signum
MOVL $37, AX // sys_kill
SYSCALL
RET
......@@ -147,7 +147,7 @@ TEXT runtime·setitimer(SB),NOSPLIT,$-8
MOVL 8(SP), DI // arg 1 - which
MOVQ 16(SP), SI // arg 2 - itv
MOVQ 24(SP), DX // arg 3 - oitv
MOVL $83, AX // sys_setitimer
MOVL $69, AX // sys_setitimer
SYSCALL
RET
......@@ -155,9 +155,9 @@ TEXT runtime·setitimer(SB),NOSPLIT,$-8
TEXT time·now(SB), NOSPLIT, $32
MOVQ $0, DI // arg 1 - clock_id
LEAQ 8(SP), SI // arg 2 - tp
MOVL $232, AX // sys_clock_gettime
MOVL $87, AX // sys_clock_gettime
SYSCALL
MOVL 8(SP), AX // sec
MOVQ 8(SP), AX // sec
MOVQ 16(SP), DX // nsec
// sec is in AX, nsec in DX
......@@ -168,9 +168,9 @@ TEXT time·now(SB), NOSPLIT, $32
TEXT runtime·nanotime(SB),NOSPLIT,$24
MOVQ $0, DI // arg 1 - clock_id
LEAQ 8(SP), SI // arg 2 - tp
MOVL $232, AX // sys_clock_gettime
MOVL $87, AX // sys_clock_gettime
SYSCALL
MOVL 8(SP), AX // sec
MOVQ 8(SP), AX // sec
MOVQ 16(SP), DX // nsec
// sec is in AX, nsec in DX
......@@ -318,7 +318,7 @@ TEXT runtime·kevent(SB),NOSPLIT,$0
MOVQ 32(SP), R10
MOVL 40(SP), R8
MOVQ 48(SP), R9
MOVL $270, AX
MOVL $72, AX
SYSCALL
JCC 2(PC)
NEGQ AX
......
......@@ -90,6 +90,11 @@ func Pipe(p []int) (err error) {
return
}
//sys getdents(fd int, buf []byte) (n int, err error)
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
return getdents(fd, buf)
}
// TODO
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
return -1, ENOSYS
......@@ -119,7 +124,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
//sys Fsync(fd int) (err error)
//sys Ftruncate(fd int, length int64) (err error)
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
//sysnb Getegid() (egid int)
//sysnb Geteuid() (uid int)
//sys Getfsstat(buf []Statfs_t, flags int) (n int, err error)
......
......@@ -9,7 +9,7 @@ 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.Sec = int64(nsec / 1e9)
ts.Nsec = int32(nsec % 1e9)
return
}
......@@ -19,7 +19,7 @@ func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)
func NsecToTimeval(nsec int64) (tv Timeval) {
nsec += 999 // round up to microsecond
tv.Usec = int32(nsec % 1e9 / 1e3)
tv.Sec = int32(nsec / 1e9)
tv.Sec = int64(nsec / 1e9)
return
}
......
......@@ -9,7 +9,7 @@ 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.Sec = nsec / 1e9
ts.Nsec = nsec % 1e9
return
}
......@@ -19,12 +19,12 @@ func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)
func NsecToTimeval(nsec int64) (tv Timeval) {
nsec += 999 // round up to microsecond
tv.Usec = nsec % 1e9 / 1e3
tv.Sec = int64(nsec / 1e9)
tv.Sec = nsec / 1e9
return
}
func SetKevent(k *Kevent_t, fd, mode, flags int) {
k.Ident = uint32(fd)
k.Ident = uint64(fd)
k.Filter = int16(mode)
k.Flags = uint16(flags)
}
......
......@@ -77,7 +77,7 @@ const (
BIOCGFILDROP = 0x40044278
BIOCGHDRCMPLT = 0x40044274
BIOCGRSIG = 0x40044273
BIOCGRTIMEOUT = 0x4008426e
BIOCGRTIMEOUT = 0x400c426e
BIOCGSTATS = 0x4008426f
BIOCIMMEDIATE = 0x80044270
BIOCLOCK = 0x20004276
......@@ -91,7 +91,7 @@ const (
BIOCSFILDROP = 0x80044279
BIOCSHDRCMPLT = 0x80044275
BIOCSRSIG = 0x80044272
BIOCSRTIMEOUT = 0x8008426d
BIOCSRTIMEOUT = 0x800c426d
BIOCVERSION = 0x40044271
BPF_A = 0x10
BPF_ABS = 0x20
......@@ -197,8 +197,6 @@ const (
ECHONL = 0x10
ECHOPRT = 0x20
EMT_TAGOVF = 0x1
EMUL_ENABLED = 0x1
EMUL_NATIVE = 0x2
ENDRUNDISC = 0x9
ETHERMIN = 0x2e
ETHERMTU = 0x5dc
......@@ -444,7 +442,6 @@ const (
IEXTEN = 0x400
IFAN_ARRIVAL = 0x0
IFAN_DEPARTURE = 0x1
IFA_ROUTE = 0x1
IFF_ALLMULTI = 0x200
IFF_BROADCAST = 0x2
IFF_CANTCHANGE = 0x8e52
......@@ -713,6 +710,8 @@ const (
IPPROTO_AH = 0x33
IPPROTO_CARP = 0x70
IPPROTO_DIVERT = 0x102
IPPROTO_DIVERT_INIT = 0x2
IPPROTO_DIVERT_RESP = 0x1
IPPROTO_DONE = 0x101
IPPROTO_DSTOPTS = 0x3c
IPPROTO_EGP = 0x8
......@@ -757,7 +756,6 @@ const (
IPV6_DSTOPTS = 0x32
IPV6_ESP_NETWORK_LEVEL = 0x37
IPV6_ESP_TRANS_LEVEL = 0x36
IPV6_FAITH = 0x1d
IPV6_FLOWINFO_MASK = 0xffffff0f
IPV6_FLOWLABEL_MASK = 0xffff0f00
IPV6_FRAGTTL = 0x78
......@@ -774,7 +772,6 @@ const (
IPV6_MULTICAST_IF = 0x9
IPV6_MULTICAST_LOOP = 0xb
IPV6_NEXTHOP = 0x30
IPV6_OPTIONS = 0x1
IPV6_PATHMTU = 0x2c
IPV6_PIPEX = 0x3f
IPV6_PKTINFO = 0x2e
......@@ -783,6 +780,7 @@ const (
IPV6_PORTRANGE_HIGH = 0x1
IPV6_PORTRANGE_LOW = 0x2
IPV6_RECVDSTOPTS = 0x28
IPV6_RECVDSTPORT = 0x40
IPV6_RECVHOPLIMIT = 0x25
IPV6_RECVHOPOPTS = 0x27
IPV6_RECVPATHMTU = 0x2b
......@@ -793,9 +791,7 @@ const (
IPV6_RTHDR = 0x33
IPV6_RTHDRDSTOPTS = 0x23
IPV6_RTHDR_LOOSE = 0x0
IPV6_RTHDR_STRICT = 0x1
IPV6_RTHDR_TYPE_0 = 0x0
IPV6_SOCKOPT_RESERVED1 = 0x3
IPV6_TCLASS = 0x3d
IPV6_UNICAST_HOPS = 0x4
IPV6_USE_MIN_MTU = 0x2a
......@@ -807,6 +803,7 @@ const (
IP_DEFAULT_MULTICAST_LOOP = 0x1
IP_DEFAULT_MULTICAST_TTL = 0x1
IP_DF = 0x4000
IP_DIVERTFL = 0x1022
IP_DROP_MEMBERSHIP = 0xd
IP_ESP_NETWORK_LEVEL = 0x16
IP_ESP_TRANS_LEVEL = 0x15
......@@ -926,10 +923,10 @@ const (
PARODD = 0x2000
PENDIN = 0x20000000
PF_FLUSH = 0x1
PT_MASK = 0x3ff000
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
PT_MASK = 0x3ff000
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
RLIMIT_DATA = 0x2
......@@ -966,7 +963,7 @@ const (
RTF_CLONING = 0x100
RTF_DONE = 0x40
RTF_DYNAMIC = 0x10
RTF_FMASK = 0xf808
RTF_FMASK = 0x10f808
RTF_GATEWAY = 0x2
RTF_HOST = 0x4
RTF_LLINFO = 0x400
......@@ -1001,7 +998,7 @@ const (
RTM_REDIRECT = 0x6
RTM_RESOLVE = 0xb
RTM_RTTUNIT = 0xf4240
RTM_VERSION = 0x4
RTM_VERSION = 0x5
RTV_EXPIRE = 0x4
RTV_HOPCOUNT = 0x2
RTV_MTU = 0x1
......@@ -1027,7 +1024,7 @@ const (
SIOCBRDGADD = 0x8054693c
SIOCBRDGADDS = 0x80546941
SIOCBRDGARL = 0x806e694d
SIOCBRDGDADDR = 0x80286947
SIOCBRDGDADDR = 0x81286947
SIOCBRDGDEL = 0x8054693d
SIOCBRDGDELS = 0x80546942
SIOCBRDGFLUSH = 0x80546948
......@@ -1037,14 +1034,14 @@ const (
SIOCBRDGGHT = 0xc0146951
SIOCBRDGGIFFLGS = 0xc054693e
SIOCBRDGGMA = 0xc0146953
SIOCBRDGGPARAM = 0xc0386958
SIOCBRDGGPARAM = 0xc03c6958
SIOCBRDGGPRI = 0xc0146950
SIOCBRDGGRL = 0xc028694f
SIOCBRDGGSIFS = 0xc054693c
SIOCBRDGGTO = 0xc0146946
SIOCBRDGIFS = 0xc0546942
SIOCBRDGRTS = 0xc0186943
SIOCBRDGSADDR = 0xc0286944
SIOCBRDGSADDR = 0xc1286944
SIOCBRDGSCACHE = 0x80146940
SIOCBRDGSFD = 0x80146952
SIOCBRDGSHT = 0x80146951
......@@ -1067,6 +1064,7 @@ const (
SIOCGETPFSYNC = 0xc02069f8
SIOCGETSGCNT = 0xc0147534
SIOCGETVIFCNT = 0xc0147533
SIOCGETVLAN = 0xc0206990
SIOCGHIWAT = 0x40047301
SIOCGIFADDR = 0xc0206921
SIOCGIFASYNCMAP = 0xc020697c
......@@ -1077,9 +1075,9 @@ const (
SIOCGIFDSTADDR = 0xc0206922
SIOCGIFFLAGS = 0xc0206911
SIOCGIFGATTR = 0xc024698b
SIOCGIFGENERIC = 0xc020693a
SIOCGIFGMEMB = 0xc024698a
SIOCGIFGROUP = 0xc0246988
SIOCGIFHARDMTU = 0xc02069a5
SIOCGIFMEDIA = 0xc0286936
SIOCGIFMETRIC = 0xc0206917
SIOCGIFMTU = 0xc020697e
......@@ -1094,9 +1092,12 @@ const (
SIOCGLIFADDR = 0xc218691d
SIOCGLIFPHYADDR = 0xc218694b
SIOCGLIFPHYRTABLE = 0xc02069a2
SIOCGLIFPHYTTL = 0xc02069a9
SIOCGLOWAT = 0x40047303
SIOCGPGRP = 0x40047309
SIOCGSPPPPARAMS = 0xc0206994
SIOCGVH = 0xc02069f6
SIOCGVNETID = 0xc02069a7
SIOCIFCREATE = 0x8020697a
SIOCIFDESTROY = 0x80206979
SIOCIFGCLONERS = 0xc00c6978
......@@ -1104,6 +1105,7 @@ const (
SIOCSETLABEL = 0x80206999
SIOCSETPFLOW = 0x802069fd
SIOCSETPFSYNC = 0x802069f7
SIOCSETVLAN = 0x8020698f
SIOCSHIWAT = 0x80047300
SIOCSIFADDR = 0x8020690c
SIOCSIFASYNCMAP = 0x8020697d
......@@ -1112,7 +1114,6 @@ const (
SIOCSIFDSTADDR = 0x8020690e
SIOCSIFFLAGS = 0x80206910
SIOCSIFGATTR = 0x8024698c
SIOCSIFGENERIC = 0x80206939
SIOCSIFLLADDR = 0x8020691f
SIOCSIFMEDIA = 0xc0206935
SIOCSIFMETRIC = 0x80206918
......@@ -1126,9 +1127,12 @@ const (
SIOCSIFXFLAGS = 0x8020699d
SIOCSLIFPHYADDR = 0x8218694a
SIOCSLIFPHYRTABLE = 0x802069a1
SIOCSLIFPHYTTL = 0x802069a8
SIOCSLOWAT = 0x80047302
SIOCSPGRP = 0x80047308
SIOCSSPPPPARAMS = 0x80206993
SIOCSVH = 0xc02069f5
SIOCSVNETID = 0x802069a6
SOCK_DGRAM = 0x2
SOCK_RAW = 0x3
SOCK_RDM = 0x4
......@@ -1171,6 +1175,7 @@ const (
TCP_MD5SIG = 0x4
TCP_MSS = 0x200
TCP_NODELAY = 0x1
TCP_NOPUSH = 0x10
TCP_NSTATES = 0xb
TCP_SACK_ENABLE = 0x8
TCSAFLUSH = 0x2
......@@ -1190,7 +1195,7 @@ const (
TIOCGETD = 0x4004741a
TIOCGFLAGS = 0x4004745d
TIOCGPGRP = 0x40047477
TIOCGTSTAMP = 0x4008745b
TIOCGTSTAMP = 0x400c745b
TIOCGWINSZ = 0x40087468
TIOCMBIC = 0x8004746b
TIOCMBIS = 0x8004746c
......
......@@ -140,10 +140,8 @@ const (
BPF_W = 0x0
BPF_X = 0x8
BRKINT = 0x2
CCR0_FLUSH = 0x10
CFLUSH = 0xf
CLOCAL = 0x8000
CPUID_CFLUSH = 0x80000
CREAD = 0x800
CS5 = 0x0
CS6 = 0x100
......@@ -198,13 +196,7 @@ const (
ECHOKE = 0x1
ECHONL = 0x10
ECHOPRT = 0x20
EFER_LMA = 0x400
EFER_LME = 0x100
EFER_NXE = 0x800
EFER_SCE = 0x1
EMT_TAGOVF = 0x1
EMUL_ENABLED = 0x1
EMUL_NATIVE = 0x2
ENDRUNDISC = 0x9
ETHERMIN = 0x2e
ETHERMTU = 0x5dc
......@@ -450,7 +442,6 @@ const (
IEXTEN = 0x400
IFAN_ARRIVAL = 0x0
IFAN_DEPARTURE = 0x1
IFA_ROUTE = 0x1
IFF_ALLMULTI = 0x200
IFF_BROADCAST = 0x2
IFF_CANTCHANGE = 0x8e52
......@@ -719,6 +710,8 @@ const (
IPPROTO_AH = 0x33
IPPROTO_CARP = 0x70
IPPROTO_DIVERT = 0x102
IPPROTO_DIVERT_INIT = 0x2
IPPROTO_DIVERT_RESP = 0x1
IPPROTO_DONE = 0x101
IPPROTO_DSTOPTS = 0x3c
IPPROTO_EGP = 0x8
......@@ -763,7 +756,6 @@ const (
IPV6_DSTOPTS = 0x32
IPV6_ESP_NETWORK_LEVEL = 0x37
IPV6_ESP_TRANS_LEVEL = 0x36
IPV6_FAITH = 0x1d
IPV6_FLOWINFO_MASK = 0xffffff0f
IPV6_FLOWLABEL_MASK = 0xffff0f00
IPV6_FRAGTTL = 0x78
......@@ -780,7 +772,6 @@ const (
IPV6_MULTICAST_IF = 0x9
IPV6_MULTICAST_LOOP = 0xb
IPV6_NEXTHOP = 0x30
IPV6_OPTIONS = 0x1
IPV6_PATHMTU = 0x2c
IPV6_PIPEX = 0x3f
IPV6_PKTINFO = 0x2e
......@@ -789,6 +780,7 @@ const (
IPV6_PORTRANGE_HIGH = 0x1
IPV6_PORTRANGE_LOW = 0x2
IPV6_RECVDSTOPTS = 0x28
IPV6_RECVDSTPORT = 0x40
IPV6_RECVHOPLIMIT = 0x25
IPV6_RECVHOPOPTS = 0x27
IPV6_RECVPATHMTU = 0x2b
......@@ -799,9 +791,7 @@ const (
IPV6_RTHDR = 0x33
IPV6_RTHDRDSTOPTS = 0x23
IPV6_RTHDR_LOOSE = 0x0
IPV6_RTHDR_STRICT = 0x1
IPV6_RTHDR_TYPE_0 = 0x0
IPV6_SOCKOPT_RESERVED1 = 0x3
IPV6_TCLASS = 0x3d
IPV6_UNICAST_HOPS = 0x4
IPV6_USE_MIN_MTU = 0x2a
......@@ -813,6 +803,7 @@ const (
IP_DEFAULT_MULTICAST_LOOP = 0x1
IP_DEFAULT_MULTICAST_TTL = 0x1
IP_DF = 0x4000
IP_DIVERTFL = 0x1022
IP_DROP_MEMBERSHIP = 0xd
IP_ESP_NETWORK_LEVEL = 0x16
IP_ESP_TRANS_LEVEL = 0x15
......@@ -932,7 +923,6 @@ const (
PARODD = 0x2000
PENDIN = 0x20000000
PF_FLUSH = 0x1
PMC5_PIPELINE_FLUSH = 0x15
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
......@@ -972,7 +962,7 @@ const (
RTF_CLONING = 0x100
RTF_DONE = 0x40
RTF_DYNAMIC = 0x10
RTF_FMASK = 0xf808
RTF_FMASK = 0x10f808
RTF_GATEWAY = 0x2
RTF_HOST = 0x4
RTF_LLINFO = 0x400
......@@ -1007,7 +997,7 @@ const (
RTM_REDIRECT = 0x6
RTM_RESOLVE = 0xb
RTM_RTTUNIT = 0xf4240
RTM_VERSION = 0x4
RTM_VERSION = 0x5
RTV_EXPIRE = 0x4
RTV_HOPCOUNT = 0x2
RTV_MTU = 0x1
......@@ -1033,7 +1023,7 @@ const (
SIOCBRDGADD = 0x8058693c
SIOCBRDGADDS = 0x80586941
SIOCBRDGARL = 0x806e694d
SIOCBRDGDADDR = 0x80286947
SIOCBRDGDADDR = 0x81286947
SIOCBRDGDEL = 0x8058693d
SIOCBRDGDELS = 0x80586942
SIOCBRDGFLUSH = 0x80586948
......@@ -1050,7 +1040,7 @@ const (
SIOCBRDGGTO = 0xc0146946
SIOCBRDGIFS = 0xc0586942
SIOCBRDGRTS = 0xc0206943
SIOCBRDGSADDR = 0xc0286944
SIOCBRDGSADDR = 0xc1286944
SIOCBRDGSCACHE = 0x80146940
SIOCBRDGSFD = 0x80146952
SIOCBRDGSHT = 0x80146951
......@@ -1073,6 +1063,7 @@ const (
SIOCGETPFSYNC = 0xc02069f8
SIOCGETSGCNT = 0xc0207534
SIOCGETVIFCNT = 0xc0287533
SIOCGETVLAN = 0xc0206990
SIOCGHIWAT = 0x40047301
SIOCGIFADDR = 0xc0206921
SIOCGIFASYNCMAP = 0xc020697c
......@@ -1083,9 +1074,9 @@ const (
SIOCGIFDSTADDR = 0xc0206922
SIOCGIFFLAGS = 0xc0206911
SIOCGIFGATTR = 0xc028698b
SIOCGIFGENERIC = 0xc020693a
SIOCGIFGMEMB = 0xc028698a
SIOCGIFGROUP = 0xc0286988
SIOCGIFHARDMTU = 0xc02069a5
SIOCGIFMEDIA = 0xc0306936
SIOCGIFMETRIC = 0xc0206917
SIOCGIFMTU = 0xc020697e
......@@ -1100,9 +1091,12 @@ const (
SIOCGLIFADDR = 0xc218691d
SIOCGLIFPHYADDR = 0xc218694b
SIOCGLIFPHYRTABLE = 0xc02069a2
SIOCGLIFPHYTTL = 0xc02069a9
SIOCGLOWAT = 0x40047303
SIOCGPGRP = 0x40047309
SIOCGSPPPPARAMS = 0xc0206994
SIOCGVH = 0xc02069f6
SIOCGVNETID = 0xc02069a7
SIOCIFCREATE = 0x8020697a
SIOCIFDESTROY = 0x80206979
SIOCIFGCLONERS = 0xc0106978
......@@ -1110,6 +1104,7 @@ const (
SIOCSETLABEL = 0x80206999
SIOCSETPFLOW = 0x802069fd
SIOCSETPFSYNC = 0x802069f7
SIOCSETVLAN = 0x8020698f
SIOCSHIWAT = 0x80047300
SIOCSIFADDR = 0x8020690c
SIOCSIFASYNCMAP = 0x8020697d
......@@ -1118,7 +1113,6 @@ const (
SIOCSIFDSTADDR = 0x8020690e
SIOCSIFFLAGS = 0x80206910
SIOCSIFGATTR = 0x8028698c
SIOCSIFGENERIC = 0x80206939
SIOCSIFLLADDR = 0x8020691f
SIOCSIFMEDIA = 0xc0206935
SIOCSIFMETRIC = 0x80206918
......@@ -1132,9 +1126,12 @@ const (
SIOCSIFXFLAGS = 0x8020699d
SIOCSLIFPHYADDR = 0x8218694a
SIOCSLIFPHYRTABLE = 0x802069a1
SIOCSLIFPHYTTL = 0x802069a8
SIOCSLOWAT = 0x80047302
SIOCSPGRP = 0x80047308
SIOCSSPPPPARAMS = 0x80206993
SIOCSVH = 0xc02069f5
SIOCSVNETID = 0x802069a6
SOCK_DGRAM = 0x2
SOCK_RAW = 0x3
SOCK_RDM = 0x4
......@@ -1177,6 +1174,7 @@ const (
TCP_MD5SIG = 0x4
TCP_MSS = 0x200
TCP_NODELAY = 0x1
TCP_NOPUSH = 0x10
TCP_NSTATES = 0xb
TCP_SACK_ENABLE = 0x8
TCSAFLUSH = 0x2
......@@ -1196,6 +1194,7 @@ const (
TIOCGETD = 0x4004741a
TIOCGFLAGS = 0x4004745d
TIOCGPGRP = 0x40047477
TIOCGSID = 0x40047463
TIOCGTSTAMP = 0x4010745b
TIOCGWINSZ = 0x40087468
TIOCMBIC = 0x8004746b
......
......@@ -268,6 +268,23 @@ func pipe(p *[2]_C_int) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getdents(fd int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Access(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
......@@ -507,23 +524,6 @@ func Ftruncate(fd int, length int64) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
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)
if e1 != 0 {
err = 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)
......
......@@ -268,6 +268,23 @@ func pipe(p *[2]_C_int) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getdents(fd int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Access(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
......@@ -507,23 +524,6 @@ func Ftruncate(fd int, length int64) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
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)
if e1 != 0 {
err = 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)
......
......@@ -48,8 +48,7 @@ var sysctlMib = []mibentry{
{"kern.cp_time2", []_C_int{1, 71}},
{"kern.cryptodevallowsoft", []_C_int{1, 53}},
{"kern.domainname", []_C_int{1, 22}},
{"kern.file", []_C_int{1, 15}},
{"kern.file2", []_C_int{1, 73}},
{"kern.file", []_C_int{1, 73}},
{"kern.forkstat", []_C_int{1, 42}},
{"kern.fscale", []_C_int{1, 46}},
{"kern.fsync", []_C_int{1, 33}},
......@@ -87,7 +86,6 @@ var sysctlMib = []mibentry{
{"kern.proc", []_C_int{1, 66}},
{"kern.random", []_C_int{1, 31}},
{"kern.rawpartition", []_C_int{1, 24}},
{"kern.rthreads", []_C_int{1, 74}},
{"kern.saved_ids", []_C_int{1, 20}},
{"kern.securelevel", []_C_int{1, 9}},
{"kern.seminfo", []_C_int{1, 61}},
......@@ -226,8 +224,6 @@ var sysctlMib = []mibentry{
{"net.inet6.ip6.forwsrcrt", []_C_int{4, 24, 17, 5}},
{"net.inet6.ip6.hdrnestlimit", []_C_int{4, 24, 17, 15}},
{"net.inet6.ip6.hlim", []_C_int{4, 24, 17, 3}},
{"net.inet6.ip6.kame_version", []_C_int{4, 24, 17, 20}},
{"net.inet6.ip6.keepfaith", []_C_int{4, 24, 17, 13}},
{"net.inet6.ip6.log_interval", []_C_int{4, 24, 17, 14}},
{"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}},
{"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}},
......@@ -236,7 +232,7 @@ var sysctlMib = []mibentry{
{"net.inet6.ip6.maxifprefixes", []_C_int{4, 24, 17, 46}},
{"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}},
{"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}},
{"net.inet6.ip6.mtu", []_C_int{4, 24, 17, 4}},
{"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}},
{"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}},
{"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}},
{"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}},
......@@ -258,26 +254,6 @@ var sysctlMib = []mibentry{
{"net.mpls.ttl", []_C_int{4, 33, 2}},
{"net.pflow.stats", []_C_int{4, 34, 1}},
{"net.pipex.enable", []_C_int{4, 35, 1}},
{"user.bc_base_max", []_C_int{8, 2}},
{"user.bc_dim_max", []_C_int{8, 3}},
{"user.bc_scale_max", []_C_int{8, 4}},
{"user.bc_string_max", []_C_int{8, 5}},
{"user.coll_weights_max", []_C_int{8, 6}},
{"user.cs_path", []_C_int{8, 1}},
{"user.expr_nest_max", []_C_int{8, 7}},
{"user.line_max", []_C_int{8, 8}},
{"user.posix2_c_bind", []_C_int{8, 11}},
{"user.posix2_c_dev", []_C_int{8, 12}},
{"user.posix2_char_term", []_C_int{8, 13}},
{"user.posix2_fort_dev", []_C_int{8, 14}},
{"user.posix2_fort_run", []_C_int{8, 15}},
{"user.posix2_localedef", []_C_int{8, 16}},
{"user.posix2_sw_dev", []_C_int{8, 17}},
{"user.posix2_upe", []_C_int{8, 18}},
{"user.posix2_version", []_C_int{8, 10}},
{"user.re_dup_max", []_C_int{8, 9}},
{"user.stream_max", []_C_int{8, 19}},
{"user.tzname_max", []_C_int{8, 20}},
{"vm.anonmin", []_C_int{2, 7}},
{"vm.loadavg", []_C_int{2, 2}},
{"vm.maxslp", []_C_int{2, 10}},
......
This diff is collapsed.
This diff is collapsed.
......@@ -19,12 +19,12 @@ type (
)
type Timespec struct {
Sec int32
Sec int64
Nsec int32
}
type Timeval struct {
Sec int32
Sec int64
Usec int32
}
......@@ -72,14 +72,13 @@ const (
)
type Stat_t struct {
Dev int32
Ino uint32
Mode uint32
Dev int32
Ino uint64
Nlink uint32
Uid uint32
Gid uint32
Rdev int32
Lspare0 int32
Atim Timespec
Mtim Timespec
Ctim Timespec
......@@ -88,9 +87,7 @@ type Stat_t struct {
Blksize uint32
Flags uint32
Gen uint32
Lspare1 int32
X__st_birthtim Timespec
Qspare [2]int64
}
type Statfs_t struct {
......@@ -110,11 +107,12 @@ type Statfs_t struct {
F_fsid Fsid
F_namemax uint32
F_owner uint32
F_ctime uint32
F_spare [3]uint32
F_ctime uint64
F_fstypename [16]int8
F_mntonname [90]int8
F_mntfromname [90]int8
F_mntfromspec [90]int8
Pad_cgo_0 [2]byte
Mount_info [160]byte
}
......@@ -127,11 +125,13 @@ type Flock_t struct {
}
type Dirent struct {
Fileno uint32
Reclen uint16
Type uint8
Namlen uint8
Name [256]int8
Fileno uint64
Off int64
Reclen uint16
Type uint8
Namlen uint8
X__d_padding [4]uint8
Name [256]int8
}
type Fsid struct {
......@@ -262,21 +262,21 @@ type Kevent_t struct {
Filter int16
Flags uint16
Fflags uint32
Data int32
Data int64
Udata *byte
}
type FdSet struct {
Bits [32]int32
Bits [32]uint32
}
const (
SizeofIfMsghdr = 0xe8
SizeofIfData = 0xd0
SizeofIfMsghdr = 0xec
SizeofIfData = 0xd4
SizeofIfaMsghdr = 0x18
SizeofIfAnnounceMsghdr = 0x1a
SizeofRtMsghdr = 0x58
SizeofRtMetrics = 0x30
SizeofRtMsghdr = 0x60
SizeofRtMetrics = 0x38
)
type IfMsghdr struct {
......@@ -364,9 +364,9 @@ type RtMsghdr struct {
type RtMetrics struct {
Pksent uint64
Expire int64
Locks uint32
Mtu uint32
Expire uint32
Refcnt uint32
Hopcount uint32
Recvpipe uint32
......@@ -374,10 +374,11 @@ type RtMetrics struct {
Ssthresh uint32
Rtt uint32
Rttvar uint32
Pad uint32
}
type Mclpool struct {
Grown uint32
Grown int32
Alive uint16
Hwm uint16
Cwm uint16
......
......@@ -19,9 +19,8 @@ type (
)
type Timespec struct {
Sec int32
Pad_cgo_0 [4]byte
Nsec int64
Sec int64
Nsec int64
}
type Timeval struct {
......@@ -73,14 +72,13 @@ const (
)
type Stat_t struct {
Dev int32
Ino uint32
Mode uint32
Dev int32
Ino uint64
Nlink uint32
Uid uint32
Gid uint32
Rdev int32
Lspare0 int32
Atim Timespec
Mtim Timespec
Ctim Timespec
......@@ -89,9 +87,8 @@ type Stat_t struct {
Blksize uint32
Flags uint32
Gen uint32
Lspare1 int32
Pad_cgo_0 [4]byte
X__st_birthtim Timespec
Qspare [2]int64
}
type Statfs_t struct {
......@@ -112,12 +109,12 @@ type Statfs_t struct {
F_fsid Fsid
F_namemax uint32
F_owner uint32
F_ctime uint32
F_spare [3]uint32
F_ctime uint64
F_fstypename [16]int8
F_mntonname [90]int8
F_mntfromname [90]int8
Pad_cgo_1 [4]byte
F_mntfromspec [90]int8
Pad_cgo_1 [2]byte
Mount_info [160]byte
}
......@@ -130,11 +127,13 @@ type Flock_t struct {
}
type Dirent struct {
Fileno uint32
Reclen uint16
Type uint8
Namlen uint8
Name [256]int8
Fileno uint64
Off int64
Reclen uint16
Type uint8
Namlen uint8
X__d_padding [4]uint8
Name [256]int8
}
type Fsid struct {
......@@ -263,16 +262,16 @@ const (
)
type Kevent_t struct {
Ident uint32
Ident uint64
Filter int16
Flags uint16
Fflags uint32
Data int32
Data int64
Udata *byte
}
type FdSet struct {
Bits [32]int32
Bits [32]uint32
}
const (
......@@ -280,8 +279,8 @@ const (
SizeofIfData = 0xe0
SizeofIfaMsghdr = 0x18
SizeofIfAnnounceMsghdr = 0x1a
SizeofRtMsghdr = 0x58
SizeofRtMetrics = 0x30
SizeofRtMsghdr = 0x60
SizeofRtMetrics = 0x38
)
type IfMsghdr struct {
......@@ -371,9 +370,9 @@ type RtMsghdr struct {
type RtMetrics struct {
Pksent uint64
Expire int64
Locks uint32
Mtu uint32
Expire uint32
Refcnt uint32
Hopcount uint32
Recvpipe uint32
......@@ -381,10 +380,11 @@ type RtMetrics struct {
Ssthresh uint32
Rtt uint32
Rttvar uint32
Pad uint32
}
type Mclpool struct {
Grown uint32
Grown int32
Alive uint16
Hwm uint16
Cwm uint16
......
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