mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
all: remove dragonfly/386 port
DragonFlyBSD dropped support for i386 in 4.0 and there is no longer a dragonfly/386 - as such, remove the Go port. Fixes #8951 Fixes #7580 Fixes #7421 Change-Id: I69022ab2262132e8f97153f14dc8c37c98527008 Reviewed-on: https://go-review.googlesource.com/7543 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Minux Ma <minux@golang.org> Run-TryBot: Joel Sing <jsing@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
facd79e4be
commit
3b1d692093
|
@ -686,7 +686,6 @@ func asmb() {
|
|||
ld.Hfreebsd,
|
||||
ld.Hnetbsd,
|
||||
ld.Hopenbsd,
|
||||
ld.Hdragonfly,
|
||||
ld.Hnacl:
|
||||
ld.Asmbelf(int64(symo))
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ func linkarchinit() {
|
|||
ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1"
|
||||
ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
|
||||
ld.Thearch.Netbsddynld = "/usr/libexec/ld.elf_so"
|
||||
ld.Thearch.Dragonflydynld = "/usr/libexec/ld-elf.so.2"
|
||||
ld.Thearch.Solarisdynld = "/lib/ld.so.1"
|
||||
}
|
||||
|
||||
|
@ -97,7 +96,6 @@ func archinit() {
|
|||
}
|
||||
|
||||
case ld.Hdarwin,
|
||||
ld.Hdragonfly,
|
||||
ld.Hfreebsd,
|
||||
ld.Hlinux,
|
||||
ld.Hnetbsd,
|
||||
|
@ -141,8 +139,7 @@ func archinit() {
|
|||
case ld.Hlinux, /* elf32 executable */
|
||||
ld.Hfreebsd,
|
||||
ld.Hnetbsd,
|
||||
ld.Hopenbsd,
|
||||
ld.Hdragonfly:
|
||||
ld.Hopenbsd:
|
||||
ld.Elfinit()
|
||||
|
||||
ld.HEADR = ld.ELFRESERVE
|
||||
|
|
|
@ -259,7 +259,6 @@ var Default Context = defaultContext()
|
|||
var cgoEnabled = map[string]bool{
|
||||
"darwin/386": true,
|
||||
"darwin/amd64": true,
|
||||
"dragonfly/386": true,
|
||||
"dragonfly/amd64": true,
|
||||
"freebsd/386": true,
|
||||
"freebsd/amd64": true,
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
// 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.
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include "libcgo.h"
|
||||
|
||||
static void* threadentry(void*);
|
||||
static void (*setg_gcc)(void*);
|
||||
|
||||
void
|
||||
x_cgo_init(G *g, void (*setg)(void*))
|
||||
{
|
||||
pthread_attr_t attr;
|
||||
size_t size;
|
||||
|
||||
setg_gcc = setg;
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_getstacksize(&attr, &size);
|
||||
g->stacklo = (uintptr)&attr - size + 4096;
|
||||
pthread_attr_destroy(&attr);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_cgo_sys_thread_start(ThreadStart *ts)
|
||||
{
|
||||
pthread_attr_t attr;
|
||||
sigset_t ign, oset;
|
||||
pthread_t p;
|
||||
size_t size;
|
||||
int err;
|
||||
|
||||
SIGFILLSET(ign);
|
||||
pthread_sigmask(SIG_SETMASK, &ign, &oset);
|
||||
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_getstacksize(&attr, &size);
|
||||
// Leave stacklo=0 and set stackhi=size; mstack will do the rest.
|
||||
ts->g->stackhi = size;
|
||||
err = pthread_create(&p, &attr, threadentry, ts);
|
||||
|
||||
pthread_sigmask(SIG_SETMASK, &oset, nil);
|
||||
|
||||
if (err != 0) {
|
||||
fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
static void*
|
||||
threadentry(void *v)
|
||||
{
|
||||
ThreadStart ts;
|
||||
|
||||
ts = *(ThreadStart*)v;
|
||||
free(v);
|
||||
|
||||
/*
|
||||
* Set specific keys.
|
||||
*/
|
||||
setg_gcc((void*)ts.g);
|
||||
|
||||
crosscall_386(ts.fn);
|
||||
return nil;
|
||||
}
|
|
@ -8,7 +8,6 @@
|
|||
Input to cgo.
|
||||
|
||||
GOARCH=amd64 go tool cgo -cdefs defs_dragonfly.go >defs_dragonfly_amd64.h
|
||||
GOARCH=386 go tool cgo -cdefs defs_dragonfly.go >defs_dragonfly_386.h
|
||||
*/
|
||||
|
||||
package runtime
|
||||
|
|
|
@ -1,198 +0,0 @@
|
|||
// created by cgo -cdefs and then converted to Go
|
||||
// cgo -cdefs defs_dragonfly.go
|
||||
|
||||
package runtime
|
||||
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
_EINTR = 0x4
|
||||
_EFAULT = 0xe
|
||||
_EBUSY = 0x10
|
||||
_EAGAIN = 0x23
|
||||
|
||||
_PROT_NONE = 0x0
|
||||
_PROT_READ = 0x1
|
||||
_PROT_WRITE = 0x2
|
||||
_PROT_EXEC = 0x4
|
||||
|
||||
_MAP_ANON = 0x1000
|
||||
_MAP_PRIVATE = 0x2
|
||||
_MAP_FIXED = 0x10
|
||||
|
||||
_MADV_FREE = 0x5
|
||||
|
||||
_SA_SIGINFO = 0x40
|
||||
_SA_RESTART = 0x2
|
||||
_SA_ONSTACK = 0x1
|
||||
|
||||
_SIGHUP = 0x1
|
||||
_SIGINT = 0x2
|
||||
_SIGQUIT = 0x3
|
||||
_SIGILL = 0x4
|
||||
_SIGTRAP = 0x5
|
||||
_SIGABRT = 0x6
|
||||
_SIGEMT = 0x7
|
||||
_SIGFPE = 0x8
|
||||
_SIGKILL = 0x9
|
||||
_SIGBUS = 0xa
|
||||
_SIGSEGV = 0xb
|
||||
_SIGSYS = 0xc
|
||||
_SIGPIPE = 0xd
|
||||
_SIGALRM = 0xe
|
||||
_SIGTERM = 0xf
|
||||
_SIGURG = 0x10
|
||||
_SIGSTOP = 0x11
|
||||
_SIGTSTP = 0x12
|
||||
_SIGCONT = 0x13
|
||||
_SIGCHLD = 0x14
|
||||
_SIGTTIN = 0x15
|
||||
_SIGTTOU = 0x16
|
||||
_SIGIO = 0x17
|
||||
_SIGXCPU = 0x18
|
||||
_SIGXFSZ = 0x19
|
||||
_SIGVTALRM = 0x1a
|
||||
_SIGPROF = 0x1b
|
||||
_SIGWINCH = 0x1c
|
||||
_SIGINFO = 0x1d
|
||||
_SIGUSR1 = 0x1e
|
||||
_SIGUSR2 = 0x1f
|
||||
|
||||
_FPE_INTDIV = 0x2
|
||||
_FPE_INTOVF = 0x1
|
||||
_FPE_FLTDIV = 0x3
|
||||
_FPE_FLTOVF = 0x4
|
||||
_FPE_FLTUND = 0x5
|
||||
_FPE_FLTRES = 0x6
|
||||
_FPE_FLTINV = 0x7
|
||||
_FPE_FLTSUB = 0x8
|
||||
|
||||
_BUS_ADRALN = 0x1
|
||||
_BUS_ADRERR = 0x2
|
||||
_BUS_OBJERR = 0x3
|
||||
|
||||
_SEGV_MAPERR = 0x1
|
||||
_SEGV_ACCERR = 0x2
|
||||
|
||||
_ITIMER_REAL = 0x0
|
||||
_ITIMER_VIRTUAL = 0x1
|
||||
_ITIMER_PROF = 0x2
|
||||
|
||||
_EV_ADD = 0x1
|
||||
_EV_DELETE = 0x2
|
||||
_EV_CLEAR = 0x20
|
||||
_EV_ERROR = 0x4000
|
||||
_EVFILT_READ = -0x1
|
||||
_EVFILT_WRITE = -0x2
|
||||
)
|
||||
|
||||
type rtprio struct {
|
||||
_type uint16
|
||||
prio uint16
|
||||
}
|
||||
|
||||
type lwpparams struct {
|
||||
start_func uintptr
|
||||
arg unsafe.Pointer
|
||||
stack uintptr
|
||||
tid1 unsafe.Pointer // *int32
|
||||
tid2 unsafe.Pointer // *int32
|
||||
}
|
||||
|
||||
type sigaltstackt struct {
|
||||
ss_sp uintptr
|
||||
ss_size uintptr
|
||||
ss_flags int32
|
||||
}
|
||||
|
||||
type sigset struct {
|
||||
__bits [4]uint32
|
||||
}
|
||||
|
||||
type stackt struct {
|
||||
ss_sp uintptr
|
||||
ss_size uintptr
|
||||
ss_flags int32
|
||||
}
|
||||
|
||||
type siginfo struct {
|
||||
si_signo int32
|
||||
si_errno int32
|
||||
si_code int32
|
||||
si_pid int32
|
||||
si_uid uint32
|
||||
si_status int32
|
||||
si_addr uintptr
|
||||
si_value [4]byte
|
||||
si_band int32
|
||||
__spare__ [7]int32
|
||||
}
|
||||
|
||||
type mcontext struct {
|
||||
mc_onstack uint32
|
||||
mc_gs uint32
|
||||
mc_fs uint32
|
||||
mc_es uint32
|
||||
mc_ds uint32
|
||||
mc_edi uint32
|
||||
mc_esi uint32
|
||||
mc_ebp uint32
|
||||
mc_isp uint32
|
||||
mc_ebx uint32
|
||||
mc_edx uint32
|
||||
mc_ecx uint32
|
||||
mc_eax uint32
|
||||
mc_xflags uint32
|
||||
mc_trapno uint32
|
||||
mc_err uint32
|
||||
mc_eip uint32
|
||||
mc_cs uint32
|
||||
mc_eflags uint32
|
||||
mc_esp uint32
|
||||
mc_ss uint32
|
||||
mc_len uint32
|
||||
mc_fpformat uint32
|
||||
mc_ownedfp uint32
|
||||
mc_fpregs [128]uint32
|
||||
__spare__ [16]uint32
|
||||
}
|
||||
|
||||
type ucontext struct {
|
||||
uc_sigmask sigset
|
||||
uc_mcontext mcontext
|
||||
uc_link *ucontext
|
||||
uc_stack stackt
|
||||
__spare__ [8]int32
|
||||
}
|
||||
|
||||
type timespec struct {
|
||||
tv_sec int32
|
||||
tv_nsec int32
|
||||
}
|
||||
|
||||
func (ts *timespec) set_sec(x int64) {
|
||||
ts.tv_sec = int32(x)
|
||||
}
|
||||
|
||||
type timeval struct {
|
||||
tv_sec int32
|
||||
tv_usec int32
|
||||
}
|
||||
|
||||
func (tv *timeval) set_usec(x int32) {
|
||||
tv.tv_usec = x
|
||||
}
|
||||
|
||||
type itimerval struct {
|
||||
it_interval timeval
|
||||
it_value timeval
|
||||
}
|
||||
|
||||
type keventt struct {
|
||||
ident uint32
|
||||
filter int16
|
||||
flags uint16
|
||||
fflags uint32
|
||||
data int32
|
||||
udata *byte
|
||||
}
|
|
@ -87,7 +87,7 @@ func newosproc(mp *m, stk unsafe.Pointer) {
|
|||
tid2: nil,
|
||||
}
|
||||
|
||||
mp.tls[0] = uintptr(mp.id) // so 386 asm can find it
|
||||
mp.tls[0] = uintptr(mp.id) // XXX so 386 asm can find it
|
||||
|
||||
lwp_create(¶ms)
|
||||
sigprocmask(&oset, nil)
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
// 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.
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
TEXT _rt0_386_dragonfly(SB),NOSPLIT,$8
|
||||
MOVL 8(SP), AX
|
||||
LEAL 12(SP), BX
|
||||
MOVL AX, 0(SP)
|
||||
MOVL BX, 4(SP)
|
||||
CALL main(SB)
|
||||
INT $3
|
||||
|
||||
TEXT main(SB),NOSPLIT,$0
|
||||
JMP runtime·rt0_go(SB)
|
|
@ -177,12 +177,6 @@ var faultAddrs = []uint64{
|
|||
}
|
||||
|
||||
func TestSetPanicOnFault(t *testing.T) {
|
||||
// This currently results in a fault in the signal trampoline on
|
||||
// dragonfly/386 - see issue 7421.
|
||||
if GOOS == "dragonfly" && GOARCH == "386" {
|
||||
t.Skip("skipping test on dragonfly/386")
|
||||
}
|
||||
|
||||
old := debug.SetPanicOnFault(true)
|
||||
defer debug.SetPanicOnFault(old)
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
// Copyright 2013 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 runtime
|
||||
|
||||
import "unsafe"
|
||||
|
||||
type sigctxt struct {
|
||||
info *siginfo
|
||||
ctxt unsafe.Pointer
|
||||
}
|
||||
|
||||
func (c *sigctxt) regs() *mcontext { return &(*ucontext)(c.ctxt).uc_mcontext }
|
||||
func (c *sigctxt) eax() uint32 { return c.regs().mc_eax }
|
||||
func (c *sigctxt) ebx() uint32 { return c.regs().mc_ebx }
|
||||
func (c *sigctxt) ecx() uint32 { return c.regs().mc_ecx }
|
||||
func (c *sigctxt) edx() uint32 { return c.regs().mc_edx }
|
||||
func (c *sigctxt) edi() uint32 { return c.regs().mc_edi }
|
||||
func (c *sigctxt) esi() uint32 { return c.regs().mc_esi }
|
||||
func (c *sigctxt) ebp() uint32 { return c.regs().mc_ebp }
|
||||
func (c *sigctxt) esp() uint32 { return c.regs().mc_esp }
|
||||
func (c *sigctxt) eip() uint32 { return c.regs().mc_eip }
|
||||
func (c *sigctxt) eflags() uint32 { return c.regs().mc_eflags }
|
||||
func (c *sigctxt) cs() uint32 { return uint32(c.regs().mc_cs) }
|
||||
func (c *sigctxt) fs() uint32 { return uint32(c.regs().mc_fs) }
|
||||
func (c *sigctxt) gs() uint32 { return uint32(c.regs().mc_gs) }
|
||||
func (c *sigctxt) sigcode() uint32 { return uint32(c.info.si_code) }
|
||||
func (c *sigctxt) sigaddr() uint32 { return uint32(c.info.si_addr) }
|
||||
|
||||
func (c *sigctxt) set_eip(x uint32) { c.regs().mc_eip = x }
|
||||
func (c *sigctxt) set_esp(x uint32) { c.regs().mc_esp = x }
|
||||
func (c *sigctxt) set_sigcode(x uint32) { c.info.si_code = int32(x) }
|
||||
func (c *sigctxt) set_sigaddr(x uint32) { c.info.si_addr = uintptr(x) }
|
|
@ -1,390 +0,0 @@
|
|||
// 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 calls and other sys.stuff for 386, FreeBSD
|
||||
// /usr/src/sys/kern/syscalls.master for syscall numbers.
|
||||
//
|
||||
|
||||
#include "go_asm.h"
|
||||
#include "go_tls.h"
|
||||
#include "textflag.h"
|
||||
|
||||
TEXT runtime·sys_umtx_sleep(SB),NOSPLIT,$-4
|
||||
MOVL $469, AX // umtx_sleep
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
NEGL AX
|
||||
MOVL AX, ret+12(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·sys_umtx_wakeup(SB),NOSPLIT,$-4
|
||||
MOVL $470, AX // umtx_wakeup
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
NEGL AX
|
||||
MOVL AX, ret+8(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·lwp_create(SB),NOSPLIT,$-4
|
||||
MOVL $495, AX // lwp_create
|
||||
INT $0x80
|
||||
MOVL AX, ret+4(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·lwp_start(SB),NOSPLIT,$0
|
||||
|
||||
// Set GS to point at m->tls.
|
||||
MOVL mm+0(FP), BX
|
||||
MOVL m_g0(BX), DX
|
||||
LEAL m_tls(BX), BP
|
||||
PUSHAL
|
||||
PUSHL BP
|
||||
CALL runtime·settls(SB)
|
||||
POPL AX
|
||||
POPAL
|
||||
|
||||
// Now segment is established. Initialize m, g.
|
||||
get_tls(CX)
|
||||
MOVL BX, g_m(DX)
|
||||
MOVL DX, g(CX)
|
||||
|
||||
CALL runtime·stackcheck(SB) // smashes AX, CX
|
||||
MOVL 0(DX), DX // paranoia; check they are not nil
|
||||
MOVL 0(BX), BX
|
||||
|
||||
// More paranoia; check that stack splitting code works.
|
||||
PUSHAL
|
||||
CALL runtime·emptyfunc(SB)
|
||||
POPAL
|
||||
|
||||
CALL runtime·mstart(SB)
|
||||
|
||||
CALL runtime·exit1(SB)
|
||||
MOVL $0x1234, 0x1005
|
||||
RET
|
||||
|
||||
// Exit the entire program (like C exit)
|
||||
TEXT runtime·exit(SB),NOSPLIT,$-4
|
||||
MOVL $1, AX
|
||||
INT $0x80
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
RET
|
||||
|
||||
TEXT runtime·exit1(SB),NOSPLIT,$16
|
||||
MOVL $0, 0(SP) // syscall gap
|
||||
MOVL $0x10000, 4(SP) // arg 1 - how (EXTEXIT_LWP)
|
||||
MOVL $0, 8(SP) // arg 2 - status
|
||||
MOVL $0, 12(SP) // arg 3 - addr
|
||||
MOVL $494, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
RET
|
||||
|
||||
TEXT runtime·open(SB),NOSPLIT,$-4
|
||||
MOVL $5, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $-1, AX
|
||||
MOVL AX, ret+12(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·close(SB),NOSPLIT,$-4
|
||||
MOVL $6, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $-1, AX
|
||||
MOVL AX, ret+4(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·read(SB),NOSPLIT,$-4
|
||||
MOVL $3, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $-1, AX
|
||||
MOVL AX, ret+12(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·write(SB),NOSPLIT,$-4
|
||||
MOVL $4, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $-1, AX
|
||||
MOVL AX, ret+12(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·getrlimit(SB),NOSPLIT,$-4
|
||||
MOVL $194, AX
|
||||
INT $0x80
|
||||
MOVL AX, ret+8(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·raise(SB),NOSPLIT,$16
|
||||
MOVL $496, AX // lwp_gettid
|
||||
INT $0x80
|
||||
MOVL $0, 0(SP)
|
||||
MOVL $-1, 4(SP) // arg 1 - pid
|
||||
MOVL AX, 8(SP) // arg 2 - tid
|
||||
MOVL sig+0(FP), AX
|
||||
MOVL AX, 8(SP) // arg 3 - signum
|
||||
MOVL $497, AX // lwp_kill
|
||||
INT $0x80
|
||||
RET
|
||||
|
||||
TEXT runtime·mmap(SB),NOSPLIT,$36
|
||||
LEAL addr+0(FP), SI
|
||||
LEAL 4(SP), DI
|
||||
CLD
|
||||
MOVSL // arg 1 - addr
|
||||
MOVSL // arg 2 - len
|
||||
MOVSL // arg 3 - prot
|
||||
MOVSL // arg 4 - flags
|
||||
MOVSL // arg 5 - fd
|
||||
MOVL $0, AX
|
||||
STOSL // arg 6 - pad
|
||||
MOVSL // arg 7 - offset
|
||||
MOVL $0, AX // top 32 bits of file offset
|
||||
STOSL
|
||||
MOVL $197, AX // sys_mmap
|
||||
INT $0x80
|
||||
MOVL AX, ret+24(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·munmap(SB),NOSPLIT,$-4
|
||||
MOVL $73, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
RET
|
||||
|
||||
TEXT runtime·madvise(SB),NOSPLIT,$-4
|
||||
MOVL $75, AX // madvise
|
||||
INT $0x80
|
||||
// ignore failure - maybe pages are locked
|
||||
RET
|
||||
|
||||
TEXT runtime·setitimer(SB), NOSPLIT, $-4
|
||||
MOVL $83, 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) // CLOCK_REALTIME
|
||||
MOVL BX, 8(SP)
|
||||
INT $0x80
|
||||
MOVL 12(SP), AX // sec
|
||||
MOVL 16(SP), BX // nsec
|
||||
|
||||
// sec is in AX, nsec in BX
|
||||
MOVL AX, sec+0(FP)
|
||||
MOVL $0, sec+4(FP)
|
||||
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 $4, 4(SP) // CLOCK_MONOTONIC
|
||||
MOVL BX, 8(SP)
|
||||
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
|
||||
ADDL BX, AX
|
||||
ADCL $0, DX
|
||||
|
||||
MOVL AX, ret_lo+0(FP)
|
||||
MOVL DX, ret_hi+4(FP)
|
||||
RET
|
||||
|
||||
|
||||
TEXT runtime·sigaction(SB),NOSPLIT,$-4
|
||||
MOVL $342, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
RET
|
||||
|
||||
TEXT runtime·sigtramp(SB),NOSPLIT,$44
|
||||
get_tls(CX)
|
||||
|
||||
// check that g exists
|
||||
MOVL g(CX), DI
|
||||
CMPL DI, $0
|
||||
JNE 6(PC)
|
||||
MOVL signo+0(FP), BX
|
||||
MOVL BX, 0(SP)
|
||||
MOVL $runtime·badsignal(SB), AX
|
||||
CALL AX
|
||||
JMP ret
|
||||
|
||||
// save g
|
||||
MOVL DI, 20(SP)
|
||||
|
||||
// g = m->gsignal
|
||||
MOVL g_m(DI), BX
|
||||
MOVL m_gsignal(BX), BX
|
||||
MOVL BX, g(CX)
|
||||
|
||||
// copy arguments for call to sighandler
|
||||
MOVL signo+0(FP), BX
|
||||
MOVL BX, 0(SP)
|
||||
MOVL info+4(FP), BX
|
||||
MOVL BX, 4(SP)
|
||||
MOVL context+8(FP), BX
|
||||
MOVL BX, 8(SP)
|
||||
MOVL DI, 12(SP)
|
||||
|
||||
CALL runtime·sighandler(SB)
|
||||
|
||||
// restore g
|
||||
get_tls(CX)
|
||||
MOVL 20(SP), BX
|
||||
MOVL BX, g(CX)
|
||||
|
||||
ret:
|
||||
// call sigreturn
|
||||
MOVL context+8(FP), AX
|
||||
MOVL $0, 0(SP) // syscall gap
|
||||
MOVL AX, 4(SP)
|
||||
MOVL $344, AX // sigreturn(ucontext)
|
||||
INT $0x80
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
RET
|
||||
|
||||
TEXT runtime·sigaltstack(SB),NOSPLIT,$0
|
||||
MOVL $53, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
RET
|
||||
|
||||
TEXT runtime·usleep(SB),NOSPLIT,$20
|
||||
MOVL $0, DX
|
||||
MOVL usec+0(FP), AX
|
||||
MOVL $1000000, CX
|
||||
DIVL CX
|
||||
MOVL AX, 12(SP) // tv_sec
|
||||
MOVL $1000, AX
|
||||
MULL DX
|
||||
MOVL AX, 16(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
|
||||
INT $0x80
|
||||
RET
|
||||
|
||||
TEXT runtime·setldt(SB),NOSPLIT,$4
|
||||
// Under DragonFly we set the GS base instead of messing with the LDT.
|
||||
MOVL tls0+4(FP), AX
|
||||
MOVL AX, 0(SP)
|
||||
CALL runtime·settls(SB)
|
||||
RET
|
||||
|
||||
TEXT runtime·settls(SB),NOSPLIT,$24
|
||||
// adjust for ELF: wants to use -4(GS) for g
|
||||
MOVL tlsbase+0(FP), CX
|
||||
ADDL $4, CX
|
||||
|
||||
// Set up a struct tls_info - a size of -1 maps the whole address
|
||||
// space and is required for direct-tls access of variable data
|
||||
// via negative offsets.
|
||||
LEAL 16(SP), BX
|
||||
MOVL CX, 16(SP) // base
|
||||
MOVL $-1, 20(SP) // size
|
||||
|
||||
// set_tls_area returns the descriptor that needs to be loaded into GS.
|
||||
MOVL $0, 0(SP) // syscall gap
|
||||
MOVL $0, 4(SP) // arg 1 - which
|
||||
MOVL BX, 8(SP) // arg 2 - tls_info
|
||||
MOVL $8, 12(SP) // arg 3 - infosize
|
||||
MOVL $472, AX // set_tls_area
|
||||
INT $0x80
|
||||
JCC 2(PC)
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
MOVW AX, GS
|
||||
RET
|
||||
|
||||
TEXT runtime·sysctl(SB),NOSPLIT,$28
|
||||
LEAL mib+0(FP), SI
|
||||
LEAL 4(SP), DI
|
||||
CLD
|
||||
MOVSL // arg 1 - name
|
||||
MOVSL // arg 2 - namelen
|
||||
MOVSL // arg 3 - oldp
|
||||
MOVSL // arg 4 - oldlenp
|
||||
MOVSL // arg 5 - newp
|
||||
MOVSL // arg 6 - newlen
|
||||
MOVL $202, AX // sys___sysctl
|
||||
INT $0x80
|
||||
JCC 4(PC)
|
||||
NEGL AX
|
||||
MOVL AX, ret+24(FP)
|
||||
RET
|
||||
MOVL $0, AX
|
||||
MOVL AX, ret+24(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·osyield(SB),NOSPLIT,$-4
|
||||
MOVL $331, AX // sys_sched_yield
|
||||
INT $0x80
|
||||
RET
|
||||
|
||||
TEXT runtime·sigprocmask(SB),NOSPLIT,$16
|
||||
MOVL $0, 0(SP) // syscall gap
|
||||
MOVL $3, 4(SP) // arg 1 - how (SIG_SETMASK)
|
||||
MOVL new+0(FP), AX
|
||||
MOVL AX, 8(SP) // arg 2 - set
|
||||
MOVL old+4(FP), AX
|
||||
MOVL AX, 12(SP) // arg 3 - oset
|
||||
MOVL $340, AX // sys_sigprocmask
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
RET
|
||||
|
||||
// int32 runtime·kqueue(void);
|
||||
TEXT runtime·kqueue(SB),NOSPLIT,$0
|
||||
MOVL $362, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
NEGL AX
|
||||
MOVL AX, ret+0(FP)
|
||||
RET
|
||||
|
||||
// int32 runtime·kevent(int kq, Kevent *changelist, int nchanges, Kevent *eventlist, int nevents, Timespec *timeout);
|
||||
TEXT runtime·kevent(SB),NOSPLIT,$0
|
||||
MOVL $363, AX
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
NEGL AX
|
||||
MOVL AX, ret+24(FP)
|
||||
RET
|
||||
|
||||
// int32 runtime·closeonexec(int32 fd);
|
||||
TEXT runtime·closeonexec(SB),NOSPLIT,$32
|
||||
MOVL $92, AX // fcntl
|
||||
// 0(SP) is where the caller PC would be; kernel skips it
|
||||
MOVL fd+0(FP), BX
|
||||
MOVL BX, 4(SP) // fd
|
||||
MOVL $2, 8(SP) // F_SETFD
|
||||
MOVL $1, 12(SP) // FD_CLOEXEC
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
NEGL AX
|
||||
RET
|
||||
|
||||
GLOBL runtime·tlsoffset(SB),NOPTR,$4
|
|
@ -1,140 +0,0 @@
|
|||
// 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.
|
||||
|
||||
#include "textflag.h"
|
||||
#include "funcdata.h"
|
||||
|
||||
//
|
||||
// System call support for 386, FreeBSD
|
||||
//
|
||||
|
||||
// func Syscall(trap int32, a1, a2, a3 int32) (r1, r2, err int32);
|
||||
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
|
||||
// Trap # in AX, args on stack above caller pc.
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-32
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
LEAL 4(SP), DI
|
||||
CLD
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
INT $0x80
|
||||
JAE ok
|
||||
MOVL $-1, 20(SP) // r1
|
||||
MOVL $-1, 24(SP) // r2
|
||||
MOVL AX, 28(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
ok:
|
||||
MOVL AX, 20(SP) // r1
|
||||
MOVL DX, 24(SP) // r2
|
||||
MOVL $0, 28(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-44
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
LEAL 4(SP), DI
|
||||
CLD
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
INT $0x80
|
||||
JAE ok6
|
||||
MOVL $-1, 32(SP) // r1
|
||||
MOVL $-1, 36(SP) // r2
|
||||
MOVL AX, 40(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
ok6:
|
||||
MOVL AX, 32(SP) // r1
|
||||
MOVL DX, 36(SP) // r2
|
||||
MOVL $0, 40(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
LEAL 4(SP), DI
|
||||
CLD
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
INT $0x80
|
||||
JAE ok9
|
||||
MOVL $-1, 44(SP) // r1
|
||||
MOVL $-1, 48(SP) // r2
|
||||
MOVL AX, 52(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
ok9:
|
||||
MOVL AX, 44(SP) // r1
|
||||
MOVL DX, 48(SP) // r2
|
||||
MOVL $0, 52(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-32
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
LEAL 4(SP), DI
|
||||
CLD
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
INT $0x80
|
||||
JAE ok1
|
||||
MOVL $-1, 20(SP) // r1
|
||||
MOVL $-1, 24(SP) // r2
|
||||
MOVL AX, 28(SP) // errno
|
||||
RET
|
||||
ok1:
|
||||
MOVL AX, 20(SP) // r1
|
||||
MOVL DX, 24(SP) // r2
|
||||
MOVL $0, 28(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
LEAL 4(SP), DI
|
||||
CLD
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
MOVSL
|
||||
INT $0x80
|
||||
JAE ok2
|
||||
MOVL $-1, 32(SP) // r1
|
||||
MOVL $-1, 36(SP) // r2
|
||||
MOVL AX, 40(SP) // errno
|
||||
RET
|
||||
ok2:
|
||||
MOVL AX, 32(SP) // r1
|
||||
MOVL DX, 36(SP) // r2
|
||||
MOVL $0, 40(SP) // errno
|
||||
RET
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// FreeBSD system calls.
|
||||
// DragonflyBSD 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.
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
// 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
|
||||
|
||||
import "unsafe"
|
||||
|
||||
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 = int32(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 = int32(nsec % 1e9 / 1e3)
|
||||
tv.Sec = int32(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 = uint32(length)
|
||||
}
|
||||
|
||||
func (msghdr *Msghdr) SetControllen(length int) {
|
||||
msghdr.Controllen = uint32(length)
|
||||
}
|
||||
|
||||
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||
cmsg.Len = uint32(length)
|
||||
}
|
||||
|
||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||
var writtenOut uint64 = 0
|
||||
_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)
|
||||
|
||||
written = int(writtenOut)
|
||||
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,302 +0,0 @@
|
|||
// mksysnum_dragonfly.pl
|
||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
||||
|
||||
package syscall
|
||||
|
||||
const (
|
||||
// SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int
|
||||
SYS_EXIT = 1 // { void exit(int rval); }
|
||||
SYS_FORK = 2 // { int fork(void); }
|
||||
SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); }
|
||||
SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); }
|
||||
SYS_OPEN = 5 // { int open(char *path, int flags, int mode); }
|
||||
SYS_CLOSE = 6 // { int close(int fd); }
|
||||
SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, \
|
||||
SYS_LINK = 9 // { int link(char *path, char *link); }
|
||||
SYS_UNLINK = 10 // { int unlink(char *path); }
|
||||
SYS_CHDIR = 12 // { int chdir(char *path); }
|
||||
SYS_FCHDIR = 13 // { int fchdir(int fd); }
|
||||
SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); }
|
||||
SYS_CHMOD = 15 // { int chmod(char *path, int mode); }
|
||||
SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); }
|
||||
SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int
|
||||
SYS_GETFSSTAT = 18 // { int getfsstat(struct statfs *buf, long bufsize, \
|
||||
SYS_GETPID = 20 // { pid_t getpid(void); }
|
||||
SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, \
|
||||
SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); }
|
||||
SYS_SETUID = 23 // { int setuid(uid_t uid); }
|
||||
SYS_GETUID = 24 // { uid_t getuid(void); }
|
||||
SYS_GETEUID = 25 // { uid_t geteuid(void); }
|
||||
SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, \
|
||||
SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); }
|
||||
SYS_SENDMSG = 28 // { int sendmsg(int s, caddr_t msg, int flags); }
|
||||
SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, \
|
||||
SYS_ACCEPT = 30 // { int accept(int s, caddr_t name, int *anamelen); }
|
||||
SYS_GETPEERNAME = 31 // { int getpeername(int fdes, caddr_t asa, int *alen); }
|
||||
SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, caddr_t asa, int *alen); }
|
||||
SYS_ACCESS = 33 // { int access(char *path, int flags); }
|
||||
SYS_CHFLAGS = 34 // { int chflags(char *path, int flags); }
|
||||
SYS_FCHFLAGS = 35 // { int fchflags(int fd, int flags); }
|
||||
SYS_SYNC = 36 // { int sync(void); }
|
||||
SYS_KILL = 37 // { int kill(int pid, int signum); }
|
||||
SYS_GETPPID = 39 // { pid_t getppid(void); }
|
||||
SYS_DUP = 41 // { int dup(u_int fd); }
|
||||
SYS_PIPE = 42 // { int pipe(void); }
|
||||
SYS_GETEGID = 43 // { gid_t getegid(void); }
|
||||
SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \
|
||||
SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, \
|
||||
SYS_GETGID = 47 // { gid_t getgid(void); }
|
||||
SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); }
|
||||
SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); }
|
||||
SYS_ACCT = 51 // { int acct(char *path); }
|
||||
SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); }
|
||||
SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); }
|
||||
SYS_REBOOT = 55 // { int reboot(int opt); }
|
||||
SYS_REVOKE = 56 // { int revoke(char *path); }
|
||||
SYS_SYMLINK = 57 // { int symlink(char *path, char *link); }
|
||||
SYS_READLINK = 58 // { int readlink(char *path, char *buf, int count); }
|
||||
SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); }
|
||||
SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int
|
||||
SYS_CHROOT = 61 // { int chroot(char *path); }
|
||||
SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); }
|
||||
SYS_VFORK = 66 // { pid_t vfork(void); }
|
||||
SYS_SBRK = 69 // { int sbrk(int incr); }
|
||||
SYS_SSTK = 70 // { int sstk(int incr); }
|
||||
SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); }
|
||||
SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); }
|
||||
SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); }
|
||||
SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \
|
||||
SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); }
|
||||
SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); }
|
||||
SYS_GETPGRP = 81 // { int getpgrp(void); }
|
||||
SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); }
|
||||
SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, \
|
||||
SYS_SWAPON = 85 // { int swapon(char *name); }
|
||||
SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); }
|
||||
SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); }
|
||||
SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); }
|
||||
SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); }
|
||||
SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \
|
||||
SYS_FSYNC = 95 // { int fsync(int fd); }
|
||||
SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); }
|
||||
SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); }
|
||||
SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); }
|
||||
SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); }
|
||||
SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); }
|
||||
SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \
|
||||
SYS_LISTEN = 106 // { int listen(int s, int backlog); }
|
||||
SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \
|
||||
SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); }
|
||||
SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \
|
||||
SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); }
|
||||
SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \
|
||||
SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \
|
||||
SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); }
|
||||
SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); }
|
||||
SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); }
|
||||
SYS_SETREGID = 127 // { int setregid(int rgid, int egid); }
|
||||
SYS_RENAME = 128 // { int rename(char *from, char *to); }
|
||||
SYS_FLOCK = 131 // { int flock(int fd, int how); }
|
||||
SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); }
|
||||
SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \
|
||||
SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); }
|
||||
SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, \
|
||||
SYS_MKDIR = 136 // { int mkdir(char *path, int mode); }
|
||||
SYS_RMDIR = 137 // { int rmdir(char *path); }
|
||||
SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); }
|
||||
SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \
|
||||
SYS_SETSID = 147 // { int setsid(void); }
|
||||
SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \
|
||||
SYS_STATFS = 157 // { int statfs(char *path, struct statfs *buf); }
|
||||
SYS_FSTATFS = 158 // { int fstatfs(int fd, struct statfs *buf); }
|
||||
SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); }
|
||||
SYS_GETDOMAINNAME = 162 // { int getdomainname(char *domainname, int len); }
|
||||
SYS_SETDOMAINNAME = 163 // { int setdomainname(char *domainname, int len); }
|
||||
SYS_UNAME = 164 // { int uname(struct utsname *name); }
|
||||
SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); }
|
||||
SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \
|
||||
SYS_EXTPREAD = 173 // { ssize_t extpread(int fd, void *buf, \
|
||||
SYS_EXTPWRITE = 174 // { ssize_t extpwrite(int fd, const void *buf, \
|
||||
SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); }
|
||||
SYS_SETGID = 181 // { int setgid(gid_t gid); }
|
||||
SYS_SETEGID = 182 // { int setegid(gid_t egid); }
|
||||
SYS_SETEUID = 183 // { int seteuid(uid_t euid); }
|
||||
SYS_PATHCONF = 191 // { int pathconf(char *path, int name); }
|
||||
SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); }
|
||||
SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \
|
||||
SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \
|
||||
SYS_MMAP = 197 // { caddr_t mmap(caddr_t addr, size_t len, int prot, \
|
||||
// SYS_NOSYS = 198; // { int nosys(void); } __syscall __syscall_args int
|
||||
SYS_LSEEK = 199 // { off_t lseek(int fd, int pad, off_t offset, \
|
||||
SYS_TRUNCATE = 200 // { int truncate(char *path, int pad, off_t length); }
|
||||
SYS_FTRUNCATE = 201 // { int ftruncate(int fd, int pad, off_t length); }
|
||||
SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, \
|
||||
SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); }
|
||||
SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); }
|
||||
SYS_UNDELETE = 205 // { int undelete(char *path); }
|
||||
SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); }
|
||||
SYS_GETPGID = 207 // { int getpgid(pid_t pid); }
|
||||
SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \
|
||||
SYS___SEMCTL = 220 // { int __semctl(int semid, int semnum, int cmd, \
|
||||
SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); }
|
||||
SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \
|
||||
SYS_MSGCTL = 224 // { int msgctl(int msqid, int cmd, \
|
||||
SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); }
|
||||
SYS_MSGSND = 226 // { int msgsnd(int msqid, void *msgp, size_t msgsz, \
|
||||
SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, \
|
||||
SYS_SHMAT = 228 // { caddr_t shmat(int shmid, const void *shmaddr, \
|
||||
SYS_SHMCTL = 229 // { int shmctl(int shmid, int cmd, \
|
||||
SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); }
|
||||
SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); }
|
||||
SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \
|
||||
SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, \
|
||||
SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \
|
||||
SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \
|
||||
SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); }
|
||||
SYS_RFORK = 251 // { int rfork(int flags); }
|
||||
SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, \
|
||||
SYS_ISSETUGID = 253 // { int issetugid(void); }
|
||||
SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); }
|
||||
SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); }
|
||||
SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); }
|
||||
SYS_EXTPREADV = 289 // { ssize_t extpreadv(int fd, struct iovec *iovp, \
|
||||
SYS_EXTPWRITEV = 290 // { ssize_t extpwritev(int fd, struct iovec *iovp,\
|
||||
SYS_FHSTATFS = 297 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }
|
||||
SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); }
|
||||
SYS_MODNEXT = 300 // { int modnext(int modid); }
|
||||
SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat* stat); }
|
||||
SYS_MODFNEXT = 302 // { int modfnext(int modid); }
|
||||
SYS_MODFIND = 303 // { int modfind(const char *name); }
|
||||
SYS_KLDLOAD = 304 // { int kldload(const char *file); }
|
||||
SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); }
|
||||
SYS_KLDFIND = 306 // { int kldfind(const char *file); }
|
||||
SYS_KLDNEXT = 307 // { int kldnext(int fileid); }
|
||||
SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); }
|
||||
SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); }
|
||||
SYS_GETSID = 310 // { int getsid(pid_t pid); }
|
||||
SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); }
|
||||
SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }
|
||||
SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); }
|
||||
SYS_AIO_SUSPEND = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }
|
||||
SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); }
|
||||
SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); }
|
||||
SYS_AIO_READ = 318 // { int aio_read(struct aiocb *aiocbp); }
|
||||
SYS_AIO_WRITE = 319 // { int aio_write(struct aiocb *aiocbp); }
|
||||
SYS_LIO_LISTIO = 320 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); }
|
||||
SYS_YIELD = 321 // { int yield(void); }
|
||||
SYS_MLOCKALL = 324 // { int mlockall(int how); }
|
||||
SYS_MUNLOCKALL = 325 // { int munlockall(void); }
|
||||
SYS___GETCWD = 326 // { int __getcwd(u_char *buf, u_int buflen); }
|
||||
SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); }
|
||||
SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); }
|
||||
SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }
|
||||
SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); }
|
||||
SYS_SCHED_YIELD = 331 // { int sched_yield (void); }
|
||||
SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); }
|
||||
SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); }
|
||||
SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }
|
||||
SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); }
|
||||
SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); }
|
||||
SYS_JAIL = 338 // { int jail(struct jail *jail); }
|
||||
SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, \
|
||||
SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); }
|
||||
SYS_SIGACTION = 342 // { int sigaction(int sig, const struct sigaction *act, \
|
||||
SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); }
|
||||
SYS_SIGRETURN = 344 // { int sigreturn(ucontext_t *sigcntxp); }
|
||||
SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set,\
|
||||
SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set,\
|
||||
SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \
|
||||
SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \
|
||||
SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, \
|
||||
SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, \
|
||||
SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \
|
||||
SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); }
|
||||
SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \
|
||||
SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, \
|
||||
SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \
|
||||
SYS_EXTATTR_SET_FILE = 356 // { int extattr_set_file(const char *path, \
|
||||
SYS_EXTATTR_GET_FILE = 357 // { int extattr_get_file(const char *path, \
|
||||
SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \
|
||||
SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); }
|
||||
SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }
|
||||
SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }
|
||||
SYS_KQUEUE = 362 // { int kqueue(void); }
|
||||
SYS_KEVENT = 363 // { int kevent(int fd, \
|
||||
SYS_SCTP_PEELOFF = 364 // { int sctp_peeloff(int sd, caddr_t name ); }
|
||||
SYS_LCHFLAGS = 391 // { int lchflags(char *path, int flags); }
|
||||
SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); }
|
||||
SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, \
|
||||
SYS_VARSYM_SET = 450 // { int varsym_set(int level, const char *name, const char *data); }
|
||||
SYS_VARSYM_GET = 451 // { int varsym_get(int mask, const char *wild, char *buf, int bufsize); }
|
||||
SYS_VARSYM_LIST = 452 // { int varsym_list(int level, char *buf, int maxsize, int *marker); }
|
||||
SYS_EXEC_SYS_REGISTER = 465 // { int exec_sys_register(void *entry); }
|
||||
SYS_EXEC_SYS_UNREGISTER = 466 // { int exec_sys_unregister(int id); }
|
||||
SYS_SYS_CHECKPOINT = 467 // { int sys_checkpoint(int type, int fd, pid_t pid, int retval); }
|
||||
SYS_MOUNTCTL = 468 // { int mountctl(const char *path, int op, int fd, const void *ctl, int ctllen, void *buf, int buflen); }
|
||||
SYS_UMTX_SLEEP = 469 // { int umtx_sleep(volatile const int *ptr, int value, int timeout); }
|
||||
SYS_UMTX_WAKEUP = 470 // { int umtx_wakeup(volatile const int *ptr, int count); }
|
||||
SYS_JAIL_ATTACH = 471 // { int jail_attach(int jid); }
|
||||
SYS_SET_TLS_AREA = 472 // { int set_tls_area(int which, struct tls_info *info, size_t infosize); }
|
||||
SYS_GET_TLS_AREA = 473 // { int get_tls_area(int which, struct tls_info *info, size_t infosize); }
|
||||
SYS_CLOSEFROM = 474 // { int closefrom(int fd); }
|
||||
SYS_STAT = 475 // { int stat(const char *path, struct stat *ub); }
|
||||
SYS_FSTAT = 476 // { int fstat(int fd, struct stat *sb); }
|
||||
SYS_LSTAT = 477 // { int lstat(const char *path, struct stat *ub); }
|
||||
SYS_FHSTAT = 478 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); }
|
||||
SYS_GETDIRENTRIES = 479 // { int getdirentries(int fd, char *buf, u_int count, \
|
||||
SYS_GETDENTS = 480 // { int getdents(int fd, char *buf, size_t count); }
|
||||
SYS_USCHED_SET = 481 // { int usched_set(pid_t pid, int cmd, void *data, \
|
||||
SYS_EXTACCEPT = 482 // { int extaccept(int s, int flags, caddr_t name, int *anamelen); }
|
||||
SYS_EXTCONNECT = 483 // { int extconnect(int s, int flags, caddr_t name, int namelen); }
|
||||
SYS_MCONTROL = 485 // { int mcontrol(void *addr, size_t len, int behav, off_t value); }
|
||||
SYS_VMSPACE_CREATE = 486 // { int vmspace_create(void *id, int type, void *data); }
|
||||
SYS_VMSPACE_DESTROY = 487 // { int vmspace_destroy(void *id); }
|
||||
SYS_VMSPACE_CTL = 488 // { int vmspace_ctl(void *id, int cmd, \
|
||||
SYS_VMSPACE_MMAP = 489 // { int vmspace_mmap(void *id, void *addr, size_t len, \
|
||||
SYS_VMSPACE_MUNMAP = 490 // { int vmspace_munmap(void *id, void *addr, \
|
||||
SYS_VMSPACE_MCONTROL = 491 // { int vmspace_mcontrol(void *id, void *addr, \
|
||||
SYS_VMSPACE_PREAD = 492 // { ssize_t vmspace_pread(void *id, void *buf, \
|
||||
SYS_VMSPACE_PWRITE = 493 // { ssize_t vmspace_pwrite(void *id, const void *buf, \
|
||||
SYS_EXTEXIT = 494 // { void extexit(int how, int status, void *addr); }
|
||||
SYS_LWP_CREATE = 495 // { int lwp_create(struct lwp_params *params); }
|
||||
SYS_LWP_GETTID = 496 // { lwpid_t lwp_gettid(void); }
|
||||
SYS_LWP_KILL = 497 // { int lwp_kill(pid_t pid, lwpid_t tid, int signum); }
|
||||
SYS_LWP_RTPRIO = 498 // { int lwp_rtprio(int function, pid_t pid, lwpid_t tid, struct rtprio *rtp); }
|
||||
SYS_PSELECT = 499 // { int pselect(int nd, fd_set *in, fd_set *ou, \
|
||||
SYS_STATVFS = 500 // { int statvfs(const char *path, struct statvfs *buf); }
|
||||
SYS_FSTATVFS = 501 // { int fstatvfs(int fd, struct statvfs *buf); }
|
||||
SYS_FHSTATVFS = 502 // { int fhstatvfs(const struct fhandle *u_fhp, struct statvfs *buf); }
|
||||
SYS_GETVFSSTAT = 503 // { int getvfsstat(struct statfs *buf, \
|
||||
SYS_OPENAT = 504 // { int openat(int fd, char *path, int flags, int mode); }
|
||||
SYS_FSTATAT = 505 // { int fstatat(int fd, char *path, \
|
||||
SYS_FCHMODAT = 506 // { int fchmodat(int fd, char *path, int mode, \
|
||||
SYS_FCHOWNAT = 507 // { int fchownat(int fd, char *path, int uid, int gid, \
|
||||
SYS_UNLINKAT = 508 // { int unlinkat(int fd, char *path, int flags); }
|
||||
SYS_FACCESSAT = 509 // { int faccessat(int fd, char *path, int amode, \
|
||||
SYS_MQ_OPEN = 510 // { mqd_t mq_open(const char * name, int oflag, \
|
||||
SYS_MQ_CLOSE = 511 // { int mq_close(mqd_t mqdes); }
|
||||
SYS_MQ_UNLINK = 512 // { int mq_unlink(const char *name); }
|
||||
SYS_MQ_GETATTR = 513 // { int mq_getattr(mqd_t mqdes, \
|
||||
SYS_MQ_SETATTR = 514 // { int mq_setattr(mqd_t mqdes, \
|
||||
SYS_MQ_NOTIFY = 515 // { int mq_notify(mqd_t mqdes, \
|
||||
SYS_MQ_SEND = 516 // { int mq_send(mqd_t mqdes, const char *msg_ptr, \
|
||||
SYS_MQ_RECEIVE = 517 // { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, \
|
||||
SYS_MQ_TIMEDSEND = 518 // { int mq_timedsend(mqd_t mqdes, \
|
||||
SYS_MQ_TIMEDRECEIVE = 519 // { ssize_t mq_timedreceive(mqd_t mqdes, \
|
||||
SYS_IOPRIO_SET = 520 // { int ioprio_set(int which, int who, int prio); }
|
||||
SYS_IOPRIO_GET = 521 // { int ioprio_get(int which, int who); }
|
||||
SYS_CHROOT_KERNEL = 522 // { int chroot_kernel(char *path); }
|
||||
SYS_RENAMEAT = 523 // { int renameat(int oldfd, char *old, int newfd, \
|
||||
SYS_MKDIRAT = 524 // { int mkdirat(int fd, char *path, mode_t mode); }
|
||||
SYS_MKFIFOAT = 525 // { int mkfifoat(int fd, char *path, mode_t mode); }
|
||||
SYS_MKNODAT = 526 // { int mknodat(int fd, char *path, mode_t mode, \
|
||||
SYS_READLINKAT = 527 // { int readlinkat(int fd, char *path, char *buf, \
|
||||
SYS_SYMLINKAT = 528 // { int symlinkat(char *path1, int fd, char *path2); }
|
||||
SYS_SWAPOFF = 529 // { int swapoff(char *name); }
|
||||
SYS_VQUOTACTL = 530 // { int vquotactl(const char *path, \
|
||||
SYS_LINKAT = 531 // { int linkat(int fd1, char *path1, int fd2, \
|
||||
SYS_EACCESS = 532 // { int eaccess(char *path, int flags); }
|
||||
SYS_LPATHCONF = 533 // { int lpathconf(char *path, int name); }
|
||||
SYS_VMM_GUEST_CTL = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); }
|
||||
SYS_VMM_GUEST_SYNC_ADDR = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); }
|
||||
)
|
|
@ -1,435 +0,0 @@
|
|||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs types_dragonfly.go
|
||||
|
||||
package syscall
|
||||
|
||||
const (
|
||||
sizeofPtr = 0x4
|
||||
sizeofShort = 0x2
|
||||
sizeofInt = 0x4
|
||||
sizeofLong = 0x4
|
||||
sizeofLongLong = 0x8
|
||||
)
|
||||
|
||||
type (
|
||||
_C_short int16
|
||||
_C_int int32
|
||||
_C_long int32
|
||||
_C_long_long int64
|
||||
)
|
||||
|
||||
type Timespec struct {
|
||||
Sec int32
|
||||
Nsec int32
|
||||
}
|
||||
|
||||
type Timeval struct {
|
||||
Sec int32
|
||||
Usec int32
|
||||
}
|
||||
|
||||
type Rusage struct {
|
||||
Utime Timeval
|
||||
Stime Timeval
|
||||
Maxrss int32
|
||||
Ixrss int32
|
||||
Idrss int32
|
||||
Isrss int32
|
||||
Minflt int32
|
||||
Majflt int32
|
||||
Nswap int32
|
||||
Inblock int32
|
||||
Oublock int32
|
||||
Msgsnd int32
|
||||
Msgrcv int32
|
||||
Nsignals int32
|
||||
Nvcsw int32
|
||||
Nivcsw int32
|
||||
}
|
||||
|
||||
type Rlimit struct {
|
||||
Cur int64
|
||||
Max int64
|
||||
}
|
||||
|
||||
type _Gid_t uint32
|
||||
|
||||
const (
|
||||
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
|
||||
)
|
||||
|
||||
type Stat_t struct {
|
||||
Ino uint64
|
||||
Nlink uint32
|
||||
Dev uint32
|
||||
Mode uint16
|
||||
Padding1 uint16
|
||||
Uid uint32
|
||||
Gid uint32
|
||||
Rdev uint32
|
||||
Atim Timespec
|
||||
Mtim Timespec
|
||||
Ctim Timespec
|
||||
Size int64
|
||||
Blocks int64
|
||||
Blksize uint32
|
||||
Flags uint32
|
||||
Gen uint32
|
||||
Lspare int32
|
||||
Qspare1 int64
|
||||
Qspare2 int64
|
||||
}
|
||||
|
||||
type Statfs_t struct {
|
||||
Spare2 int32
|
||||
Bsize int32
|
||||
Iosize int32
|
||||
Blocks int32
|
||||
Bfree int32
|
||||
Bavail int32
|
||||
Files int32
|
||||
Ffree int32
|
||||
Fsid Fsid
|
||||
Owner uint32
|
||||
Type int32
|
||||
Flags int32
|
||||
Syncwrites int32
|
||||
Asyncwrites int32
|
||||
Fstypename [16]int8
|
||||
Mntonname [80]int8
|
||||
Syncreads int32
|
||||
Asyncreads int32
|
||||
Spares1 int16
|
||||
Mntfromname [80]int8
|
||||
Spares2 int16
|
||||
Spare [2]int32
|
||||
}
|
||||
|
||||
type Flock_t struct {
|
||||
Start int64
|
||||
Len int64
|
||||
Pid int32
|
||||
Type int16
|
||||
Whence int16
|
||||
}
|
||||
|
||||
type Dirent struct {
|
||||
Fileno uint64
|
||||
Namlen uint16
|
||||
Type uint8
|
||||
Unused1 uint8
|
||||
Unused2 uint32
|
||||
Name [256]int8
|
||||
}
|
||||
|
||||
type Fsid struct {
|
||||
Val [2]int32
|
||||
}
|
||||
|
||||
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 [12]int8
|
||||
Rcf uint16
|
||||
Route [16]uint16
|
||||
}
|
||||
|
||||
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 uint32
|
||||
}
|
||||
|
||||
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
|
||||
Iov *Iovec
|
||||
Iovlen int32
|
||||
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 IPv6MTUInfo struct {
|
||||
Addr RawSockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ICMPv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
||||
|
||||
const (
|
||||
SizeofSockaddrInet4 = 0x10
|
||||
SizeofSockaddrInet6 = 0x1c
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
SizeofLinger = 0x8
|
||||
SizeofIPMreq = 0x8
|
||||
SizeofIPv6Mreq = 0x14
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
SizeofInet6Pktinfo = 0x14
|
||||
SizeofIPv6MTUInfo = 0x20
|
||||
SizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
const (
|
||||
PTRACE_TRACEME = 0x0
|
||||
PTRACE_CONT = 0x7
|
||||
PTRACE_KILL = 0x8
|
||||
)
|
||||
|
||||
type Kevent_t struct {
|
||||
Ident uint32
|
||||
Filter int16
|
||||
Flags uint16
|
||||
Fflags uint32
|
||||
Data int32
|
||||
Udata *byte
|
||||
}
|
||||
|
||||
type FdSet struct {
|
||||
Bits [32]uint32
|
||||
}
|
||||
|
||||
const (
|
||||
SizeofIfMsghdr = 0x68
|
||||
SizeofIfData = 0x58
|
||||
SizeofIfaMsghdr = 0x14
|
||||
SizeofIfmaMsghdr = 0x10
|
||||
SizeofIfAnnounceMsghdr = 0x18
|
||||
SizeofRtMsghdr = 0x5c
|
||||
SizeofRtMetrics = 0x38
|
||||
)
|
||||
|
||||
type IfMsghdr struct {
|
||||
Msglen uint16
|
||||
Version uint8
|
||||
Type uint8
|
||||
Addrs int32
|
||||
Flags int32
|
||||
Index uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
Data IfData
|
||||
}
|
||||
|
||||
type IfData struct {
|
||||
Type uint8
|
||||
Physical uint8
|
||||
Addrlen uint8
|
||||
Hdrlen uint8
|
||||
Recvquota uint8
|
||||
Xmitquota uint8
|
||||
Pad_cgo_0 [2]byte
|
||||
Mtu uint32
|
||||
Metric uint32
|
||||
Link_state uint32
|
||||
Baudrate uint64
|
||||
Ipackets uint32
|
||||
Ierrors uint32
|
||||
Opackets uint32
|
||||
Oerrors uint32
|
||||
Collisions uint32
|
||||
Ibytes uint32
|
||||
Obytes uint32
|
||||
Imcasts uint32
|
||||
Omcasts uint32
|
||||
Iqdrops uint32
|
||||
Noproto uint32
|
||||
Hwassist uint32
|
||||
Unused uint32
|
||||
Lastchange Timeval
|
||||
}
|
||||
|
||||
type IfaMsghdr struct {
|
||||
Msglen uint16
|
||||
Version uint8
|
||||
Type uint8
|
||||
Addrs int32
|
||||
Flags int32
|
||||
Index uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
Metric int32
|
||||
}
|
||||
|
||||
type IfmaMsghdr struct {
|
||||
Msglen uint16
|
||||
Version uint8
|
||||
Type uint8
|
||||
Addrs int32
|
||||
Flags int32
|
||||
Index uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
}
|
||||
|
||||
type IfAnnounceMsghdr struct {
|
||||
Msglen uint16
|
||||
Version uint8
|
||||
Type uint8
|
||||
Index uint16
|
||||
Name [16]int8
|
||||
What uint16
|
||||
}
|
||||
|
||||
type RtMsghdr struct {
|
||||
Msglen uint16
|
||||
Version uint8
|
||||
Type uint8
|
||||
Index uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
Flags int32
|
||||
Addrs int32
|
||||
Pid int32
|
||||
Seq int32
|
||||
Errno int32
|
||||
Use int32
|
||||
Inits uint32
|
||||
Rmx RtMetrics
|
||||
}
|
||||
|
||||
type RtMetrics struct {
|
||||
Locks uint32
|
||||
Mtu uint32
|
||||
Pksent uint32
|
||||
Expire uint32
|
||||
Sendpipe uint32
|
||||
Ssthresh uint32
|
||||
Rtt uint32
|
||||
Rttvar uint32
|
||||
Recvpipe uint32
|
||||
Hopcount uint32
|
||||
Mssopt uint16
|
||||
Pad uint16
|
||||
Msl uint32
|
||||
Iwmaxsegs uint32
|
||||
Iwcapsegs uint32
|
||||
}
|
||||
|
||||
const (
|
||||
SizeofBpfVersion = 0x4
|
||||
SizeofBpfStat = 0x8
|
||||
SizeofBpfProgram = 0x8
|
||||
SizeofBpfInsn = 0x8
|
||||
SizeofBpfHdr = 0x14
|
||||
)
|
||||
|
||||
type BpfVersion struct {
|
||||
Major uint16
|
||||
Minor uint16
|
||||
}
|
||||
|
||||
type BpfStat struct {
|
||||
Recv uint32
|
||||
Drop uint32
|
||||
}
|
||||
|
||||
type BpfProgram struct {
|
||||
Len uint32
|
||||
Insns *BpfInsn
|
||||
}
|
||||
|
||||
type BpfInsn struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
||||
|
||||
type BpfHdr struct {
|
||||
Tstamp Timeval
|
||||
Caplen uint32
|
||||
Datalen uint32
|
||||
Hdrlen uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
}
|
||||
|
||||
type Termios struct {
|
||||
Iflag uint32
|
||||
Oflag uint32
|
||||
Cflag uint32
|
||||
Lflag uint32
|
||||
Cc [20]uint8
|
||||
Ispeed uint32
|
||||
Ospeed uint32
|
||||
}
|
Loading…
Reference in a new issue