Commit dd2abe51 authored by Russ Cox's avatar Russ Cox

runtime, syscall: convert from godefs to cgo

R=golang-dev, mikioh.mikioh, r
CC=golang-dev
https://golang.org/cl/5348052
parent 879a1c6a
This diff is collapsed.
......@@ -8,7 +8,7 @@
#include "signals.h"
void
runtime·dumpregs(Regs *r)
runtime·dumpregs(Regs32 *r)
{
runtime·printf("eax %x\n", r->eax);
runtime·printf("ebx %x\n", r->ebx);
......@@ -37,8 +37,8 @@ void
runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
{
Ucontext *uc;
Mcontext *mc;
Regs *r;
Mcontext32 *mc;
Regs32 *r;
uintptr *sp;
byte *pc;
......@@ -141,8 +141,8 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
if(restart)
sa.sa_flags |= SA_RESTART;
sa.sa_mask = ~0U;
sa.sa_tramp = (uintptr)runtime·sigtramp; // runtime·sigtramp's job is to call into real handler
sa.__sigaction_u.__sa_sigaction = (uintptr)fn;
sa.sa_tramp = (void*)runtime·sigtramp; // runtime·sigtramp's job is to call into real handler
*(uintptr*)&sa.__sigaction_u = (uintptr)fn;
runtime·sigaction(i, &sa, nil);
}
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
#include "signals.h"
void
runtime·dumpregs(Regs *r)
runtime·dumpregs(Regs64 *r)
{
runtime·printf("rax %X\n", r->rax);
runtime·printf("rbx %X\n", r->rbx);
......@@ -45,8 +45,8 @@ void
runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
{
Ucontext *uc;
Mcontext *mc;
Regs *r;
Mcontext64 *mc;
Regs64 *r;
uintptr *sp;
byte *pc;
......@@ -151,8 +151,8 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
if(restart)
sa.sa_flags |= SA_RESTART;
sa.sa_mask = ~0ULL;
sa.sa_tramp = (uintptr)runtime·sigtramp; // runtime·sigtramp's job is to call into real handler
sa.__sigaction_u.__sa_sigaction = (uintptr)fn;
sa.sa_tramp = runtime·sigtramp; // runtime·sigtramp's job is to call into real handler
*(uintptr*)&sa.__sigaction_u = (uintptr)fn;
runtime·sigaction(i, &sa, nil);
}
......
// 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.
*
godefs -f -m64 defs.c >amd64/defs.h
godefs -f -m32 defs.c >386/defs.h
*/
#define __DARWIN_UNIX03 0
#include <mach/mach.h>
#include <mach/message.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <sys/mman.h>
enum {
$PROT_NONE = PROT_NONE,
$PROT_READ = PROT_READ,
$PROT_WRITE = PROT_WRITE,
$PROT_EXEC = PROT_EXEC,
$MAP_ANON = MAP_ANON,
$MAP_PRIVATE = MAP_PRIVATE,
$MAP_FIXED = MAP_FIXED,
$MACH_MSG_TYPE_MOVE_RECEIVE = MACH_MSG_TYPE_MOVE_RECEIVE,
$MACH_MSG_TYPE_MOVE_SEND = MACH_MSG_TYPE_MOVE_SEND,
$MACH_MSG_TYPE_MOVE_SEND_ONCE = MACH_MSG_TYPE_MOVE_SEND_ONCE,
$MACH_MSG_TYPE_COPY_SEND = MACH_MSG_TYPE_COPY_SEND,
$MACH_MSG_TYPE_MAKE_SEND = MACH_MSG_TYPE_MAKE_SEND,
$MACH_MSG_TYPE_MAKE_SEND_ONCE = MACH_MSG_TYPE_MAKE_SEND_ONCE,
$MACH_MSG_TYPE_COPY_RECEIVE = MACH_MSG_TYPE_COPY_RECEIVE,
$MACH_MSG_PORT_DESCRIPTOR = MACH_MSG_PORT_DESCRIPTOR,
$MACH_MSG_OOL_DESCRIPTOR = MACH_MSG_OOL_DESCRIPTOR,
$MACH_MSG_OOL_PORTS_DESCRIPTOR = MACH_MSG_OOL_PORTS_DESCRIPTOR,
$MACH_MSG_OOL_VOLATILE_DESCRIPTOR = MACH_MSG_OOL_VOLATILE_DESCRIPTOR,
$MACH_MSGH_BITS_COMPLEX = MACH_MSGH_BITS_COMPLEX,
$MACH_SEND_MSG = MACH_SEND_MSG,
$MACH_RCV_MSG = MACH_RCV_MSG,
$MACH_RCV_LARGE = MACH_RCV_LARGE,
$MACH_SEND_TIMEOUT = MACH_SEND_TIMEOUT,
$MACH_SEND_INTERRUPT = MACH_SEND_INTERRUPT,
$MACH_SEND_CANCEL = MACH_SEND_CANCEL,
$MACH_SEND_ALWAYS = MACH_SEND_ALWAYS,
$MACH_SEND_TRAILER = MACH_SEND_TRAILER,
$MACH_RCV_TIMEOUT = MACH_RCV_TIMEOUT,
$MACH_RCV_NOTIFY = MACH_RCV_NOTIFY,
$MACH_RCV_INTERRUPT = MACH_RCV_INTERRUPT,
$MACH_RCV_OVERWRITE = MACH_RCV_OVERWRITE,
$NDR_PROTOCOL_2_0 = NDR_PROTOCOL_2_0,
$NDR_INT_BIG_ENDIAN = NDR_INT_BIG_ENDIAN,
$NDR_INT_LITTLE_ENDIAN = NDR_INT_LITTLE_ENDIAN,
$NDR_FLOAT_IEEE = NDR_FLOAT_IEEE,
$NDR_CHAR_ASCII = NDR_CHAR_ASCII,
$SA_SIGINFO = SA_SIGINFO,
$SA_RESTART = SA_RESTART,
$SA_ONSTACK = SA_ONSTACK,
$SA_USERTRAMP = SA_USERTRAMP,
$SA_64REGSET = SA_64REGSET,
$SIGHUP = SIGHUP,
$SIGINT = SIGINT,
$SIGQUIT = SIGQUIT,
$SIGILL = SIGILL,
$SIGTRAP = SIGTRAP,
$SIGABRT = SIGABRT,
$SIGEMT = SIGEMT,
$SIGFPE = SIGFPE,
$SIGKILL = SIGKILL,
$SIGBUS = SIGBUS,
$SIGSEGV = SIGSEGV,
$SIGSYS = SIGSYS,
$SIGPIPE = SIGPIPE,
$SIGALRM = SIGALRM,
$SIGTERM = SIGTERM,
$SIGURG = SIGURG,
$SIGSTOP = SIGSTOP,
$SIGTSTP = SIGTSTP,
$SIGCONT = SIGCONT,
$SIGCHLD = SIGCHLD,
$SIGTTIN = SIGTTIN,
$SIGTTOU = SIGTTOU,
$SIGIO = SIGIO,
$SIGXCPU = SIGXCPU,
$SIGXFSZ = SIGXFSZ,
$SIGVTALRM = SIGVTALRM,
$SIGPROF = SIGPROF,
$SIGWINCH = SIGWINCH,
$SIGINFO = SIGINFO,
$SIGUSR1 = SIGUSR1,
$SIGUSR2 = SIGUSR2,
$FPE_INTDIV = FPE_INTDIV,
$FPE_INTOVF = FPE_INTOVF,
$FPE_FLTDIV = FPE_FLTDIV,
$FPE_FLTOVF = FPE_FLTOVF,
$FPE_FLTUND = FPE_FLTUND,
$FPE_FLTRES = FPE_FLTRES,
$FPE_FLTINV = FPE_FLTINV,
$FPE_FLTSUB = FPE_FLTSUB,
$BUS_ADRALN = BUS_ADRALN,
$BUS_ADRERR = BUS_ADRERR,
$BUS_OBJERR = BUS_OBJERR,
$SEGV_MAPERR = SEGV_MAPERR,
$SEGV_ACCERR = SEGV_ACCERR,
$ITIMER_REAL = ITIMER_REAL,
$ITIMER_VIRTUAL = ITIMER_VIRTUAL,
$ITIMER_PROF = ITIMER_PROF,
};
typedef mach_msg_body_t $MachBody;
typedef mach_msg_header_t $MachHeader;
typedef NDR_record_t $MachNDR;
typedef mach_msg_port_descriptor_t $MachPort;
typedef stack_t $StackT;
typedef union __sigaction_u $Sighandler;
typedef struct __sigaction $Sigaction; // used in syscalls
// typedef struct sigaction $Sigaction; // used by the C library
typedef union sigval $Sigval;
typedef siginfo_t $Siginfo;
typedef struct timeval $Timeval;
typedef struct itimerval $Itimerval;
typedef struct fp_control $FPControl;
typedef struct fp_status $FPStatus;
typedef struct mmst_reg $RegMMST;
typedef struct xmm_reg $RegXMM;
#ifdef __LP64__
// amd64
typedef x86_thread_state64_t $Regs;
typedef x86_float_state64_t $FloatState;
typedef x86_exception_state64_t $ExceptionState;
typedef struct mcontext64 $Mcontext;
#else
// 386
typedef x86_thread_state32_t $Regs;
typedef x86_float_state32_t $FloatState;
typedef x86_exception_state32_t $ExceptionState;
typedef struct mcontext32 $Mcontext;
#endif
typedef ucontext_t $Ucontext;
// 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 cgo.
GOARCH=amd64 cgo -cdefs defs.go >amd64/defs.h
GOARCH=386 cgo -cdefs defs.go >386/defs.h
*/
package runtime
/*
#define __DARWIN_UNIX03 0
#include <mach/mach.h>
#include <mach/message.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <sys/mman.h>
*/
import "C"
const (
PROT_NONE = C.PROT_NONE
PROT_READ = C.PROT_READ
PROT_WRITE = C.PROT_WRITE
PROT_EXEC = C.PROT_EXEC
MAP_ANON = C.MAP_ANON
MAP_PRIVATE = C.MAP_PRIVATE
MAP_FIXED = C.MAP_FIXED
MACH_MSG_TYPE_MOVE_RECEIVE = C.MACH_MSG_TYPE_MOVE_RECEIVE
MACH_MSG_TYPE_MOVE_SEND = C.MACH_MSG_TYPE_MOVE_SEND
MACH_MSG_TYPE_MOVE_SEND_ONCE = C.MACH_MSG_TYPE_MOVE_SEND_ONCE
MACH_MSG_TYPE_COPY_SEND = C.MACH_MSG_TYPE_COPY_SEND
MACH_MSG_TYPE_MAKE_SEND = C.MACH_MSG_TYPE_MAKE_SEND
MACH_MSG_TYPE_MAKE_SEND_ONCE = C.MACH_MSG_TYPE_MAKE_SEND_ONCE
MACH_MSG_TYPE_COPY_RECEIVE = C.MACH_MSG_TYPE_COPY_RECEIVE
MACH_MSG_PORT_DESCRIPTOR = C.MACH_MSG_PORT_DESCRIPTOR
MACH_MSG_OOL_DESCRIPTOR = C.MACH_MSG_OOL_DESCRIPTOR
MACH_MSG_OOL_PORTS_DESCRIPTOR = C.MACH_MSG_OOL_PORTS_DESCRIPTOR
MACH_MSG_OOL_VOLATILE_DESCRIPTOR = C.MACH_MSG_OOL_VOLATILE_DESCRIPTOR
MACH_MSGH_BITS_COMPLEX = C.MACH_MSGH_BITS_COMPLEX
MACH_SEND_MSG = C.MACH_SEND_MSG
MACH_RCV_MSG = C.MACH_RCV_MSG
MACH_RCV_LARGE = C.MACH_RCV_LARGE
MACH_SEND_TIMEOUT = C.MACH_SEND_TIMEOUT
MACH_SEND_INTERRUPT = C.MACH_SEND_INTERRUPT
MACH_SEND_CANCEL = C.MACH_SEND_CANCEL
MACH_SEND_ALWAYS = C.MACH_SEND_ALWAYS
MACH_SEND_TRAILER = C.MACH_SEND_TRAILER
MACH_RCV_TIMEOUT = C.MACH_RCV_TIMEOUT
MACH_RCV_NOTIFY = C.MACH_RCV_NOTIFY
MACH_RCV_INTERRUPT = C.MACH_RCV_INTERRUPT
MACH_RCV_OVERWRITE = C.MACH_RCV_OVERWRITE
NDR_PROTOCOL_2_0 = C.NDR_PROTOCOL_2_0
NDR_INT_BIG_ENDIAN = C.NDR_INT_BIG_ENDIAN
NDR_INT_LITTLE_ENDIAN = C.NDR_INT_LITTLE_ENDIAN
NDR_FLOAT_IEEE = C.NDR_FLOAT_IEEE
NDR_CHAR_ASCII = C.NDR_CHAR_ASCII
SA_SIGINFO = C.SA_SIGINFO
SA_RESTART = C.SA_RESTART
SA_ONSTACK = C.SA_ONSTACK
SA_USERTRAMP = C.SA_USERTRAMP
SA_64REGSET = C.SA_64REGSET
SIGHUP = C.SIGHUP
SIGINT = C.SIGINT
SIGQUIT = C.SIGQUIT
SIGILL = C.SIGILL
SIGTRAP = C.SIGTRAP
SIGABRT = C.SIGABRT
SIGEMT = C.SIGEMT
SIGFPE = C.SIGFPE
SIGKILL = C.SIGKILL
SIGBUS = C.SIGBUS
SIGSEGV = C.SIGSEGV
SIGSYS = C.SIGSYS
SIGPIPE = C.SIGPIPE
SIGALRM = C.SIGALRM
SIGTERM = C.SIGTERM
SIGURG = C.SIGURG
SIGSTOP = C.SIGSTOP
SIGTSTP = C.SIGTSTP
SIGCONT = C.SIGCONT
SIGCHLD = C.SIGCHLD
SIGTTIN = C.SIGTTIN
SIGTTOU = C.SIGTTOU
SIGIO = C.SIGIO
SIGXCPU = C.SIGXCPU
SIGXFSZ = C.SIGXFSZ
SIGVTALRM = C.SIGVTALRM
SIGPROF = C.SIGPROF
SIGWINCH = C.SIGWINCH
SIGINFO = C.SIGINFO
SIGUSR1 = C.SIGUSR1
SIGUSR2 = C.SIGUSR2
FPE_INTDIV = C.FPE_INTDIV
FPE_INTOVF = C.FPE_INTOVF
FPE_FLTDIV = C.FPE_FLTDIV
FPE_FLTOVF = C.FPE_FLTOVF
FPE_FLTUND = C.FPE_FLTUND
FPE_FLTRES = C.FPE_FLTRES
FPE_FLTINV = C.FPE_FLTINV
FPE_FLTSUB = C.FPE_FLTSUB
BUS_ADRALN = C.BUS_ADRALN
BUS_ADRERR = C.BUS_ADRERR
BUS_OBJERR = C.BUS_OBJERR
SEGV_MAPERR = C.SEGV_MAPERR
SEGV_ACCERR = C.SEGV_ACCERR
ITIMER_REAL = C.ITIMER_REAL
ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
ITIMER_PROF = C.ITIMER_PROF
)
type MachBody C.mach_msg_body_t
type MachHeader C.mach_msg_header_t
type MachNDR C.NDR_record_t
type MachPort C.mach_msg_port_descriptor_t
type StackT C.struct_sigaltstack
type Sighandler C.union___sigaction_u
type Sigaction C.struct___sigaction // used in syscalls
// type Sigaction C.struct_sigaction // used by the C library
type Sigval C.union_sigval
type Siginfo C.siginfo_t
type Timeval C.struct_timeval
type Itimerval C.struct_itimerval
type FPControl C.struct_fp_control
type FPStatus C.struct_fp_status
type RegMMST C.struct_mmst_reg
type RegXMM C.struct_xmm_reg
type Regs64 C.struct_x86_thread_state64
type FloatState64 C.struct_x86_float_state64
type ExceptionState64 C.struct_x86_exception_state64
type Mcontext64 C.struct_mcontext64
type Regs32 C.struct_i386_thread_state
type FloatState32 C.struct_i386_float_state
type ExceptionState32 C.struct_i386_exception_state
type Mcontext32 C.struct_mcontext32
type Ucontext C.struct_ucontext
// 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.
*
godefs -f -m64 defs.c >amd64/defs.h
godefs -f -m32 defs.c >386/defs.h
*/
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/ucontext.h>
#include <sys/umtx.h>
#include <sys/rtprio.h>
#include <sys/thr.h>
#include <sys/_sigset.h>
#include <sys/unistd.h>
enum {
$PROT_NONE = PROT_NONE,
$PROT_READ = PROT_READ,
$PROT_WRITE = PROT_WRITE,
$PROT_EXEC = PROT_EXEC,
$MAP_ANON = MAP_ANON,
$MAP_PRIVATE = MAP_PRIVATE,
$MAP_FIXED = MAP_FIXED,
$SA_SIGINFO = SA_SIGINFO,
$SA_RESTART = SA_RESTART,
$SA_ONSTACK = SA_ONSTACK,
$UMTX_OP_WAIT = UMTX_OP_WAIT,
$UMTX_OP_WAKE = UMTX_OP_WAKE,
$EINTR = EINTR,
$SIGHUP = SIGHUP,
$SIGINT = SIGINT,
$SIGQUIT = SIGQUIT,
$SIGILL = SIGILL,
$SIGTRAP = SIGTRAP,
$SIGABRT = SIGABRT,
$SIGEMT = SIGEMT,
$SIGFPE = SIGFPE,
$SIGKILL = SIGKILL,
$SIGBUS = SIGBUS,
$SIGSEGV = SIGSEGV,
$SIGSYS = SIGSYS,
$SIGPIPE = SIGPIPE,
$SIGALRM = SIGALRM,
$SIGTERM = SIGTERM,
$SIGURG = SIGURG,
$SIGSTOP = SIGSTOP,
$SIGTSTP = SIGTSTP,
$SIGCONT = SIGCONT,
$SIGCHLD = SIGCHLD,
$SIGTTIN = SIGTTIN,
$SIGTTOU = SIGTTOU,
$SIGIO = SIGIO,
$SIGXCPU = SIGXCPU,
$SIGXFSZ = SIGXFSZ,
$SIGVTALRM = SIGVTALRM,
$SIGPROF = SIGPROF,
$SIGWINCH = SIGWINCH,
$SIGINFO = SIGINFO,
$SIGUSR1 = SIGUSR1,
$SIGUSR2 = SIGUSR2,
$FPE_INTDIV = FPE_INTDIV,
$FPE_INTOVF = FPE_INTOVF,
$FPE_FLTDIV = FPE_FLTDIV,
$FPE_FLTOVF = FPE_FLTOVF,
$FPE_FLTUND = FPE_FLTUND,
$FPE_FLTRES = FPE_FLTRES,
$FPE_FLTINV = FPE_FLTINV,
$FPE_FLTSUB = FPE_FLTSUB,
$BUS_ADRALN = BUS_ADRALN,
$BUS_ADRERR = BUS_ADRERR,
$BUS_OBJERR = BUS_OBJERR,
$SEGV_MAPERR = SEGV_MAPERR,
$SEGV_ACCERR = SEGV_ACCERR,
$ITIMER_REAL = ITIMER_REAL,
$ITIMER_VIRTUAL = ITIMER_VIRTUAL,
$ITIMER_PROF = ITIMER_PROF,
};
typedef struct rtprio $Rtprio;
typedef struct thr_param $ThrParam;
typedef struct sigaltstack $Sigaltstack;
typedef struct __sigset $Sigset;
typedef union sigval $Sigval;
typedef stack_t $StackT;
typedef siginfo_t $Siginfo;
typedef mcontext_t $Mcontext;
typedef ucontext_t $Ucontext;
typedef struct timespec $Timespec;
typedef struct timeval $Timeval;
typedef struct itimerval $Itimerval;
// 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 cgo.
GOARCH=amd64 cgo -cdefs defs.go >amd64/defs.h
GOARCH=386 cgo -cdefs defs.go >386/defs.h
*/
package runtime
/*
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/ucontext.h>
#include <sys/umtx.h>
#include <sys/rtprio.h>
#include <sys/thr.h>
#include <sys/_sigset.h>
#include <sys/unistd.h>
*/
import "C"
const (
PROT_NONE = C.PROT_NONE
PROT_READ = C.PROT_READ
PROT_WRITE = C.PROT_WRITE
PROT_EXEC = C.PROT_EXEC
MAP_ANON = C.MAP_ANON
MAP_PRIVATE = C.MAP_PRIVATE
MAP_FIXED = C.MAP_FIXED
SA_SIGINFO = C.SA_SIGINFO
SA_RESTART = C.SA_RESTART
SA_ONSTACK = C.SA_ONSTACK
UMTX_OP_WAIT = C.UMTX_OP_WAIT
UMTX_OP_WAKE = C.UMTX_OP_WAKE
EINTR = C.EINTR
SIGHUP = C.SIGHUP
SIGINT = C.SIGINT
SIGQUIT = C.SIGQUIT
SIGILL = C.SIGILL
SIGTRAP = C.SIGTRAP
SIGABRT = C.SIGABRT
SIGEMT = C.SIGEMT
SIGFPE = C.SIGFPE
SIGKILL = C.SIGKILL
SIGBUS = C.SIGBUS
SIGSEGV = C.SIGSEGV
SIGSYS = C.SIGSYS
SIGPIPE = C.SIGPIPE
SIGALRM = C.SIGALRM
SIGTERM = C.SIGTERM
SIGURG = C.SIGURG
SIGSTOP = C.SIGSTOP
SIGTSTP = C.SIGTSTP
SIGCONT = C.SIGCONT
SIGCHLD = C.SIGCHLD
SIGTTIN = C.SIGTTIN
SIGTTOU = C.SIGTTOU
SIGIO = C.SIGIO
SIGXCPU = C.SIGXCPU
SIGXFSZ = C.SIGXFSZ
SIGVTALRM = C.SIGVTALRM
SIGPROF = C.SIGPROF
SIGWINCH = C.SIGWINCH
SIGINFO = C.SIGINFO
SIGUSR1 = C.SIGUSR1
SIGUSR2 = C.SIGUSR2
FPE_INTDIV = C.FPE_INTDIV
FPE_INTOVF = C.FPE_INTOVF
FPE_FLTDIV = C.FPE_FLTDIV
FPE_FLTOVF = C.FPE_FLTOVF
FPE_FLTUND = C.FPE_FLTUND
FPE_FLTRES = C.FPE_FLTRES
FPE_FLTINV = C.FPE_FLTINV
FPE_FLTSUB = C.FPE_FLTSUB
BUS_ADRALN = C.BUS_ADRALN
BUS_ADRERR = C.BUS_ADRERR
BUS_OBJERR = C.BUS_OBJERR
SEGV_MAPERR = C.SEGV_MAPERR
SEGV_ACCERR = C.SEGV_ACCERR
ITIMER_REAL = C.ITIMER_REAL
ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
ITIMER_PROF = C.ITIMER_PROF
)
type Rtprio C.struct_rtprio
type ThrParam C.struct_thr_param
type Sigaltstack C.struct_sigaltstack
type Sigset C.struct___sigset
type Sigval C.union_sigval
type StackT C.stack_t
type Siginfo C.siginfo_t
type Mcontext C.mcontext_t
type Ucontext C.ucontext_t
type Timespec C.struct_timespec
type Timeval C.struct_timeval
type Itimerval C.struct_itimerval
// godefs -f -m32 -f -I/home/rsc/pub/linux-2.6/arch/x86/include -f -I/home/rsc/pub/linux-2.6/include -f -D_LOOSE_KERNEL_NAMES -f -D__ARCH_SI_UID_T=__kernel_uid32_t defs2.c
// Created by cgo -cdefs - DO NOT EDIT
// cgo -cdefs defs2.go
// MACHINE GENERATED - DO NOT EDIT.
// Constants
enum {
PROT_NONE = 0,
PROT_READ = 0x1,
PROT_WRITE = 0x2,
PROT_EXEC = 0x4,
MAP_ANON = 0x20,
MAP_PRIVATE = 0x2,
MAP_FIXED = 0x10,
SA_RESTART = 0x10000000,
SA_ONSTACK = 0x8000000,
SA_RESTORER = 0x4000000,
SA_SIGINFO = 0x4,
SIGHUP = 0x1,
SIGINT = 0x2,
SIGQUIT = 0x3,
SIGILL = 0x4,
SIGTRAP = 0x5,
SIGABRT = 0x6,
SIGBUS = 0x7,
SIGFPE = 0x8,
SIGKILL = 0x9,
SIGUSR1 = 0xa,
SIGSEGV = 0xb,
SIGUSR2 = 0xc,
SIGPIPE = 0xd,
SIGALRM = 0xe,
SIGSTKFLT = 0x10,
SIGCHLD = 0x11,
SIGCONT = 0x12,
SIGSTOP = 0x13,
SIGTSTP = 0x14,
SIGTTIN = 0x15,
SIGTTOU = 0x16,
SIGURG = 0x17,
SIGXCPU = 0x18,
SIGXFSZ = 0x19,
SIGVTALRM = 0x1a,
SIGPROF = 0x1b,
SIGWINCH = 0x1c,
SIGIO = 0x1d,
SIGPWR = 0x1e,
SIGSYS = 0x1f,
FPE_INTDIV = 0x1,
FPE_INTOVF = 0x2,
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 = 0,
ITIMER_VIRTUAL = 0x1,
ITIMER_PROF = 0x2,
O_RDONLY = 0,
O_CLOEXEC = 02000000,
PROT_NONE = 0x0,
PROT_READ = 0x1,
PROT_WRITE = 0x2,
PROT_EXEC = 0x4,
MAP_ANON = 0x20,
MAP_PRIVATE = 0x2,
MAP_FIXED = 0x10,
SA_RESTART = 0x10000000,
SA_ONSTACK = 0x8000000,
SA_RESTORER = 0x4000000,
SA_SIGINFO = 0x4,
SIGHUP = 0x1,
SIGINT = 0x2,
SIGQUIT = 0x3,
SIGILL = 0x4,
SIGTRAP = 0x5,
SIGABRT = 0x6,
SIGBUS = 0x7,
SIGFPE = 0x8,
SIGKILL = 0x9,
SIGUSR1 = 0xa,
SIGSEGV = 0xb,
SIGUSR2 = 0xc,
SIGPIPE = 0xd,
SIGALRM = 0xe,
SIGSTKFLT = 0x10,
SIGCHLD = 0x11,
SIGCONT = 0x12,
SIGSTOP = 0x13,
SIGTSTP = 0x14,
SIGTTIN = 0x15,
SIGTTOU = 0x16,
SIGURG = 0x17,
SIGXCPU = 0x18,
SIGXFSZ = 0x19,
SIGVTALRM = 0x1a,
SIGPROF = 0x1b,
SIGWINCH = 0x1c,
SIGIO = 0x1d,
SIGPWR = 0x1e,
SIGSYS = 0x1f,
FPE_INTDIV = 0x1,
FPE_INTOVF = 0x2,
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,
O_RDONLY = 0x0,
O_CLOEXEC = 0x80000,
};
// Types
typedef struct Fpreg Fpreg;
typedef struct Fpxreg Fpxreg;
typedef struct Xmmreg Xmmreg;
typedef struct Fpstate Fpstate;
typedef struct Timespec Timespec;
typedef struct Timeval Timeval;
typedef struct Sigaction Sigaction;
typedef struct Siginfo Siginfo;
typedef struct Sigaltstack Sigaltstack;
typedef struct Sigcontext Sigcontext;
typedef struct Ucontext Ucontext;
typedef struct Itimerval Itimerval;
#pragma pack on
typedef struct Fpreg Fpreg;
struct Fpreg {
uint16 significand[4];
uint16 exponent;
uint16 significand[4];
uint16 exponent;
};
typedef struct Fpxreg Fpxreg;
struct Fpxreg {
uint16 significand[4];
uint16 exponent;
uint16 padding[3];
uint16 significand[4];
uint16 exponent;
uint16 padding[3];
};
typedef struct Xmmreg Xmmreg;
struct Xmmreg {
uint32 element[4];
uint32 element[4];
};
typedef struct Fpstate Fpstate;
struct Fpstate {
uint32 cw;
uint32 sw;
uint32 tag;
uint32 ipoff;
uint32 cssel;
uint32 dataoff;
uint32 datasel;
Fpreg _st[8];
uint16 status;
uint16 magic;
uint32 _fxsr_env[6];
uint32 mxcsr;
uint32 reserved;
Fpxreg _fxsr_st[8];
Xmmreg _xmm[8];
uint32 padding1[44];
byte Pad_godefs_0[48];
uint32 cw;
uint32 sw;
uint32 tag;
uint32 ipoff;
uint32 cssel;
uint32 dataoff;
uint32 datasel;
Fpreg _st[8];
uint16 status;
uint16 magic;
uint32 _fxsr_env[6];
uint32 mxcsr;
uint32 reserved;
Fpxreg _fxsr_st[8];
Xmmreg _xmm[8];
uint32 padding1[44];
byte anon0[48];
};
typedef struct Timespec Timespec;
struct Timespec {
int32 tv_sec;
int32 tv_nsec;
int32 tv_sec;
int32 tv_nsec;
};
typedef struct Timeval Timeval;
struct Timeval {
int32 tv_sec;
int32 tv_usec;
int32 tv_sec;
int32 tv_usec;
};
typedef struct Sigaction Sigaction;
struct Sigaction {
void *k_sa_handler;
uint32 sa_flags;
void *sa_restorer;
uint32 sa_mask;
void *k_sa_handler;
uint32 sa_flags;
void *sa_restorer;
uint32 sa_mask;
};
typedef struct Siginfo Siginfo;
struct Siginfo {
int32 si_signo;
int32 si_errno;
int32 si_code;
byte _sifields[116];
int32 si_signo;
int32 si_errno;
int32 si_code;
byte _sifields[116];
};
typedef struct Sigaltstack Sigaltstack;
struct Sigaltstack {
void *ss_sp;
int32 ss_flags;
uint32 ss_size;
byte *ss_sp;
int32 ss_flags;
uint32 ss_size;
};
typedef struct Sigcontext Sigcontext;
struct Sigcontext {
uint16 gs;
uint16 __gsh;
uint16 fs;
uint16 __fsh;
uint16 es;
uint16 __esh;
uint16 ds;
uint16 __dsh;
uint32 edi;
uint32 esi;
uint32 ebp;
uint32 esp;
uint32 ebx;
uint32 edx;
uint32 ecx;
uint32 eax;
uint32 trapno;
uint32 err;
uint32 eip;
uint16 cs;
uint16 __csh;
uint32 eflags;
uint32 esp_at_signal;
uint16 ss;
uint16 __ssh;
Fpstate *fpstate;
uint32 oldmask;
uint32 cr2;
uint16 gs;
uint16 __gsh;
uint16 fs;
uint16 __fsh;
uint16 es;
uint16 __esh;
uint16 ds;
uint16 __dsh;
uint32 edi;
uint32 esi;
uint32 ebp;
uint32 esp;
uint32 ebx;
uint32 edx;
uint32 ecx;
uint32 eax;
uint32 trapno;
uint32 err;
uint32 eip;
uint16 cs;
uint16 __csh;
uint32 eflags;
uint32 esp_at_signal;
uint16 ss;
uint16 __ssh;
Fpstate *fpstate;
uint32 oldmask;
uint32 cr2;
};
typedef struct Ucontext Ucontext;
struct Ucontext {
uint32 uc_flags;
Ucontext *uc_link;
Sigaltstack uc_stack;
Sigcontext uc_mcontext;
uint32 uc_sigmask;
uint32 uc_flags;
Ucontext *uc_link;
Sigaltstack uc_stack;
Sigcontext uc_mcontext;
uint32 uc_sigmask;
};
typedef struct Itimerval Itimerval;
struct Itimerval {
Timeval it_interval;
Timeval it_value;
Timeval it_interval;
Timeval it_value;
};
#pragma pack off
// godefs -f -m64 defs.c
// Created by cgo -cdefs - DO NOT EDIT
// cgo -cdefs defs.go defs1.go
// MACHINE GENERATED - DO NOT EDIT.
// Constants
enum {
PROT_NONE = 0,
PROT_READ = 0x1,
PROT_WRITE = 0x2,
PROT_EXEC = 0x4,
MAP_ANON = 0x20,
MAP_PRIVATE = 0x2,
MAP_FIXED = 0x10,
SA_RESTART = 0x10000000,
SA_ONSTACK = 0x8000000,
SA_RESTORER = 0x4000000,
SA_SIGINFO = 0x4,
SIGHUP = 0x1,
SIGINT = 0x2,
SIGQUIT = 0x3,
SIGILL = 0x4,
SIGTRAP = 0x5,
SIGABRT = 0x6,
SIGBUS = 0x7,
SIGFPE = 0x8,
SIGKILL = 0x9,
SIGUSR1 = 0xa,
SIGSEGV = 0xb,
SIGUSR2 = 0xc,
SIGPIPE = 0xd,
SIGALRM = 0xe,
SIGSTKFLT = 0x10,
SIGCHLD = 0x11,
SIGCONT = 0x12,
SIGSTOP = 0x13,
SIGTSTP = 0x14,
SIGTTIN = 0x15,
SIGTTOU = 0x16,
SIGURG = 0x17,
SIGXCPU = 0x18,
SIGXFSZ = 0x19,
SIGVTALRM = 0x1a,
SIGPROF = 0x1b,
SIGWINCH = 0x1c,
SIGIO = 0x1d,
SIGPWR = 0x1e,
SIGSYS = 0x1f,
FPE_INTDIV = 0x1,
FPE_INTOVF = 0x2,
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 = 0,
ITIMER_VIRTUAL = 0x1,
ITIMER_PROF = 0x2,
O_RDONLY = 0,
O_CLOEXEC = 02000000,
};
// Types
#pragma pack on
PROT_NONE = 0x0,
PROT_READ = 0x1,
PROT_WRITE = 0x2,
PROT_EXEC = 0x4,
MAP_ANON = 0x20,
MAP_PRIVATE = 0x2,
MAP_FIXED = 0x10,
SA_RESTART = 0x10000000,
SA_ONSTACK = 0x8000000,
SA_RESTORER = 0x4000000,
SA_SIGINFO = 0x4,
SIGHUP = 0x1,
SIGINT = 0x2,
SIGQUIT = 0x3,
SIGILL = 0x4,
SIGTRAP = 0x5,
SIGABRT = 0x6,
SIGBUS = 0x7,
SIGFPE = 0x8,
SIGKILL = 0x9,
SIGUSR1 = 0xa,
SIGSEGV = 0xb,
SIGUSR2 = 0xc,
SIGPIPE = 0xd,
SIGALRM = 0xe,
SIGSTKFLT = 0x10,
SIGCHLD = 0x11,
SIGCONT = 0x12,
SIGSTOP = 0x13,
SIGTSTP = 0x14,
SIGTTIN = 0x15,
SIGTTOU = 0x16,
SIGURG = 0x17,
SIGXCPU = 0x18,
SIGXFSZ = 0x19,
SIGVTALRM = 0x1a,
SIGPROF = 0x1b,
SIGWINCH = 0x1c,
SIGIO = 0x1d,
SIGPWR = 0x1e,
SIGSYS = 0x1f,
FPE_INTDIV = 0x1,
FPE_INTOVF = 0x2,
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,
};
typedef struct Timespec Timespec;
typedef struct Timeval Timeval;
typedef struct Sigaction Sigaction;
typedef struct Siginfo Siginfo;
typedef struct Itimerval Itimerval;
#pragma pack on
struct Timespec {
int64 tv_sec;
int64 tv_nsec;
int64 tv_sec;
int64 tv_nsec;
};
typedef struct Timeval Timeval;
struct Timeval {
int64 tv_sec;
int64 tv_usec;
int64 tv_sec;
int64 tv_usec;
};
typedef struct Sigaction Sigaction;
struct Sigaction {
void *sa_handler;
uint64 sa_flags;
void *sa_restorer;
uint64 sa_mask;
void *sa_handler;
uint64 sa_flags;
void *sa_restorer;
uint64 sa_mask;
};
typedef struct Siginfo Siginfo;
struct Siginfo {
int32 si_signo;
int32 si_errno;
int32 si_code;
byte pad_godefs_0[4];
byte _sifields[112];
int32 si_signo;
int32 si_errno;
int32 si_code;
byte Pad_godefs_0[4];
byte _sifields[112];
};
typedef struct Itimerval Itimerval;
struct Itimerval {
Timeval it_interval;
Timeval it_value;
Timeval it_interval;
Timeval it_value;
};
#pragma pack off
// godefs -f -m64 defs1.c
// Created by cgo -cdefs - DO NOT EDIT
// cgo -cdefs defs.go defs1.go
// MACHINE GENERATED - DO NOT EDIT.
// Constants
enum {
O_RDONLY = 0x0,
O_CLOEXEC = 0x80000,
};
typedef struct Usigset Usigset;
typedef struct Fpxreg Fpxreg;
typedef struct Xmmreg Xmmreg;
typedef struct Fpstate Fpstate;
typedef struct Fpxreg1 Fpxreg1;
typedef struct Xmmreg1 Xmmreg1;
typedef struct Fpstate1 Fpstate1;
typedef struct Fpreg1 Fpreg1;
typedef struct Sigaltstack Sigaltstack;
typedef struct Mcontext Mcontext;
typedef struct Ucontext Ucontext;
typedef struct Sigcontext Sigcontext;
// Types
#pragma pack on
typedef struct Usigset Usigset;
struct Usigset {
uint64 __val[16];
uint64 __val[16];
};
typedef struct Fpxreg Fpxreg;
struct Fpxreg {
uint16 significand[4];
uint16 exponent;
uint16 padding[3];
uint16 significand[4];
uint16 exponent;
uint16 padding[3];
};
typedef struct Xmmreg Xmmreg;
struct Xmmreg {
uint32 element[4];
uint32 element[4];
};
typedef struct Fpstate Fpstate;
struct Fpstate {
uint16 cwd;
uint16 swd;
uint16 ftw;
uint16 fop;
uint64 rip;
uint64 rdp;
uint32 mxcsr;
uint32 mxcr_mask;
Fpxreg _st[8];
Xmmreg _xmm[16];
uint32 padding[24];
uint16 cwd;
uint16 swd;
uint16 ftw;
uint16 fop;
uint64 rip;
uint64 rdp;
uint32 mxcsr;
uint32 mxcr_mask;
Fpxreg _st[8];
Xmmreg _xmm[16];
uint32 padding[24];
};
typedef struct Fpxreg1 Fpxreg1;
struct Fpxreg1 {
uint16 significand[4];
uint16 exponent;
uint16 padding[3];
uint16 significand[4];
uint16 exponent;
uint16 padding[3];
};
typedef struct Xmmreg1 Xmmreg1;
struct Xmmreg1 {
uint32 element[4];
uint32 element[4];
};
typedef struct Fpstate1 Fpstate1;
struct Fpstate1 {
uint16 cwd;
uint16 swd;
uint16 ftw;
uint16 fop;
uint64 rip;
uint64 rdp;
uint32 mxcsr;
uint32 mxcr_mask;
Fpxreg1 _st[8];
Xmmreg1 _xmm[16];
uint32 padding[24];
uint16 cwd;
uint16 swd;
uint16 ftw;
uint16 fop;
uint64 rip;
uint64 rdp;
uint32 mxcsr;
uint32 mxcr_mask;
Fpxreg1 _st[8];
Xmmreg1 _xmm[16];
uint32 padding[24];
};
typedef struct Fpreg1 Fpreg1;
struct Fpreg1 {
uint16 significand[4];
uint16 exponent;
uint16 significand[4];
uint16 exponent;
};
typedef struct Sigaltstack Sigaltstack;
struct Sigaltstack {
void *ss_sp;
int32 ss_flags;
byte pad_godefs_0[4];
uint64 ss_size;
byte *ss_sp;
int32 ss_flags;
byte Pad_godefs_0[4];
uint64 ss_size;
};
typedef struct Mcontext Mcontext;
struct Mcontext {
int64 gregs[23];
Fpstate *fpregs;
uint64 __reserved1[8];
int64 gregs[23];
Fpstate *fpregs;
uint64 __reserved1[8];
};
typedef struct Ucontext Ucontext;
struct Ucontext {
uint64 uc_flags;
Ucontext *uc_link;
Sigaltstack uc_stack;
Mcontext uc_mcontext;
Usigset uc_sigmask;
Fpstate __fpregs_mem;
uint64 uc_flags;
Ucontext *uc_link;
Sigaltstack uc_stack;
Mcontext uc_mcontext;
Usigset uc_sigmask;
Fpstate __fpregs_mem;
};
typedef struct Sigcontext Sigcontext;
struct Sigcontext {
uint64 r8;
uint64 r9;
uint64 r10;
uint64 r11;
uint64 r12;
uint64 r13;
uint64 r14;
uint64 r15;
uint64 rdi;
uint64 rsi;
uint64 rbp;
uint64 rbx;
uint64 rdx;
uint64 rax;
uint64 rcx;
uint64 rsp;
uint64 rip;
uint64 eflags;
uint16 cs;
uint16 gs;
uint16 fs;
uint16 __pad0;
uint64 err;
uint64 trapno;
uint64 oldmask;
uint64 cr2;
Fpstate1 *fpstate;
uint64 __reserved1[8];
uint64 r8;
uint64 r9;
uint64 r10;
uint64 r11;
uint64 r12;
uint64 r13;
uint64 r14;
uint64 r15;
uint64 rdi;
uint64 rsi;
uint64 rbp;
uint64 rbx;
uint64 rdx;
uint64 rax;
uint64 rcx;
uint64 rsp;
uint64 rip;
uint64 eflags;
uint16 cs;
uint16 gs;
uint16 fs;
uint16 __pad0;
uint64 err;
uint64 trapno;
uint64 oldmask;
uint64 cr2;
Fpstate1 *fpstate;
uint64 __reserved1[8];
};
#pragma pack off
// 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
godefs -f -m64 defs.c >amd64/defs.h
godefs -f -m64 defs1.c >>amd64/defs.h
*/
// Linux glibc and Linux kernel define different and conflicting
// definitions for struct sigaction, struct timespec, etc.
// We want the kernel ones, which are in the asm/* headers.
// But then we'd get conflicts when we include the system
// headers for things like ucontext_t, so that happens in
// a separate file, defs1.c.
#include <asm/posix_types.h>
#define size_t __kernel_size_t
#include <asm/signal.h>
#include <asm/siginfo.h>
#include <asm/mman.h>
enum {
$PROT_NONE = PROT_NONE,
$PROT_READ = PROT_READ,
$PROT_WRITE = PROT_WRITE,
$PROT_EXEC = PROT_EXEC,
$MAP_ANON = MAP_ANONYMOUS,
$MAP_PRIVATE = MAP_PRIVATE,
$MAP_FIXED = MAP_FIXED,
$SA_RESTART = SA_RESTART,
$SA_ONSTACK = SA_ONSTACK,
$SA_RESTORER = SA_RESTORER,
$SA_SIGINFO = SA_SIGINFO,
$SIGHUP = SIGHUP,
$SIGINT = SIGINT,
$SIGQUIT = SIGQUIT,
$SIGILL = SIGILL,
$SIGTRAP = SIGTRAP,
$SIGABRT = SIGABRT,
$SIGBUS = SIGBUS,
$SIGFPE = SIGFPE,
$SIGKILL = SIGKILL,
$SIGUSR1 = SIGUSR1,
$SIGSEGV = SIGSEGV,
$SIGUSR2 = SIGUSR2,
$SIGPIPE = SIGPIPE,
$SIGALRM = SIGALRM,
$SIGSTKFLT = SIGSTKFLT,
$SIGCHLD = SIGCHLD,
$SIGCONT = SIGCONT,
$SIGSTOP = SIGSTOP,
$SIGTSTP = SIGTSTP,
$SIGTTIN = SIGTTIN,
$SIGTTOU = SIGTTOU,
$SIGURG = SIGURG,
$SIGXCPU = SIGXCPU,
$SIGXFSZ = SIGXFSZ,
$SIGVTALRM = SIGVTALRM,
$SIGPROF = SIGPROF,
$SIGWINCH = SIGWINCH,
$SIGIO = SIGIO,
$SIGPWR = SIGPWR,
$SIGSYS = SIGSYS,
$FPE_INTDIV = FPE_INTDIV,
$FPE_INTOVF = FPE_INTOVF,
$FPE_FLTDIV = FPE_FLTDIV,
$FPE_FLTOVF = FPE_FLTOVF,
$FPE_FLTUND = FPE_FLTUND,
$FPE_FLTRES = FPE_FLTRES,
$FPE_FLTINV = FPE_FLTINV,
$FPE_FLTSUB = FPE_FLTSUB,
$BUS_ADRALN = BUS_ADRALN,
$BUS_ADRERR = BUS_ADRERR,
$BUS_OBJERR = BUS_OBJERR,
$SEGV_MAPERR = SEGV_MAPERR,
$SEGV_ACCERR = SEGV_ACCERR,
$ITIMER_REAL = ITIMER_REAL,
$ITIMER_VIRTUAL = ITIMER_VIRTUAL,
$ITIMER_PROF = ITIMER_PROF,
};
typedef struct timespec $Timespec;
typedef struct timeval $Timeval;
typedef struct sigaction $Sigaction;
typedef siginfo_t $Siginfo;
typedef struct itimerval $Itimerval;
// 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 cgo -cdefs
GOARCH=amd64 cgo -cdefs defs.go defs1.go >amd64/defs.h
*/
package runtime
/*
// Linux glibc and Linux kernel define different and conflicting
// definitions for struct sigaction, struct timespec, etc.
// We want the kernel ones, which are in the asm/* headers.
// But then we'd get conflicts when we include the system
// headers for things like ucontext_t, so that happens in
// a separate file, defs1.go.
#include <asm/posix_types.h>
#define size_t __kernel_size_t
#include <asm/signal.h>
#include <asm/siginfo.h>
#include <asm/mman.h>
*/
import "C"
const (
PROT_NONE = C.PROT_NONE
PROT_READ = C.PROT_READ
PROT_WRITE = C.PROT_WRITE
PROT_EXEC = C.PROT_EXEC
MAP_ANON = C.MAP_ANONYMOUS
MAP_PRIVATE = C.MAP_PRIVATE
MAP_FIXED = C.MAP_FIXED
SA_RESTART = C.SA_RESTART
SA_ONSTACK = C.SA_ONSTACK
SA_RESTORER = C.SA_RESTORER
SA_SIGINFO = C.SA_SIGINFO
SIGHUP = C.SIGHUP
SIGINT = C.SIGINT
SIGQUIT = C.SIGQUIT
SIGILL = C.SIGILL
SIGTRAP = C.SIGTRAP
SIGABRT = C.SIGABRT
SIGBUS = C.SIGBUS
SIGFPE = C.SIGFPE
SIGKILL = C.SIGKILL
SIGUSR1 = C.SIGUSR1
SIGSEGV = C.SIGSEGV
SIGUSR2 = C.SIGUSR2
SIGPIPE = C.SIGPIPE
SIGALRM = C.SIGALRM
SIGSTKFLT = C.SIGSTKFLT
SIGCHLD = C.SIGCHLD
SIGCONT = C.SIGCONT
SIGSTOP = C.SIGSTOP
SIGTSTP = C.SIGTSTP
SIGTTIN = C.SIGTTIN
SIGTTOU = C.SIGTTOU
SIGURG = C.SIGURG
SIGXCPU = C.SIGXCPU
SIGXFSZ = C.SIGXFSZ
SIGVTALRM = C.SIGVTALRM
SIGPROF = C.SIGPROF
SIGWINCH = C.SIGWINCH
SIGIO = C.SIGIO
SIGPWR = C.SIGPWR
SIGSYS = C.SIGSYS
FPE_INTDIV = C.FPE_INTDIV
FPE_INTOVF = C.FPE_INTOVF
FPE_FLTDIV = C.FPE_FLTDIV
FPE_FLTOVF = C.FPE_FLTOVF
FPE_FLTUND = C.FPE_FLTUND
FPE_FLTRES = C.FPE_FLTRES
FPE_FLTINV = C.FPE_FLTINV
FPE_FLTSUB = C.FPE_FLTSUB
BUS_ADRALN = C.BUS_ADRALN
BUS_ADRERR = C.BUS_ADRERR
BUS_OBJERR = C.BUS_OBJERR
SEGV_MAPERR = C.SEGV_MAPERR
SEGV_ACCERR = C.SEGV_ACCERR
ITIMER_REAL = C.ITIMER_REAL
ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
ITIMER_PROF = C.ITIMER_PROF
)
type Timespec C.struct_timespec
type Timeval C.struct_timeval
type Sigaction C.struct_sigaction
type Siginfo C.siginfo_t
type Itimerval C.struct_itimerval
// 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
godefs -f -m64 defs.c >amd64/defs.h
godefs -f -m64 defs1.c >>amd64/defs.h
*/
#include <ucontext.h>
typedef __sigset_t $Usigset;
typedef struct _libc_fpxreg $Fpxreg;
typedef struct _libc_xmmreg $Xmmreg;
typedef struct _libc_fpstate $Fpstate;
typedef struct _fpxreg $Fpxreg1;
typedef struct _xmmreg $Xmmreg1;
typedef struct _fpstate $Fpstate1;
typedef struct _fpreg $Fpreg1;
typedef struct sigaltstack $Sigaltstack;
typedef mcontext_t $Mcontext;
typedef ucontext_t $Ucontext;
typedef struct sigcontext $Sigcontext;
// 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 cgo -cdefs
GOARCH=amd64 cgo -cdefs defs.go defs1.go >amd64/defs.h
*/
package runtime
/*
#include <ucontext.h>
#include <fcntl.h>
*/
import "C"
const (
O_RDONLY = C.O_RDONLY
O_CLOEXEC = C.O_CLOEXEC
)
type Usigset C.__sigset_t
type Fpxreg C.struct__libc_fpxreg
type Xmmreg C.struct__libc_xmmreg
type Fpstate C.struct__libc_fpstate
type Fpxreg1 C.struct__fpxreg
type Xmmreg1 C.struct__xmmreg
type Fpstate1 C.struct__fpstate
type Fpreg1 C.struct__fpreg
type Sigaltstack C.struct_sigaltstack
type Mcontext C.mcontext_t
type Ucontext C.ucontext_t
type Sigcontext C.struct_sigcontext
// 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
godefs -f -m32 \
-f -I/home/rsc/pub/linux-2.6/arch/x86/include \
-f -I/home/rsc/pub/linux-2.6/include \
-f -D_LOOSE_KERNEL_NAMES \
-f -D__ARCH_SI_UID_T'='__kernel_uid32_t \
defs2.c >386/defs.h
* The asm header tricks we have to use for Linux on amd64
* (see defs.c and defs1.c) don't work here, so this is yet another
* file. Sigh.
*/
#include <asm/signal.h>
#include <asm/mman.h>
#include <asm/sigcontext.h>
#include <asm/ucontext.h>
#include <asm/siginfo.h>
/*
#include <sys/signal.h>
#include <sys/mman.h>
#include <ucontext.h>
*/
/* This is the sigaction structure from the Linux 2.1.68 kernel which
is used with the rt_sigaction system call. For 386 this is not
defined in any public header file. */
struct kernel_sigaction {
__sighandler_t k_sa_handler;
unsigned long sa_flags;
void (*sa_restorer) (void);
sigset_t sa_mask;
};
enum {
$PROT_NONE = PROT_NONE,
$PROT_READ = PROT_READ,
$PROT_WRITE = PROT_WRITE,
$PROT_EXEC = PROT_EXEC,
$MAP_ANON = MAP_ANONYMOUS,
$MAP_PRIVATE = MAP_PRIVATE,
$MAP_FIXED = MAP_FIXED,
$SA_RESTART = SA_RESTART,
$SA_ONSTACK = SA_ONSTACK,
$SA_RESTORER = SA_RESTORER,
$SA_SIGINFO = SA_SIGINFO,
$SIGHUP = SIGHUP,
$SIGINT = SIGINT,
$SIGQUIT = SIGQUIT,
$SIGILL = SIGILL,
$SIGTRAP = SIGTRAP,
$SIGABRT = SIGABRT,
$SIGBUS = SIGBUS,
$SIGFPE = SIGFPE,
$SIGKILL = SIGKILL,
$SIGUSR1 = SIGUSR1,
$SIGSEGV = SIGSEGV,
$SIGUSR2 = SIGUSR2,
$SIGPIPE = SIGPIPE,
$SIGALRM = SIGALRM,
$SIGSTKFLT = SIGSTKFLT,
$SIGCHLD = SIGCHLD,
$SIGCONT = SIGCONT,
$SIGSTOP = SIGSTOP,
$SIGTSTP = SIGTSTP,
$SIGTTIN = SIGTTIN,
$SIGTTOU = SIGTTOU,
$SIGURG = SIGURG,
$SIGXCPU = SIGXCPU,
$SIGXFSZ = SIGXFSZ,
$SIGVTALRM = SIGVTALRM,
$SIGPROF = SIGPROF,
$SIGWINCH = SIGWINCH,
$SIGIO = SIGIO,
$SIGPWR = SIGPWR,
$SIGSYS = SIGSYS,
$FPE_INTDIV = FPE_INTDIV,
$FPE_INTOVF = FPE_INTOVF,
$FPE_FLTDIV = FPE_FLTDIV,
$FPE_FLTOVF = FPE_FLTOVF,
$FPE_FLTUND = FPE_FLTUND,
$FPE_FLTRES = FPE_FLTRES,
$FPE_FLTINV = FPE_FLTINV,
$FPE_FLTSUB = FPE_FLTSUB,
$BUS_ADRALN = BUS_ADRALN,
$BUS_ADRERR = BUS_ADRERR,
$BUS_OBJERR = BUS_OBJERR,
$SEGV_MAPERR = SEGV_MAPERR,
$SEGV_ACCERR = SEGV_ACCERR,
$ITIMER_REAL = ITIMER_REAL,
$ITIMER_VIRTUAL = ITIMER_VIRTUAL,
$ITIMER_PROF = ITIMER_PROF,
};
typedef struct _fpreg $Fpreg;
typedef struct _fpxreg $Fpxreg;
typedef struct _xmmreg $Xmmreg;
typedef struct _fpstate $Fpstate;
typedef struct timespec $Timespec;
typedef struct timeval $Timeval;
typedef struct kernel_sigaction $Sigaction;
typedef siginfo_t $Siginfo;
typedef struct sigaltstack $Sigaltstack;
typedef struct sigcontext $Sigcontext;
typedef struct ucontext $Ucontext;
typedef struct itimerval $Itimerval;
// 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 cgo -cdefs
GOARCH=386 cgo -cdefs defs2.go >386/defs.h
The asm header tricks we have to use for Linux on amd64
(see defs.c and defs1.c) don't work here, so this is yet another
file. Sigh.
*/
package runtime
/*
#cgo CFLAGS: -I/home/rsc/pub/linux-2.6/arch/x86/include -I/home/rsc/pub/linux-2.6/include -D_LOOSE_KERNEL_NAMES -D__ARCH_SI_UID_T=__kernel_uid32_t
#include <asm/signal.h>
#include <asm/mman.h>
#include <asm/sigcontext.h>
#include <asm/ucontext.h>
#include <asm/siginfo.h>
#include <asm-generic/fcntl.h>
// This is the sigaction structure from the Linux 2.1.68 kernel which
// is used with the rt_sigaction system call. For 386 this is not
// defined in any public header file.
struct kernel_sigaction {
__sighandler_t k_sa_handler;
unsigned long sa_flags;
void (*sa_restorer) (void);
sigset_t sa_mask;
};
*/
import "C"
const (
PROT_NONE = C.PROT_NONE
PROT_READ = C.PROT_READ
PROT_WRITE = C.PROT_WRITE
PROT_EXEC = C.PROT_EXEC
MAP_ANON = C.MAP_ANONYMOUS
MAP_PRIVATE = C.MAP_PRIVATE
MAP_FIXED = C.MAP_FIXED
SA_RESTART = C.SA_RESTART
SA_ONSTACK = C.SA_ONSTACK
SA_RESTORER = C.SA_RESTORER
SA_SIGINFO = C.SA_SIGINFO
SIGHUP = C.SIGHUP
SIGINT = C.SIGINT
SIGQUIT = C.SIGQUIT
SIGILL = C.SIGILL
SIGTRAP = C.SIGTRAP
SIGABRT = C.SIGABRT
SIGBUS = C.SIGBUS
SIGFPE = C.SIGFPE
SIGKILL = C.SIGKILL
SIGUSR1 = C.SIGUSR1
SIGSEGV = C.SIGSEGV
SIGUSR2 = C.SIGUSR2
SIGPIPE = C.SIGPIPE
SIGALRM = C.SIGALRM
SIGSTKFLT = C.SIGSTKFLT
SIGCHLD = C.SIGCHLD
SIGCONT = C.SIGCONT
SIGSTOP = C.SIGSTOP
SIGTSTP = C.SIGTSTP
SIGTTIN = C.SIGTTIN
SIGTTOU = C.SIGTTOU
SIGURG = C.SIGURG
SIGXCPU = C.SIGXCPU
SIGXFSZ = C.SIGXFSZ
SIGVTALRM = C.SIGVTALRM
SIGPROF = C.SIGPROF
SIGWINCH = C.SIGWINCH
SIGIO = C.SIGIO
SIGPWR = C.SIGPWR
SIGSYS = C.SIGSYS
FPE_INTDIV = C.FPE_INTDIV
FPE_INTOVF = C.FPE_INTOVF
FPE_FLTDIV = C.FPE_FLTDIV
FPE_FLTOVF = C.FPE_FLTOVF
FPE_FLTUND = C.FPE_FLTUND
FPE_FLTRES = C.FPE_FLTRES
FPE_FLTINV = C.FPE_FLTINV
FPE_FLTSUB = C.FPE_FLTSUB
BUS_ADRALN = C.BUS_ADRALN
BUS_ADRERR = C.BUS_ADRERR
BUS_OBJERR = C.BUS_OBJERR
SEGV_MAPERR = C.SEGV_MAPERR
SEGV_ACCERR = C.SEGV_ACCERR
ITIMER_REAL = C.ITIMER_REAL
ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
ITIMER_PROF = C.ITIMER_PROF
O_RDONLY = C.O_RDONLY
O_CLOEXEC = C.O_CLOEXEC
)
type Fpreg C.struct__fpreg
type Fpxreg C.struct__fpxreg
type Xmmreg C.struct__xmmreg
type Fpstate C.struct__fpstate
type Timespec C.struct_timespec
type Timeval C.struct_timeval
type Sigaction C.struct_kernel_sigaction
type Siginfo C.siginfo_t
type Sigaltstack C.struct_sigaltstack
type Sigcontext C.struct_sigcontext
type Ucontext C.struct_ucontext
type Itimerval C.struct_itimerval
// 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
* On a Debian Lenny arm linux distribution:
godefs -f-I/usr/src/linux-headers-2.6.26-2-versatile/include defs_arm.c
*/
#define __ARCH_SI_UID_T int
#include <asm/signal.h>
#include <asm/mman.h>
#include <asm/sigcontext.h>
#include <asm/ucontext.h>
#include <asm/siginfo.h>
#include <linux/time.h>
/*
#include <sys/signal.h>
#include <sys/mman.h>
#include <ucontext.h>
*/
enum {
$PROT_NONE = PROT_NONE,
$PROT_READ = PROT_READ,
$PROT_WRITE = PROT_WRITE,
$PROT_EXEC = PROT_EXEC,
$MAP_ANON = MAP_ANONYMOUS,
$MAP_PRIVATE = MAP_PRIVATE,
$MAP_FIXED = MAP_FIXED,
$SA_RESTART = SA_RESTART,
$SA_ONSTACK = SA_ONSTACK,
$SA_RESTORER = SA_RESTORER,
$SA_SIGINFO = SA_SIGINFO,
$SIGHUP = SIGHUP,
$SIGINT = SIGINT,
$SIGQUIT = SIGQUIT,
$SIGILL = SIGILL,
$SIGTRAP = SIGTRAP,
$SIGABRT = SIGABRT,
$SIGBUS = SIGBUS,
$SIGFPE = SIGFPE,
$SIGKILL = SIGKILL,
$SIGUSR1 = SIGUSR1,
$SIGSEGV = SIGSEGV,
$SIGUSR2 = SIGUSR2,
$SIGPIPE = SIGPIPE,
$SIGALRM = SIGALRM,
$SIGSTKFLT = SIGSTKFLT,
$SIGCHLD = SIGCHLD,
$SIGCONT = SIGCONT,
$SIGSTOP = SIGSTOP,
$SIGTSTP = SIGTSTP,
$SIGTTIN = SIGTTIN,
$SIGTTOU = SIGTTOU,
$SIGURG = SIGURG,
$SIGXCPU = SIGXCPU,
$SIGXFSZ = SIGXFSZ,
$SIGVTALRM = SIGVTALRM,
$SIGPROF = SIGPROF,
$SIGWINCH = SIGWINCH,
$SIGIO = SIGIO,
$SIGPWR = SIGPWR,
$SIGSYS = SIGSYS,
$FPE_INTDIV = FPE_INTDIV & 0xFFFF,
$FPE_INTOVF = FPE_INTOVF & 0xFFFF,
$FPE_FLTDIV = FPE_FLTDIV & 0xFFFF,
$FPE_FLTOVF = FPE_FLTOVF & 0xFFFF,
$FPE_FLTUND = FPE_FLTUND & 0xFFFF,
$FPE_FLTRES = FPE_FLTRES & 0xFFFF,
$FPE_FLTINV = FPE_FLTINV & 0xFFFF,
$FPE_FLTSUB = FPE_FLTSUB & 0xFFFF,
$BUS_ADRALN = BUS_ADRALN & 0xFFFF,
$BUS_ADRERR = BUS_ADRERR & 0xFFFF,
$BUS_OBJERR = BUS_OBJERR & 0xFFFF,
$SEGV_MAPERR = SEGV_MAPERR & 0xFFFF,
$SEGV_ACCERR = SEGV_ACCERR & 0xFFFF,
$ITIMER_REAL = ITIMER_REAL,
$ITIMER_PROF = ITIMER_PROF,
$ITIMER_VIRTUAL = ITIMER_VIRTUAL,
};
typedef sigset_t $Sigset;
typedef struct timespec $Timespec;
typedef struct sigaltstack $Sigaltstack;
typedef struct sigcontext $Sigcontext;
typedef struct ucontext $Ucontext;
typedef struct timeval $Timeval;
typedef struct itimerval $Itimerval;
struct xsiginfo {
int si_signo;
int si_errno;
int si_code;
char _sifields[4];
};
typedef struct xsiginfo $Siginfo;
#undef sa_handler
#undef sa_flags
#undef sa_restorer
#undef sa_mask
struct xsigaction {
void (*sa_handler)(void);
unsigned long sa_flags;
void (*sa_restorer)(void);
unsigned int sa_mask; /* mask last for extensibility */
};
typedef struct xsigaction $Sigaction;
// 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 cgo.
On a Debian Lenny arm linux distribution:
cgo -cdefs defs_arm.c >arm/defs.h
*/
package runtime
/*
#cgo CFLAGS: -I/usr/src/linux-headers-2.6.26-2-versatile/include
#define __ARCH_SI_UID_T int
#include <asm/signal.h>
#include <asm/mman.h>
#include <asm/sigcontext.h>
#include <asm/ucontext.h>
#include <asm/siginfo.h>
#include <linux/time.h>
struct xsiginfo {
int si_signo;
int si_errno;
int si_code;
char _sifields[4];
};
#undef sa_handler
#undef sa_flags
#undef sa_restorer
#undef sa_mask
struct xsigaction {
void (*sa_handler)(void);
unsigned long sa_flags;
void (*sa_restorer)(void);
unsigned int sa_mask; // mask last for extensibility
};
*/
import "C"
const (
PROT_NONE = C.PROT_NONE
PROT_READ = C.PROT_READ
PROT_WRITE = C.PROT_WRITE
PROT_EXEC = C.PROT_EXEC
MAP_ANON = C.MAP_ANONYMOUS
MAP_PRIVATE = C.MAP_PRIVATE
MAP_FIXED = C.MAP_FIXED
SA_RESTART = C.SA_RESTART
SA_ONSTACK = C.SA_ONSTACK
SA_RESTORER = C.SA_RESTORER
SA_SIGINFO = C.SA_SIGINFO
SIGHUP = C.SIGHUP
SIGINT = C.SIGINT
SIGQUIT = C.SIGQUIT
SIGILL = C.SIGILL
SIGTRAP = C.SIGTRAP
SIGABRT = C.SIGABRT
SIGBUS = C.SIGBUS
SIGFPE = C.SIGFPE
SIGKILL = C.SIGKILL
SIGUSR1 = C.SIGUSR1
SIGSEGV = C.SIGSEGV
SIGUSR2 = C.SIGUSR2
SIGPIPE = C.SIGPIPE
SIGALRM = C.SIGALRM
SIGSTKFLT = C.SIGSTKFLT
SIGCHLD = C.SIGCHLD
SIGCONT = C.SIGCONT
SIGSTOP = C.SIGSTOP
SIGTSTP = C.SIGTSTP
SIGTTIN = C.SIGTTIN
SIGTTOU = C.SIGTTOU
SIGURG = C.SIGURG
SIGXCPU = C.SIGXCPU
SIGXFSZ = C.SIGXFSZ
SIGVTALRM = C.SIGVTALRM
SIGPROF = C.SIGPROF
SIGWINCH = C.SIGWINCH
SIGIO = C.SIGIO
SIGPWR = C.SIGPWR
SIGSYS = C.SIGSYS
FPE_INTDIV = C.FPE_INTDIV & 0xFFFF
FPE_INTOVF = C.FPE_INTOVF & 0xFFFF
FPE_FLTDIV = C.FPE_FLTDIV & 0xFFFF
FPE_FLTOVF = C.FPE_FLTOVF & 0xFFFF
FPE_FLTUND = C.FPE_FLTUND & 0xFFFF
FPE_FLTRES = C.FPE_FLTRES & 0xFFFF
FPE_FLTINV = C.FPE_FLTINV & 0xFFFF
FPE_FLTSUB = C.FPE_FLTSUB & 0xFFFF
BUS_ADRALN = C.BUS_ADRALN & 0xFFFF
BUS_ADRERR = C.BUS_ADRERR & 0xFFFF
BUS_OBJERR = C.BUS_OBJERR & 0xFFFF
SEGV_MAPERR = C.SEGV_MAPERR & 0xFFFF
SEGV_ACCERR = C.SEGV_ACCERR & 0xFFFF
ITIMER_REAL = C.ITIMER_REAL
ITIMER_PROF = C.ITIMER_PROF
ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
)
type Sigset C.sigset_t
type Timespec C.struct_timespec
type Sigaltstack C.struct_sigaltstack
type Sigcontext C.struct_sigcontext
type Ucontext C.struct_ucontext
type Timeval C.struct_timeval
type Itimerval C.struct_itimerval
type Siginfo C.struct_xsiginfo
type Sigaction C.struct_xsigaction
// 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.
*
godefs -f -m64 defs.c >amd64/defs.h
godefs -f -m32 defs.c >386/defs.h
*/
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/unistd.h>
#include <sys/signal.h>
#include <errno.h>
#include <signal.h>
enum {
$PROT_NONE = PROT_NONE,
$PROT_READ = PROT_READ,
$PROT_WRITE = PROT_WRITE,
$PROT_EXEC = PROT_EXEC,
$MAP_ANON = MAP_ANON,
$MAP_PRIVATE = MAP_PRIVATE,
$MAP_FIXED = MAP_FIXED,
$SA_SIGINFO = SA_SIGINFO,
$SA_RESTART = SA_RESTART,
$SA_ONSTACK = SA_ONSTACK,
$EINTR = EINTR,
$SIGHUP = SIGHUP,
$SIGINT = SIGINT,
$SIGQUIT = SIGQUIT,
$SIGILL = SIGILL,
$SIGTRAP = SIGTRAP,
$SIGABRT = SIGABRT,
$SIGEMT = SIGEMT,
$SIGFPE = SIGFPE,
$SIGKILL = SIGKILL,
$SIGBUS = SIGBUS,
$SIGSEGV = SIGSEGV,
$SIGSYS = SIGSYS,
$SIGPIPE = SIGPIPE,
$SIGALRM = SIGALRM,
$SIGTERM = SIGTERM,
$SIGURG = SIGURG,
$SIGSTOP = SIGSTOP,
$SIGTSTP = SIGTSTP,
$SIGCONT = SIGCONT,
$SIGCHLD = SIGCHLD,
$SIGTTIN = SIGTTIN,
$SIGTTOU = SIGTTOU,
$SIGIO = SIGIO,
$SIGXCPU = SIGXCPU,
$SIGXFSZ = SIGXFSZ,
$SIGVTALRM = SIGVTALRM,
$SIGPROF = SIGPROF,
$SIGWINCH = SIGWINCH,
$SIGINFO = SIGINFO,
$SIGUSR1 = SIGUSR1,
$SIGUSR2 = SIGUSR2,
$FPE_INTDIV = FPE_INTDIV,
$FPE_INTOVF = FPE_INTOVF,
$FPE_FLTDIV = FPE_FLTDIV,
$FPE_FLTOVF = FPE_FLTOVF,
$FPE_FLTUND = FPE_FLTUND,
$FPE_FLTRES = FPE_FLTRES,
$FPE_FLTINV = FPE_FLTINV,
$FPE_FLTSUB = FPE_FLTSUB,
$BUS_ADRALN = BUS_ADRALN,
$BUS_ADRERR = BUS_ADRERR,
$BUS_OBJERR = BUS_OBJERR,
$SEGV_MAPERR = SEGV_MAPERR,
$SEGV_ACCERR = SEGV_ACCERR,
$ITIMER_REAL = ITIMER_REAL,
$ITIMER_VIRTUAL = ITIMER_VIRTUAL,
$ITIMER_PROF = ITIMER_PROF,
};
typedef struct sigaltstack $Sigaltstack;
typedef sigset_t $Sigset;
typedef siginfo_t $Siginfo;
typedef union sigval $Sigval;
typedef stack_t $StackT;
typedef struct timespec $Timespec;
typedef struct timeval $Timeval;
typedef struct itimerval $Itimerval;
// This is a hack to avoid pulling in machine/fpu.h.
typedef void $sfxsave64;
typedef void $usavefpu;
typedef struct sigcontext $Sigcontext;
// 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 cgo.
GOARCH=amd64 cgo -cdefs defs.go >amd64/defs.h
GOARCH=386 cgo -cdefs defs.go >386/defs.h
*/
package runtime
/*
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/unistd.h>
#include <sys/signal.h>
#include <errno.h>
#include <signal.h>
*/
import "C"
const (
PROT_NONE = C.PROT_NONE
PROT_READ = C.PROT_READ
PROT_WRITE = C.PROT_WRITE
PROT_EXEC = C.PROT_EXEC
MAP_ANON = C.MAP_ANON
MAP_PRIVATE = C.MAP_PRIVATE
MAP_FIXED = C.MAP_FIXED
SA_SIGINFO = C.SA_SIGINFO
SA_RESTART = C.SA_RESTART
SA_ONSTACK = C.SA_ONSTACK
EINTR = C.EINTR
SIGHUP = C.SIGHUP
SIGINT = C.SIGINT
SIGQUIT = C.SIGQUIT
SIGILL = C.SIGILL
SIGTRAP = C.SIGTRAP
SIGABRT = C.SIGABRT
SIGEMT = C.SIGEMT
SIGFPE = C.SIGFPE
SIGKILL = C.SIGKILL
SIGBUS = C.SIGBUS
SIGSEGV = C.SIGSEGV
SIGSYS = C.SIGSYS
SIGPIPE = C.SIGPIPE
SIGALRM = C.SIGALRM
SIGTERM = C.SIGTERM
SIGURG = C.SIGURG
SIGSTOP = C.SIGSTOP
SIGTSTP = C.SIGTSTP
SIGCONT = C.SIGCONT
SIGCHLD = C.SIGCHLD
SIGTTIN = C.SIGTTIN
SIGTTOU = C.SIGTTOU
SIGIO = C.SIGIO
SIGXCPU = C.SIGXCPU
SIGXFSZ = C.SIGXFSZ
SIGVTALRM = C.SIGVTALRM
SIGPROF = C.SIGPROF
SIGWINCH = C.SIGWINCH
SIGINFO = C.SIGINFO
SIGUSR1 = C.SIGUSR1
SIGUSR2 = C.SIGUSR2
FPE_INTDIV = C.FPE_INTDIV
FPE_INTOVF = C.FPE_INTOVF
FPE_FLTDIV = C.FPE_FLTDIV
FPE_FLTOVF = C.FPE_FLTOVF
FPE_FLTUND = C.FPE_FLTUND
FPE_FLTRES = C.FPE_FLTRES
FPE_FLTINV = C.FPE_FLTINV
FPE_FLTSUB = C.FPE_FLTSUB
BUS_ADRALN = C.BUS_ADRALN
BUS_ADRERR = C.BUS_ADRERR
BUS_OBJERR = C.BUS_OBJERR
SEGV_MAPERR = C.SEGV_MAPERR
SEGV_ACCERR = C.SEGV_ACCERR
ITIMER_REAL = C.ITIMER_REAL
ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
ITIMER_PROF = C.ITIMER_PROF
)
type Sigaltstack C.struct_sigaltstack
type Sigset C.sigset_t
type Siginfo C.siginfo_t
type Sigval C.union_sigval
type StackT C.stack_t
type Timespec C.struct_timespec
type Timeval C.struct_timeval
type Itimerval C.struct_itimerval
// This is a hack to avoid pulling in machine/fpu.h.
type sfxsave64 struct{}
type usavefpu struct{}
type Sigcontext C.struct_sigcontext
// 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 <signal.h>
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wincon.h>
enum {
$PROT_NONE = 0,
$PROT_READ = 1,
$PROT_WRITE = 2,
$PROT_EXEC = 4,
$MAP_ANON = 1,
$MAP_PRIVATE = 2,
$DUPLICATE_SAME_ACCESS = DUPLICATE_SAME_ACCESS,
$THREAD_PRIORITY_HIGHEST = THREAD_PRIORITY_HIGHEST,
$SIGINT = SIGINT,
$CTRL_C_EVENT = CTRL_C_EVENT,
$CTRL_BREAK_EVENT = CTRL_BREAK_EVENT,
$CONTEXT_CONTROL = CONTEXT_CONTROL,
$CONTEXT_FULL = CONTEXT_FULL,
$EXCEPTION_ACCESS_VIOLATION = STATUS_ACCESS_VIOLATION,
$EXCEPTION_BREAKPOINT = STATUS_BREAKPOINT,
$EXCEPTION_FLT_DENORMAL_OPERAND = STATUS_FLOAT_DENORMAL_OPERAND,
$EXCEPTION_FLT_DIVIDE_BY_ZERO = STATUS_FLOAT_DIVIDE_BY_ZERO,
$EXCEPTION_FLT_INEXACT_RESULT = STATUS_FLOAT_INEXACT_RESULT,
$EXCEPTION_FLT_OVERFLOW = STATUS_FLOAT_OVERFLOW,
$EXCEPTION_FLT_UNDERFLOW = STATUS_FLOAT_UNDERFLOW,
$EXCEPTION_INT_DIVIDE_BY_ZERO = STATUS_INTEGER_DIVIDE_BY_ZERO,
$EXCEPTION_INT_OVERFLOW = STATUS_INTEGER_OVERFLOW,
};
typedef SYSTEM_INFO $SystemInfo;
typedef EXCEPTION_RECORD $ExceptionRecord;
#ifdef _X86_
typedef FLOATING_SAVE_AREA $FloatingSaveArea;
#endif
#ifdef _AMD64_
typedef M128A $M128a;
#endif
typedef CONTEXT $Context;
// 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 cgo.
GOARCH=amd64 cgo -cdefs defs.go >amd64/defs.h
GOARCH=386 cgo -cdefs defs.go >386/defs.h
*/
package runtime
/*
#include <signal.h>
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wincon.h>
#ifndef _X86_
typedef struct {} FLOATING_SAVE_AREA;
#endif
#ifndef _AMD64_
typedef struct {} M128A;
#endif
*/
import "C"
const (
PROT_NONE = 0
PROT_READ = 1
PROT_WRITE = 2
PROT_EXEC = 4
MAP_ANON = 1
MAP_PRIVATE = 2
DUPLICATE_SAME_ACCESS = C.DUPLICATE_SAME_ACCESS
THREAD_PRIORITY_HIGHEST = C.THREAD_PRIORITY_HIGHEST
SIGINT = C.SIGINT
CTRL_C_EVENT = C.CTRL_C_EVENT
CTRL_BREAK_EVENT = C.CTRL_BREAK_EVENT
CONTEXT_CONTROL = C.CONTEXT_CONTROL
CONTEXT_FULL = C.CONTEXT_FULL
EXCEPTION_ACCESS_VIOLATION = C.STATUS_ACCESS_VIOLATION
EXCEPTION_BREAKPOINT = C.STATUS_BREAKPOINT
EXCEPTION_FLT_DENORMAL_OPERAND = C.STATUS_FLOAT_DENORMAL_OPERAND
EXCEPTION_FLT_DIVIDE_BY_ZERO = C.STATUS_FLOAT_DIVIDE_BY_ZERO
EXCEPTION_FLT_INEXACT_RESULT = C.STATUS_FLOAT_INEXACT_RESULT
EXCEPTION_FLT_OVERFLOW = C.STATUS_FLOAT_OVERFLOW
EXCEPTION_FLT_UNDERFLOW = C.STATUS_FLOAT_UNDERFLOW
EXCEPTION_INT_DIVIDE_BY_ZERO = C.STATUS_INTEGER_DIVIDE_BY_ZERO
EXCEPTION_INT_OVERFLOW = C.STATUS_INTEGER_OVERFLOW
)
type SystemInfo C.SYSTEM_INFO
type ExceptionRecord C.EXCEPTION_RECORD
type FloatingSaveArea C.FLOATING_SAVE_AREA
type M128a C.M128A
type Context C.CONTEXT
......@@ -108,75 +108,75 @@ _* | *_ | _)
exit 1
;;
freebsd_386)
mkerrors="$mkerrors -f -m32"
mkerrors="$mkerrors -m32"
mksyscall="./mksyscall.pl -l32"
mksysnum="curl -s 'http://svn.freebsd.org/base/head/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl"
mktypes="godefs -gsyscall -f-m32"
mktypes="GOARCH=$GOARCH cgo -godefs"
;;
freebsd_amd64)
mkerrors="$mkerrors -f -m64"
mkerrors="$mkerrors -m64"
mksysnum="curl -s 'http://svn.freebsd.org/base/head/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl"
mktypes="godefs -gsyscall -f-m64"
mktypes="GOARCH=$GOARCH cgo -godefs"
;;
darwin_386)
mkerrors="$mkerrors -f -m32"
mkerrors="$mkerrors -m32"
mksyscall="./mksyscall.pl -l32"
mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
mktypes="godefs -gsyscall -f-m32"
mktypes="GOARCH=$GOARCH cgo -godefs"
;;
darwin_amd64)
mkerrors="$mkerrors -f -m64"
mkerrors="$mkerrors -m64"
mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
mktypes="godefs -gsyscall -f-m64"
mktypes="GOARCH=$GOARCH cgo -godefs"
;;
linux_386)
mkerrors="$mkerrors -f -m32"
mkerrors="$mkerrors -m32"
mksyscall="./mksyscall.pl -l32"
mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd_32.h"
mktypes="godefs -gsyscall -f-m32"
mktypes="GOARCH=$GOARCH cgo -godefs"
;;
linux_amd64)
mkerrors="$mkerrors -f -m64"
mkerrors="$mkerrors -m64"
mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd_64.h"
mktypes="godefs -gsyscall -f-m64"
mktypes="GOARCH=$GOARCH cgo -godefs"
;;
linux_arm)
mkerrors="$mkerrors"
mksyscall="./mksyscall.pl -b32"
mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd.h"
mktypes="godefs -gsyscall"
mktypes="GOARCH=$GOARCH cgo -godefs"
;;
windows_386)
mksyscall="./mksyscall_windows.pl -l32"
mksysnum=
mktypes=
mkerrors="./mkerrors_windows.sh -f -m32"
mkerrors="./mkerrors_windows.sh -m32"
zerrors="zerrors_windows.go"
;;
windows_amd64)
mksyscall="./mksyscall_windows.pl"
mksysnum=
mktypes=
mkerrors="./mkerrors_windows.sh -f -m32"
mkerrors="./mkerrors_windows.sh -m32"
zerrors="zerrors_windows.go"
;;
plan9_386)
mkerrors=
mksyscall="./mksyscall.pl -l32 -plan9"
mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h"
mktypes="godefs -gsyscall -f -m32"
mktypes="XXX"
;;
openbsd_386)
mkerrors="$mkerrors -f -m32"
mkerrors="$mkerrors -m32"
mksyscall="./mksyscall.pl -l32 -openbsd"
mksysnum="curl -s 'http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl"
mktypes="godefs -gsyscall -f-m32"
mktypes="GOARCH=$GOARCH cgo -godefs"
;;
openbsd_amd64)
mkerrors="$mkerrors -f -m64"
mkerrors="$mkerrors -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"
mktypes="GOARCH=$GOARCH cgo -godefs"
;;
*)
echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2
......@@ -194,5 +194,5 @@ esac
esac
if [ -n "$mksyscall" ]; then echo "$mksyscall $syscall_goos syscall_$GOOSARCH.go |gofmt >zsyscall_$GOOSARCH.go"; fi
if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi
if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.c |gofmt >ztypes_$GOOSARCH.go"; fi
if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.go |gofmt >ztypes_$GOOSARCH.go"; fi
) | $run
......@@ -120,24 +120,19 @@ includes='
#include <signal.h>
'
ccflags=""
next=false
for i
do
if $next; then
ccflags="$ccflags $i"
next=false
elif [ "$i" = "-f" ]; then
next=true
fi
done
ccflags="$@"
# Write godefs input.
# Write cgo -godefs input.
(
echo package syscall
echo
echo '/*'
indirect="includes_$(uname)"
echo "${!indirect} $includes"
echo '*/'
echo 'import "C"'
echo
echo 'enum {'
echo 'const ('
# The gcc command line prints all the #defines
# it encounters while processing the input
......@@ -177,15 +172,15 @@ done
$2 !~ /^(BPF_TIMEVAL)$/ &&
$2 ~ /^(BPF|DLT)_/ ||
$2 !~ "WMESGLEN" &&
$2 ~ /^W[A-Z0-9]+$/ {printf("\t$%s = %s,\n", $2, $2)}
$2 ~ /^W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", $2, $2)}
$2 ~ /^__WCOREFLAG$/ {next}
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t$%s = %s,\n", substr($2,3), $2)}
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
{next}
' | sort
echo '};'
) >_const.c
echo ')'
) >_const.go
# Pull out just the error names for later.
errors=$(
......@@ -197,7 +192,7 @@ errors=$(
echo '// mkerrors.sh' "$@"
echo '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'
echo
godefs -c $GCC "$@" -gsyscall "$@" _const.c
cgo -godefs -- "$@" _const.go
# Run C program to print error strings.
(
......@@ -255,4 +250,4 @@ main(void)
'
) >_errors.c
$GCC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.c
$GCC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go
// 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 __DARWIN_UNIX03 0
#define KERNEL
#define _DARWIN_USE_64_BIT_INODE
#include <dirent.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <mach/mach.h>
#include <mach/message.h>
#include <sys/event.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/param.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/types.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_var.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;
typedef struct timeval32 $Timeval32;
// Processes
typedef struct rusage $Rusage;
typedef struct rlimit $Rlimit;
typedef gid_t $_Gid_t;
// Files
enum {
$O_CLOEXEC = 0, // not supported
};
typedef struct stat64 $Stat_t;
typedef struct statfs64 $Statfs_t;
typedef struct flock $Flock_t;
typedef struct fstore $Fstore_t;
typedef struct radvisory $Radvisory_t;
typedef struct fbootstraptransfer $Fbootstraptransfer_t;
typedef struct log2phys $Log2phys_t;
typedef struct dirent $Dirent;
// 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),
$SizeofIfmaMsghdr = sizeof(struct ifma_msghdr),
$SizeofIfmaMsghdr2 = sizeof(struct ifma_msghdr2),
$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 ifma_msghdr $IfmaMsghdr;
typedef struct ifma_msghdr2 $IfmaMsghdr2;
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;
// 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 cgo -godefs. See also mkerrors.sh and mkall.sh
*/
// +build ignore
// +godefs map struct_in_addr [4]byte /* in_addr */
// +godefs map struct_in6_addr [16]byte /* in6_addr */
package syscall
/*
#define __DARWIN_UNIX03 0
#define KERNEL
#define _DARWIN_USE_64_BIT_INODE
#include <dirent.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <mach/mach.h>
#include <mach/message.h>
#include <sys/event.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/param.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/types.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/if_var.h>
#include <net/route.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
enum {
sizeofPtr = sizeof(void*),
};
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)];
};
*/
import "C"
// Machine characteristics; for internal use.
const (
sizeofPtr = C.sizeofPtr
sizeofShort = C.sizeof_short
sizeofInt = C.sizeof_int
sizeofLong = C.sizeof_long
sizeofLongLong = C.sizeof_longlong
)
// Basic types
type (
_C_short C.short
_C_int C.int
_C_long C.long
_C_long_long C.longlong
)
// Time
type Timespec C.struct_timespec
type Timeval C.struct_timeval
type Timeval32 C.struct_timeval32
// Processes
type Rusage C.struct_rusage
type Rlimit C.struct_rlimit
type _Gid_t C.gid_t
// Files
const (
O_CLOEXEC = 0 // not supported
)
type Stat_t C.struct_stat64
type Statfs_t C.struct_statfs64
type Flock_t C.struct_flock
type Fstore_t C.struct_fstore
type Radvisory_t C.struct_radvisory
type Fbootstraptransfer_t C.struct_fbootstraptransfer
type Log2phys_t C.struct_log2phys
type Fsid C.struct_fsid
type Dirent C.struct_dirent
// Sockets
type RawSockaddrInet4 C.struct_sockaddr_in
type RawSockaddrInet6 C.struct_sockaddr_in6
type RawSockaddrUnix C.struct_sockaddr_un
type RawSockaddrDatalink C.struct_sockaddr_dl
type RawSockaddr C.struct_sockaddr
type RawSockaddrAny C.struct_sockaddr_any
type _Socklen C.socklen_t
type Linger C.struct_linger
type Iovec C.struct_iovec
type IPMreq C.struct_ip_mreq
type IPv6Mreq C.struct_ipv6_mreq
type Msghdr C.struct_msghdr
type Cmsghdr C.struct_cmsghdr
type Inet6Pktinfo C.struct_in6_pktinfo
const (
SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
SizeofLinger = C.sizeof_struct_linger
SizeofIPMreq = C.sizeof_struct_ip_mreq
SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
SizeofMsghdr = C.sizeof_struct_msghdr
SizeofCmsghdr = C.sizeof_struct_cmsghdr
SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
)
// Ptrace requests
const (
PTRACE_TRACEME = C.PT_TRACE_ME
PTRACE_CONT = C.PT_CONTINUE
PTRACE_KILL = C.PT_KILL
)
// Events (kqueue, kevent)
type Kevent_t C.struct_kevent
// Select
type FdSet C.fd_set
// Routing and interface messages
const (
SizeofIfMsghdr = C.sizeof_struct_if_msghdr
SizeofIfData = C.sizeof_struct_if_data
SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2
SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
SizeofRtMetrics = C.sizeof_struct_rt_metrics
)
type IfMsghdr C.struct_if_msghdr
type IfData C.struct_if_data
type IfaMsghdr C.struct_ifa_msghdr
type IfmaMsghdr C.struct_ifma_msghdr
type IfmaMsghdr2 C.struct_ifma_msghdr2
type RtMsghdr C.struct_rt_msghdr
type RtMetrics C.struct_rt_metrics
// Berkeley packet filter
const (
SizeofBpfVersion = C.sizeof_struct_bpf_version
SizeofBpfStat = C.sizeof_struct_bpf_stat
SizeofBpfProgram = C.sizeof_struct_bpf_program
SizeofBpfInsn = C.sizeof_struct_bpf_insn
SizeofBpfHdr = C.sizeof_struct_bpf_hdr
)
type BpfVersion C.struct_bpf_version
type BpfStat C.struct_bpf_stat
type BpfProgram C.struct_bpf_program
type BpfInsn C.struct_bpf_insn
type BpfHdr C.struct_bpf_hdr
// 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/event.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/param.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/types.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/route.h>
#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 {
$O_CLOEXEC = 0, // not supported
};
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 ip_mreqn $IPMreqn;
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),
$SizeofIPMreqn = sizeof(struct ip_mreqn),
$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),
$SizeofIfmaMsghdr = sizeof(struct ifma_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 ifma_msghdr $IfmaMsghdr;
typedef struct rt_msghdr $RtMsghdr;
typedef struct rt_metrics $RtMetrics;
// Berkeley packet filter
enum {
$SizeofBpfVersion = sizeof(struct bpf_version),
$SizeofBpfStat = sizeof(struct bpf_stat),
$SizeofBpfZbuf = sizeof(struct bpf_zbuf),
$SizeofBpfProgram = sizeof(struct bpf_program),
$SizeofBpfInsn = sizeof(struct bpf_insn),
$SizeofBpfHdr = sizeof(struct bpf_hdr),
$SizeofBpfZbufHeader = sizeof(struct bpf_zbuf_header),
};
typedef struct bpf_version $BpfVersion;
typedef struct bpf_stat $BpfStat;
typedef struct bpf_zbuf $BpfZbuf;
typedef struct bpf_program $BpfProgram;
typedef struct bpf_insn $BpfInsn;
typedef struct bpf_hdr $BpfHdr;
typedef struct bpf_zbuf_header $BpfZbufHeader;
// 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 cgo -godefs. See also mkerrors.sh and mkall.sh
*/
// +build ignore
// +godefs map struct_in_addr [4]byte /* in_addr */
// +godefs map struct_in6_addr [16]byte /* in6_addr */
package syscall
/*
#define KERNEL
#include <dirent.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/event.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/param.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/types.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/route.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
enum {
sizeofPtr = sizeof(void*),
};
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)];
};
*/
import "C"
// Machine characteristics; for internal use.
const (
sizeofPtr = C.sizeofPtr
sizeofShort = C.sizeof_short
sizeofInt = C.sizeof_int
sizeofLong = C.sizeof_long
sizeofLongLong = C.sizeof_longlong
)
// Basic types
type (
_C_short C.short
_C_int C.int
_C_long C.long
_C_long_long C.longlong
)
// Time
type Timespec C.struct_timespec
type Timeval C.struct_timeval
// Processes
type Rusage C.struct_rusage
type Rlimit C.struct_rlimit
type _Gid_t C.gid_t
// Files
const (
O_CLOEXEC = 0 // not supported
)
const ( // Directory mode bits
S_IFMT = C.S_IFMT
S_IFIFO = C.S_IFIFO
S_IFCHR = C.S_IFCHR
S_IFDIR = C.S_IFDIR
S_IFBLK = C.S_IFBLK
S_IFREG = C.S_IFREG
S_IFLNK = C.S_IFLNK
S_IFSOCK = C.S_IFSOCK
S_ISUID = C.S_ISUID
S_ISGID = C.S_ISGID
S_ISVTX = C.S_ISVTX
S_IRUSR = C.S_IRUSR
S_IWUSR = C.S_IWUSR
S_IXUSR = C.S_IXUSR
)
type Stat_t C.struct_stat
type Statfs_t C.struct_statfs
type Flock_t C.struct_flock
type Dirent C.struct_dirent
type Fsid C.struct_fsid
// Sockets
type RawSockaddrInet4 C.struct_sockaddr_in
type RawSockaddrInet6 C.struct_sockaddr_in6
type RawSockaddrUnix C.struct_sockaddr_un
type RawSockaddrDatalink C.struct_sockaddr_dl
type RawSockaddr C.struct_sockaddr
type RawSockaddrAny C.struct_sockaddr_any
type _Socklen C.socklen_t
type Linger C.struct_linger
type Iovec C.struct_iovec
type IPMreq C.struct_ip_mreq
type IPMreqn C.struct_ip_mreqn
type IPv6Mreq C.struct_ipv6_mreq
type Msghdr C.struct_msghdr
type Cmsghdr C.struct_cmsghdr
type Inet6Pktinfo C.struct_in6_pktinfo
const (
SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
SizeofLinger = C.sizeof_struct_linger
SizeofIPMreq = C.sizeof_struct_ip_mreq
SizeofIPMreqn = C.sizeof_struct_ip_mreqn
SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
SizeofMsghdr = C.sizeof_struct_msghdr
SizeofCmsghdr = C.sizeof_struct_cmsghdr
SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
)
// Ptrace requests
const (
PTRACE_TRACEME = C.PT_TRACE_ME
PTRACE_CONT = C.PT_CONTINUE
PTRACE_KILL = C.PT_KILL
)
// Events (kqueue, kevent)
type Kevent_t C.struct_kevent
// Select
type FdSet C.fd_set
// Routing and interface messages
const (
SizeofIfMsghdr = C.sizeof_struct_if_msghdr
SizeofIfData = C.sizeof_struct_if_data
SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
SizeofRtMetrics = C.sizeof_struct_rt_metrics
)
type IfMsghdr C.struct_if_msghdr
type IfData C.struct_if_data
type IfaMsghdr C.struct_ifa_msghdr
type IfmaMsghdr C.struct_ifma_msghdr
type RtMsghdr C.struct_rt_msghdr
type RtMetrics C.struct_rt_metrics
// Berkeley packet filter
const (
SizeofBpfVersion = C.sizeof_struct_bpf_version
SizeofBpfStat = C.sizeof_struct_bpf_stat
SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf
SizeofBpfProgram = C.sizeof_struct_bpf_program
SizeofBpfInsn = C.sizeof_struct_bpf_insn
SizeofBpfHdr = C.sizeof_struct_bpf_hdr
SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header
)
type BpfVersion C.struct_bpf_version
type BpfStat C.struct_bpf_stat
type BpfZbuf C.struct_bpf_zbuf
type BpfProgram C.struct_bpf_program
type BpfInsn C.struct_bpf_insn
type BpfHdr C.struct_bpf_hdr
type BpfZbufHeader C.struct_bpf_zbuf_header
This diff is collapsed.
This diff is collapsed.
// 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;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -338,4 +338,8 @@ const (
SYS_PWRITEV = 334
SYS_RT_TGSIGQUEUEINFO = 335
SYS_PERF_EVENT_OPEN = 336
SYS_RECVMMSG = 337
SYS_FANOTIFY_INIT = 338
SYS_FANOTIFY_MARK = 339
SYS_PRLIMIT64 = 340
)
......@@ -303,4 +303,8 @@ const (
SYS_PWRITEV = 296
SYS_RT_TGSIGQUEUEINFO = 297
SYS_PERF_EVENT_OPEN = 298
SYS_RECVMMSG = 299
SYS_FANOTIFY_INIT = 300
SYS_FANOTIFY_MARK = 301
SYS_PRLIMIT64 = 302
)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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