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
// godefs -f -m32 defs.c
// Created by cgo -cdefs - DO NOT EDIT
// cgo -cdefs defs.go
// MACHINE GENERATED - DO NOT EDIT.
// Constants
enum {
PROT_NONE = 0,
PROT_NONE = 0x0,
PROT_READ = 0x1,
PROT_WRITE = 0x2,
PROT_EXEC = 0x4,
MAP_ANON = 0x1000,
MAP_PRIVATE = 0x2,
MAP_FIXED = 0x10,
MACH_MSG_TYPE_MOVE_RECEIVE = 0x10,
MACH_MSG_TYPE_MOVE_SEND = 0x11,
MACH_MSG_TYPE_MOVE_SEND_ONCE = 0x12,
......@@ -18,14 +19,18 @@ enum {
MACH_MSG_TYPE_MAKE_SEND = 0x14,
MACH_MSG_TYPE_MAKE_SEND_ONCE = 0x15,
MACH_MSG_TYPE_COPY_RECEIVE = 0x16,
MACH_MSG_PORT_DESCRIPTOR = 0,
MACH_MSG_PORT_DESCRIPTOR = 0x0,
MACH_MSG_OOL_DESCRIPTOR = 0x1,
MACH_MSG_OOL_PORTS_DESCRIPTOR = 0x2,
MACH_MSG_OOL_VOLATILE_DESCRIPTOR = 0x3,
MACH_MSGH_BITS_COMPLEX = 0x80000000,
MACH_SEND_MSG = 0x1,
MACH_RCV_MSG = 0x2,
MACH_RCV_LARGE = 0x4,
MACH_SEND_TIMEOUT = 0x10,
MACH_SEND_INTERRUPT = 0x40,
MACH_SEND_CANCEL = 0x80,
......@@ -35,16 +40,19 @@ enum {
MACH_RCV_NOTIFY = 0x200,
MACH_RCV_INTERRUPT = 0x400,
MACH_RCV_OVERWRITE = 0x1000,
NDR_PROTOCOL_2_0 = 0,
NDR_INT_BIG_ENDIAN = 0,
NDR_PROTOCOL_2_0 = 0x0,
NDR_INT_BIG_ENDIAN = 0x0,
NDR_INT_LITTLE_ENDIAN = 0x1,
NDR_FLOAT_IEEE = 0,
NDR_CHAR_ASCII = 0,
NDR_FLOAT_IEEE = 0x0,
NDR_CHAR_ASCII = 0x0,
SA_SIGINFO = 0x40,
SA_RESTART = 0x2,
SA_ONSTACK = 0x1,
SA_USERTRAMP = 0x100,
SA_64REGSET = 0x200,
SIGHUP = 0x1,
SIGINT = 0x2,
SIGQUIT = 0x3,
......@@ -76,6 +84,7 @@ enum {
SIGINFO = 0x1d,
SIGUSR1 = 0x1e,
SIGUSR2 = 0x1f,
FPE_INTDIV = 0x7,
FPE_INTOVF = 0x8,
FPE_FLTDIV = 0x1,
......@@ -84,25 +93,47 @@ enum {
FPE_FLTRES = 0x4,
FPE_FLTINV = 0x5,
FPE_FLTSUB = 0x6,
BUS_ADRALN = 0x1,
BUS_ADRERR = 0x2,
BUS_OBJERR = 0x3,
SEGV_MAPERR = 0x1,
SEGV_ACCERR = 0x2,
ITIMER_REAL = 0,
ITIMER_REAL = 0x0,
ITIMER_VIRTUAL = 0x1,
ITIMER_PROF = 0x2,
};
// Types
typedef struct MachBody MachBody;
typedef struct MachHeader MachHeader;
typedef struct MachNDR MachNDR;
typedef struct MachPort MachPort;
typedef struct StackT StackT;
typedef struct Sigaction Sigaction;
typedef struct Siginfo Siginfo;
typedef struct Timeval Timeval;
typedef struct Itimerval Itimerval;
typedef struct FPControl FPControl;
typedef struct FPStatus FPStatus;
typedef struct RegMMST RegMMST;
typedef struct RegXMM RegXMM;
typedef struct Regs64 Regs64;
typedef struct FloatState64 FloatState64;
typedef struct ExceptionState64 ExceptionState64;
typedef struct Mcontext64 Mcontext64;
typedef struct Regs32 Regs32;
typedef struct FloatState32 FloatState32;
typedef struct ExceptionState32 ExceptionState32;
typedef struct Mcontext32 Mcontext32;
typedef struct Ucontext Ucontext;
#pragma pack on
typedef struct MachBody MachBody;
struct MachBody {
uint32 msgh_descriptor_count;
};
typedef struct MachHeader MachHeader;
struct MachHeader {
uint32 msgh_bits;
uint32 msgh_size;
......@@ -111,8 +142,6 @@ struct MachHeader {
uint32 msgh_reserved;
int32 msgh_id;
};
typedef struct MachNDR MachNDR;
struct MachNDR {
uint8 mig_vers;
uint8 if_vers;
......@@ -123,8 +152,6 @@ struct MachNDR {
uint8 float_rep;
uint8 reserved2;
};
typedef struct MachPort MachPort;
struct MachPort {
uint32 name;
uint32 pad1;
......@@ -133,34 +160,21 @@ struct MachPort {
uint8 type;
};
typedef struct StackT StackT;
struct StackT {
void *ss_sp;
byte *ss_sp;
uint32 ss_size;
int32 ss_flags;
};
typedef byte Sighandler[4];
typedef union Sighandler Sighandler;
union Sighandler {
uint32 __sa_handler;
uint32 __sa_sigaction;
};
typedef struct Sigaction Sigaction;
struct Sigaction {
Sighandler __sigaction_u;
uint32 sa_tramp;
void *sa_tramp;
uint32 sa_mask;
int32 sa_flags;
};
typedef union Sigval Sigval;
union Sigval {
int32 sival_int;
void *sival_ptr;
};
typedef struct Siginfo Siginfo;
typedef byte Sigval[4];
struct Siginfo {
int32 si_signo;
int32 si_errno;
......@@ -168,47 +182,111 @@ struct Siginfo {
int32 si_pid;
uint32 si_uid;
int32 si_status;
void *si_addr;
byte *si_addr;
Sigval si_value;
int32 si_band;
uint32 __pad[7];
};
typedef struct Timeval Timeval;
struct Timeval {
int32 tv_sec;
int32 tv_usec;
};
typedef struct Itimerval Itimerval;
struct Itimerval {
Timeval it_interval;
Timeval it_value;
};
typedef struct FPControl FPControl;
struct FPControl {
byte pad_godefs_0[2];
byte Pad_godefs_0[2];
};
typedef struct FPStatus FPStatus;
struct FPStatus {
byte pad_godefs_0[2];
byte Pad_godefs_0[2];
};
typedef struct RegMMST RegMMST;
struct RegMMST {
int8 mmst_reg[10];
int8 mmst_rsrv[6];
};
typedef struct RegXMM RegXMM;
struct RegXMM {
int8 xmm_reg[16];
};
typedef struct Regs Regs;
struct Regs {
struct Regs64 {
uint64 rax;
uint64 rbx;
uint64 rcx;
uint64 rdx;
uint64 rdi;
uint64 rsi;
uint64 rbp;
uint64 rsp;
uint64 r8;
uint64 r9;
uint64 r10;
uint64 r11;
uint64 r12;
uint64 r13;
uint64 r14;
uint64 r15;
uint64 rip;
uint64 rflags;
uint64 cs;
uint64 fs;
uint64 gs;
};
struct FloatState64 {
int32 fpu_reserved[2];
FPControl fpu_fcw;
FPStatus fpu_fsw;
uint8 fpu_ftw;
uint8 fpu_rsrv1;
uint16 fpu_fop;
uint32 fpu_ip;
uint16 fpu_cs;
uint16 fpu_rsrv2;
uint32 fpu_dp;
uint16 fpu_ds;
uint16 fpu_rsrv3;
uint32 fpu_mxcsr;
uint32 fpu_mxcsrmask;
RegMMST fpu_stmm0;
RegMMST fpu_stmm1;
RegMMST fpu_stmm2;
RegMMST fpu_stmm3;
RegMMST fpu_stmm4;
RegMMST fpu_stmm5;
RegMMST fpu_stmm6;
RegMMST fpu_stmm7;
RegXMM fpu_xmm0;
RegXMM fpu_xmm1;
RegXMM fpu_xmm2;
RegXMM fpu_xmm3;
RegXMM fpu_xmm4;
RegXMM fpu_xmm5;
RegXMM fpu_xmm6;
RegXMM fpu_xmm7;
RegXMM fpu_xmm8;
RegXMM fpu_xmm9;
RegXMM fpu_xmm10;
RegXMM fpu_xmm11;
RegXMM fpu_xmm12;
RegXMM fpu_xmm13;
RegXMM fpu_xmm14;
RegXMM fpu_xmm15;
int8 fpu_rsrv4[96];
int32 fpu_reserved1;
};
struct ExceptionState64 {
uint32 trapno;
uint32 err;
uint64 faultvaddr;
};
struct Mcontext64 {
ExceptionState64 es;
Regs64 ss;
FloatState64 fs;
};
struct Regs32 {
uint32 eax;
uint32 ebx;
uint32 ecx;
......@@ -226,10 +304,8 @@ struct Regs {
uint32 fs;
uint32 gs;
};
typedef struct FloatState FloatState;
struct FloatState {
uint64 fpu_reserved;
struct FloatState32 {
int32 fpu_reserved[2];
FPControl fpu_fcw;
FPStatus fpu_fsw;
uint8 fpu_ftw;
......@@ -262,28 +338,25 @@ struct FloatState {
int8 fpu_rsrv4[224];
int32 fpu_reserved1;
};
typedef struct ExceptionState ExceptionState;
struct ExceptionState {
struct ExceptionState32 {
uint32 trapno;
uint32 err;
uint32 faultvaddr;
};
typedef struct Mcontext Mcontext;
struct Mcontext {
ExceptionState es;
Regs ss;
FloatState fs;
struct Mcontext32 {
ExceptionState32 es;
Regs32 ss;
FloatState32 fs;
};
typedef struct Ucontext Ucontext;
struct Ucontext {
int32 uc_onstack;
uint32 uc_sigmask;
StackT uc_stack;
uint32 uc_link;
Ucontext *uc_link;
uint32 uc_mcsize;
Mcontext *uc_mcontext;
Mcontext32 *uc_mcontext;
};
#pragma pack off
......@@ -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);
}
......
// godefs -f -m64 defs.c
// Created by cgo -cdefs - DO NOT EDIT
// cgo -cdefs defs.go
// MACHINE GENERATED - DO NOT EDIT.
// Constants
enum {
PROT_NONE = 0,
PROT_NONE = 0x0,
PROT_READ = 0x1,
PROT_WRITE = 0x2,
PROT_EXEC = 0x4,
MAP_ANON = 0x1000,
MAP_PRIVATE = 0x2,
MAP_FIXED = 0x10,
MACH_MSG_TYPE_MOVE_RECEIVE = 0x10,
MACH_MSG_TYPE_MOVE_SEND = 0x11,
MACH_MSG_TYPE_MOVE_SEND_ONCE = 0x12,
......@@ -18,14 +19,18 @@ enum {
MACH_MSG_TYPE_MAKE_SEND = 0x14,
MACH_MSG_TYPE_MAKE_SEND_ONCE = 0x15,
MACH_MSG_TYPE_COPY_RECEIVE = 0x16,
MACH_MSG_PORT_DESCRIPTOR = 0,
MACH_MSG_PORT_DESCRIPTOR = 0x0,
MACH_MSG_OOL_DESCRIPTOR = 0x1,
MACH_MSG_OOL_PORTS_DESCRIPTOR = 0x2,
MACH_MSG_OOL_VOLATILE_DESCRIPTOR = 0x3,
MACH_MSGH_BITS_COMPLEX = 0x80000000,
MACH_SEND_MSG = 0x1,
MACH_RCV_MSG = 0x2,
MACH_RCV_LARGE = 0x4,
MACH_SEND_TIMEOUT = 0x10,
MACH_SEND_INTERRUPT = 0x40,
MACH_SEND_CANCEL = 0x80,
......@@ -35,16 +40,19 @@ enum {
MACH_RCV_NOTIFY = 0x200,
MACH_RCV_INTERRUPT = 0x400,
MACH_RCV_OVERWRITE = 0x1000,
NDR_PROTOCOL_2_0 = 0,
NDR_INT_BIG_ENDIAN = 0,
NDR_PROTOCOL_2_0 = 0x0,
NDR_INT_BIG_ENDIAN = 0x0,
NDR_INT_LITTLE_ENDIAN = 0x1,
NDR_FLOAT_IEEE = 0,
NDR_CHAR_ASCII = 0,
NDR_FLOAT_IEEE = 0x0,
NDR_CHAR_ASCII = 0x0,
SA_SIGINFO = 0x40,
SA_RESTART = 0x2,
SA_ONSTACK = 0x1,
SA_USERTRAMP = 0x100,
SA_64REGSET = 0x200,
SIGHUP = 0x1,
SIGINT = 0x2,
SIGQUIT = 0x3,
......@@ -76,6 +84,7 @@ enum {
SIGINFO = 0x1d,
SIGUSR1 = 0x1e,
SIGUSR2 = 0x1f,
FPE_INTDIV = 0x7,
FPE_INTOVF = 0x8,
FPE_FLTDIV = 0x1,
......@@ -84,25 +93,47 @@ enum {
FPE_FLTRES = 0x4,
FPE_FLTINV = 0x5,
FPE_FLTSUB = 0x6,
BUS_ADRALN = 0x1,
BUS_ADRERR = 0x2,
BUS_OBJERR = 0x3,
SEGV_MAPERR = 0x1,
SEGV_ACCERR = 0x2,
ITIMER_REAL = 0,
ITIMER_REAL = 0x0,
ITIMER_VIRTUAL = 0x1,
ITIMER_PROF = 0x2,
};
// Types
typedef struct MachBody MachBody;
typedef struct MachHeader MachHeader;
typedef struct MachNDR MachNDR;
typedef struct MachPort MachPort;
typedef struct StackT StackT;
typedef struct Sigaction Sigaction;
typedef struct Siginfo Siginfo;
typedef struct Timeval Timeval;
typedef struct Itimerval Itimerval;
typedef struct FPControl FPControl;
typedef struct FPStatus FPStatus;
typedef struct RegMMST RegMMST;
typedef struct RegXMM RegXMM;
typedef struct Regs64 Regs64;
typedef struct FloatState64 FloatState64;
typedef struct ExceptionState64 ExceptionState64;
typedef struct Mcontext64 Mcontext64;
typedef struct Regs32 Regs32;
typedef struct FloatState32 FloatState32;
typedef struct ExceptionState32 ExceptionState32;
typedef struct Mcontext32 Mcontext32;
typedef struct Ucontext Ucontext;
#pragma pack on
typedef struct MachBody MachBody;
struct MachBody {
uint32 msgh_descriptor_count;
};
typedef struct MachHeader MachHeader;
struct MachHeader {
uint32 msgh_bits;
uint32 msgh_size;
......@@ -111,8 +142,6 @@ struct MachHeader {
uint32 msgh_reserved;
int32 msgh_id;
};
typedef struct MachNDR MachNDR;
struct MachNDR {
uint8 mig_vers;
uint8 if_vers;
......@@ -123,8 +152,6 @@ struct MachNDR {
uint8 float_rep;
uint8 reserved2;
};
typedef struct MachPort MachPort;
struct MachPort {
uint32 name;
uint32 pad1;
......@@ -133,35 +160,22 @@ struct MachPort {
uint8 type;
};
typedef struct StackT StackT;
struct StackT {
void *ss_sp;
byte *ss_sp;
uint64 ss_size;
int32 ss_flags;
byte pad_godefs_0[4];
byte Pad_godefs_0[4];
};
typedef byte Sighandler[8];
typedef union Sighandler Sighandler;
union Sighandler {
uint64 __sa_handler;
uint64 __sa_sigaction;
};
typedef struct Sigaction Sigaction;
struct Sigaction {
Sighandler __sigaction_u;
uint64 sa_tramp;
void *sa_tramp;
uint32 sa_mask;
int32 sa_flags;
};
typedef union Sigval Sigval;
union Sigval {
int32 sival_int;
void *sival_ptr;
};
typedef struct Siginfo Siginfo;
typedef byte Sigval[8];
struct Siginfo {
int32 si_signo;
int32 si_errno;
......@@ -169,48 +183,36 @@ struct Siginfo {
int32 si_pid;
uint32 si_uid;
int32 si_status;
void *si_addr;
byte *si_addr;
Sigval si_value;
int64 si_band;
uint64 __pad[7];
};
typedef struct Timeval Timeval;
struct Timeval {
int64 tv_sec;
int32 tv_usec;
byte pad_godefs_0[4];
byte Pad_godefs_0[4];
};
typedef struct Itimerval Itimerval;
struct Itimerval {
Timeval it_interval;
Timeval it_value;
};
typedef struct FPControl FPControl;
struct FPControl {
byte pad_godefs_0[2];
byte Pad_godefs_0[2];
};
typedef struct FPStatus FPStatus;
struct FPStatus {
byte pad_godefs_0[2];
byte Pad_godefs_0[2];
};
typedef struct RegMMST RegMMST;
struct RegMMST {
int8 mmst_reg[10];
int8 mmst_rsrv[6];
};
typedef struct RegXMM RegXMM;
struct RegXMM {
int8 xmm_reg[16];
};
typedef struct Regs Regs;
struct Regs {
struct Regs64 {
uint64 rax;
uint64 rbx;
uint64 rcx;
......@@ -233,10 +235,8 @@ struct Regs {
uint64 fs;
uint64 gs;
};
typedef struct FloatState FloatState;
struct FloatState {
uint64 fpu_reserved;
struct FloatState64 {
int32 fpu_reserved[2];
FPControl fpu_fcw;
FPStatus fpu_fsw;
uint8 fpu_ftw;
......@@ -277,29 +277,89 @@ struct FloatState {
int8 fpu_rsrv4[96];
int32 fpu_reserved1;
};
typedef struct ExceptionState ExceptionState;
struct ExceptionState {
struct ExceptionState64 {
uint32 trapno;
uint32 err;
uint64 faultvaddr;
};
struct Mcontext64 {
ExceptionState64 es;
Regs64 ss;
FloatState64 fs;
byte Pad_godefs_0[4];
};
typedef struct Mcontext Mcontext;
struct Mcontext {
ExceptionState es;
Regs ss;
FloatState fs;
byte pad_godefs_0[4];
struct Regs32 {
uint32 eax;
uint32 ebx;
uint32 ecx;
uint32 edx;
uint32 edi;
uint32 esi;
uint32 ebp;
uint32 esp;
uint32 ss;
uint32 eflags;
uint32 eip;
uint32 cs;
uint32 ds;
uint32 es;
uint32 fs;
uint32 gs;
};
struct FloatState32 {
int32 fpu_reserved[2];
FPControl fpu_fcw;
FPStatus fpu_fsw;
uint8 fpu_ftw;
uint8 fpu_rsrv1;
uint16 fpu_fop;
uint32 fpu_ip;
uint16 fpu_cs;
uint16 fpu_rsrv2;
uint32 fpu_dp;
uint16 fpu_ds;
uint16 fpu_rsrv3;
uint32 fpu_mxcsr;
uint32 fpu_mxcsrmask;
RegMMST fpu_stmm0;
RegMMST fpu_stmm1;
RegMMST fpu_stmm2;
RegMMST fpu_stmm3;
RegMMST fpu_stmm4;
RegMMST fpu_stmm5;
RegMMST fpu_stmm6;
RegMMST fpu_stmm7;
RegXMM fpu_xmm0;
RegXMM fpu_xmm1;
RegXMM fpu_xmm2;
RegXMM fpu_xmm3;
RegXMM fpu_xmm4;
RegXMM fpu_xmm5;
RegXMM fpu_xmm6;
RegXMM fpu_xmm7;
int8 fpu_rsrv4[224];
int32 fpu_reserved1;
};
struct ExceptionState32 {
uint32 trapno;
uint32 err;
uint32 faultvaddr;
};
struct Mcontext32 {
ExceptionState32 es;
Regs32 ss;
FloatState32 fs;
};
typedef struct Ucontext Ucontext;
struct Ucontext {
int32 uc_onstack;
uint32 uc_sigmask;
StackT uc_stack;
uint64 uc_link;
Ucontext *uc_link;
uint64 uc_mcsize;
Mcontext *uc_mcontext;
Mcontext64 *uc_mcontext;
};
#pragma pack off
......@@ -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_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,
......@@ -45,6 +47,7 @@ enum {
SIGIO = 0x1d,
SIGPWR = 0x1e,
SIGSYS = 0x1f,
FPE_INTDIV = 0x1,
FPE_INTOVF = 0x2,
FPE_FLTDIV = 0x3,
......@@ -53,40 +56,49 @@ enum {
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_REAL = 0x0,
ITIMER_VIRTUAL = 0x1,
ITIMER_PROF = 0x2,
O_RDONLY = 0,
O_CLOEXEC = 02000000,
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;
};
typedef struct Fpxreg Fpxreg;
struct Fpxreg {
uint16 significand[4];
uint16 exponent;
uint16 padding[3];
};
typedef struct Xmmreg Xmmreg;
struct Xmmreg {
uint32 element[4];
};
typedef struct Fpstate Fpstate;
struct Fpstate {
uint32 cw;
uint32 sw;
......@@ -104,45 +116,33 @@ struct Fpstate {
Fpxreg _fxsr_st[8];
Xmmreg _xmm[8];
uint32 padding1[44];
byte Pad_godefs_0[48];
byte anon0[48];
};
typedef struct Timespec Timespec;
struct Timespec {
int32 tv_sec;
int32 tv_nsec;
};
typedef struct Timeval Timeval;
struct Timeval {
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;
};
typedef struct Siginfo Siginfo;
struct Siginfo {
int32 si_signo;
int32 si_errno;
int32 si_code;
byte _sifields[116];
};
typedef struct Sigaltstack Sigaltstack;
struct Sigaltstack {
void *ss_sp;
byte *ss_sp;
int32 ss_flags;
uint32 ss_size;
};
typedef struct Sigcontext Sigcontext;
struct Sigcontext {
uint16 gs;
uint16 __gsh;
......@@ -173,8 +173,6 @@ struct Sigcontext {
uint32 oldmask;
uint32 cr2;
};
typedef struct Ucontext Ucontext;
struct Ucontext {
uint32 uc_flags;
Ucontext *uc_link;
......@@ -182,10 +180,10 @@ struct Ucontext {
Sigcontext uc_mcontext;
uint32 uc_sigmask;
};
typedef struct Itimerval Itimerval;
struct Itimerval {
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_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,
......@@ -45,6 +47,7 @@ enum {
SIGIO = 0x1d,
SIGPWR = 0x1e,
SIGSYS = 0x1f,
FPE_INTDIV = 0x1,
FPE_INTOVF = 0x2,
FPE_FLTDIV = 0x3,
......@@ -53,83 +56,90 @@ enum {
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_REAL = 0x0,
ITIMER_VIRTUAL = 0x1,
ITIMER_PROF = 0x2,
O_RDONLY = 0,
O_CLOEXEC = 02000000,
};
// Types
typedef struct Timespec Timespec;
typedef struct Timeval Timeval;
typedef struct Sigaction Sigaction;
typedef struct Siginfo Siginfo;
typedef struct Itimerval Itimerval;
#pragma pack on
typedef struct Timespec Timespec;
struct Timespec {
int64 tv_sec;
int64 tv_nsec;
};
typedef struct Timeval Timeval;
struct Timeval {
int64 tv_sec;
int64 tv_usec;
};
typedef struct Sigaction Sigaction;
struct Sigaction {
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 Pad_godefs_0[4];
byte _sifields[112];
};
typedef struct Itimerval Itimerval;
struct Itimerval {
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];
};
typedef struct Fpxreg Fpxreg;
struct Fpxreg {
uint16 significand[4];
uint16 exponent;
uint16 padding[3];
};
typedef struct Xmmreg Xmmreg;
struct Xmmreg {
uint32 element[4];
};
typedef struct Fpstate Fpstate;
struct Fpstate {
uint16 cwd;
uint16 swd;
......@@ -143,20 +153,14 @@ struct Fpstate {
Xmmreg _xmm[16];
uint32 padding[24];
};
typedef struct Fpxreg1 Fpxreg1;
struct Fpxreg1 {
uint16 significand[4];
uint16 exponent;
uint16 padding[3];
};
typedef struct Xmmreg1 Xmmreg1;
struct Xmmreg1 {
uint32 element[4];
};
typedef struct Fpstate1 Fpstate1;
struct Fpstate1 {
uint16 cwd;
uint16 swd;
......@@ -170,29 +174,21 @@ struct Fpstate1 {
Xmmreg1 _xmm[16];
uint32 padding[24];
};
typedef struct Fpreg1 Fpreg1;
struct Fpreg1 {
uint16 significand[4];
uint16 exponent;
};
typedef struct Sigaltstack Sigaltstack;
struct Sigaltstack {
void *ss_sp;
byte *ss_sp;
int32 ss_flags;
byte pad_godefs_0[4];
byte Pad_godefs_0[4];
uint64 ss_size;
};
typedef struct Mcontext Mcontext;
struct Mcontext {
int64 gregs[23];
Fpstate *fpregs;
uint64 __reserved1[8];
};
typedef struct Ucontext Ucontext;
struct Ucontext {
uint64 uc_flags;
Ucontext *uc_link;
......@@ -201,8 +197,6 @@ struct Ucontext {
Usigset uc_sigmask;
Fpstate __fpregs_mem;
};
typedef struct Sigcontext Sigcontext;
struct Sigcontext {
uint64 r8;
uint64 r9;
......@@ -233,4 +227,6 @@ struct Sigcontext {
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
// 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 _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#define _GNU_SOURCE
#include <dirent.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netpacket/packet.h>
#include <signal.h>
#include <stdio.h>
#include <sys/epoll.h>
#include <sys/inotify.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/stat.h>
#include <sys/statfs.h>
#include <sys/sysinfo.h>
#include <sys/time.h>
#include <sys/times.h>
#include <sys/timex.h>
#include <sys/types.h>
#include <sys/un.h>
#include <sys/user.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <linux/filter.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
#include <ustat.h>
#include <utime.h>
// Machine characteristics; for internal use.
enum {
$sizeofPtr = sizeof(void*),
$sizeofShort = sizeof(short),
$sizeofInt = sizeof(int),
$sizeofLong = sizeof(long),
$sizeofLongLong = sizeof(long long),
$PathMax = PATH_MAX,
};
// 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 timex $Timex;
typedef time_t $Time_t;
typedef struct tms $Tms;
typedef struct utimbuf $Utimbuf;
// Processes
typedef struct rusage $Rusage;
typedef struct rlimit $Rlimit;
typedef gid_t $_Gid_t;
// Files
typedef struct stat $Stat_t;
typedef struct statfs $Statfs_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_ll s5;
struct sockaddr_nl s6;
};
struct sockaddr_any {
struct sockaddr addr;
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
};
// copied from /usr/include/linux/un.h
struct my_sockaddr_un {
sa_family_t sun_family;
#ifdef __ARM_EABI__
// on ARM char is by default unsigned
signed char sun_path[108];
#else
char sun_path[108];
#endif
};
typedef struct sockaddr_in $RawSockaddrInet4;
typedef struct sockaddr_in6 $RawSockaddrInet6;
typedef struct my_sockaddr_un $RawSockaddrUnix;
typedef struct sockaddr_ll $RawSockaddrLinklayer;
typedef struct sockaddr_nl $RawSockaddrNetlink;
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 in_pktinfo $Inet4Pktinfo;
typedef struct in6_pktinfo $Inet6Pktinfo;
typedef struct ucred $Ucred;
enum {
$SizeofSockaddrInet4 = sizeof(struct sockaddr_in),
$SizeofSockaddrInet6 = sizeof(struct sockaddr_in6),
$SizeofSockaddrAny = sizeof(struct sockaddr_any),
$SizeofSockaddrUnix = sizeof(struct sockaddr_un),
$SizeofSockaddrLinklayer = sizeof(struct sockaddr_ll),
$SizeofSockaddrNetlink = sizeof(struct sockaddr_nl),
$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),
$SizeofInet4Pktinfo = sizeof(struct in_pktinfo),
$SizeofInet6Pktinfo = sizeof(struct in6_pktinfo),
$SizeofUcred = sizeof(struct ucred),
};
// Netlink routing and interface messages
enum {
$IFA_UNSPEC = IFA_UNSPEC,
$IFA_ADDRESS = IFA_ADDRESS,
$IFA_LOCAL = IFA_LOCAL,
$IFA_LABEL = IFA_LABEL,
$IFA_BROADCAST = IFA_BROADCAST,
$IFA_ANYCAST = IFA_ANYCAST,
$IFA_CACHEINFO = IFA_CACHEINFO,
$IFA_MULTICAST = IFA_MULTICAST,
$IFLA_UNSPEC = IFLA_UNSPEC,
$IFLA_ADDRESS = IFLA_ADDRESS,
$IFLA_BROADCAST = IFLA_BROADCAST,
$IFLA_IFNAME = IFLA_IFNAME,
$IFLA_MTU = IFLA_MTU,
$IFLA_LINK = IFLA_LINK,
$IFLA_QDISC = IFLA_QDISC,
$IFLA_STATS = IFLA_STATS,
$IFLA_COST = IFLA_COST,
$IFLA_PRIORITY = IFLA_PRIORITY,
$IFLA_MASTER = IFLA_MASTER,
$IFLA_WIRELESS = IFLA_WIRELESS,
$IFLA_PROTINFO = IFLA_PROTINFO,
$IFLA_TXQLEN = IFLA_TXQLEN,
$IFLA_MAP = IFLA_MAP,
$IFLA_WEIGHT = IFLA_WEIGHT,
$IFLA_OPERSTATE = IFLA_OPERSTATE,
$IFLA_LINKMODE = IFLA_LINKMODE,
$IFLA_LINKINFO = IFLA_LINKINFO,
$IFLA_NET_NS_PID = IFLA_NET_NS_PID,
$IFLA_IFALIAS = IFLA_IFALIAS,
$IFLA_MAX = IFLA_MAX,
$RT_SCOPE_UNIVERSE = RT_SCOPE_UNIVERSE,
$RT_SCOPE_SITE = RT_SCOPE_SITE,
$RT_SCOPE_LINK = RT_SCOPE_LINK,
$RT_SCOPE_HOST = RT_SCOPE_HOST,
$RT_SCOPE_NOWHERE = RT_SCOPE_NOWHERE,
$RT_TABLE_UNSPEC = RT_TABLE_UNSPEC,
$RT_TABLE_COMPAT = RT_TABLE_COMPAT,
$RT_TABLE_DEFAULT = RT_TABLE_DEFAULT,
$RT_TABLE_MAIN = RT_TABLE_MAIN,
$RT_TABLE_LOCAL = RT_TABLE_LOCAL,
$RT_TABLE_MAX = RT_TABLE_MAX,
$RTA_UNSPEC = RTA_UNSPEC,
$RTA_DST = RTA_DST,
$RTA_SRC = RTA_SRC,
$RTA_IIF = RTA_IIF,
$RTA_OIF = RTA_OIF,
$RTA_GATEWAY = RTA_GATEWAY,
$RTA_PRIORITY = RTA_PRIORITY,
$RTA_PREFSRC = RTA_PREFSRC,
$RTA_METRICS = RTA_METRICS,
$RTA_MULTIPATH = RTA_MULTIPATH,
$RTA_FLOW = RTA_FLOW,
$RTA_CACHEINFO = RTA_CACHEINFO,
$RTA_TABLE = RTA_TABLE,
$RTN_UNSPEC = RTN_UNSPEC,
$RTN_UNICAST = RTN_UNICAST,
$RTN_LOCAL = RTN_LOCAL,
$RTN_BROADCAST = RTN_BROADCAST,
$RTN_ANYCAST = RTN_ANYCAST,
$RTN_MULTICAST = RTN_MULTICAST,
$RTN_BLACKHOLE = RTN_BLACKHOLE,
$RTN_UNREACHABLE = RTN_UNREACHABLE,
$RTN_PROHIBIT = RTN_PROHIBIT,
$RTN_THROW = RTN_THROW,
$RTN_NAT = RTN_NAT,
$RTN_XRESOLVE = RTN_XRESOLVE,
$SizeofNlMsghdr = sizeof(struct nlmsghdr),
$SizeofNlMsgerr = sizeof(struct nlmsgerr),
$SizeofRtGenmsg = sizeof(struct rtgenmsg),
$SizeofNlAttr = sizeof(struct nlattr),
$SizeofRtAttr = sizeof(struct rtattr),
$SizeofIfInfomsg = sizeof(struct ifinfomsg),
$SizeofIfAddrmsg = sizeof(struct ifaddrmsg),
$SizeofRtMsg = sizeof(struct rtmsg),
$SizeofRtNexthop = sizeof(struct rtnexthop),
};
typedef struct nlmsghdr $NlMsghdr;
typedef struct nlmsgerr $NlMsgerr;
typedef struct rtgenmsg $RtGenmsg;
typedef struct nlattr $NlAttr;
typedef struct rtattr $RtAttr;
typedef struct ifinfomsg $IfInfomsg;
typedef struct ifaddrmsg $IfAddrmsg;
typedef struct rtmsg $RtMsg;
typedef struct rtnexthop $RtNexthop;
// Linux socket filter
enum {
$SizeofSockFilter = sizeof(struct sock_filter),
$SizeofSockFprog = sizeof(struct sock_fprog),
};
typedef struct sock_filter $SockFilter;
typedef struct sock_fprog $SockFprog;
// Inotify
typedef struct inotify_event $InotifyEvent;
enum {
$SizeofInotifyEvent = sizeof(struct inotify_event)
};
// Ptrace
// Register structures
#ifdef __ARM_EABI__
typedef struct user_regs $PtraceRegs;
#else
typedef struct user_regs_struct $PtraceRegs;
#endif
// Misc
typedef fd_set $FdSet;
typedef struct sysinfo $Sysinfo_t;
typedef struct utsname $Utsname;
typedef struct ustat $Ustat_t;
// The real epoll_event is a union, and godefs doesn't handle it well.
struct my_epoll_event {
uint32_t events;
#ifdef __ARM_EABI__
// padding is not specified in linux/eventpoll.h but added to conform to the
// alignment requirements of EABI
int32_t padFd;
#endif
int32_t fd;
int32_t pad;
};
typedef struct my_epoll_event $EpollEvent;
// Terminal handling
typedef struct termios $Termios;
enum {
$VINTR = VINTR,
$VQUIT = VQUIT,
$VERASE = VERASE,
$VKILL = VKILL,
$VEOF = VEOF,
$VTIME = VTIME,
$VMIN = VMIN,
$VSWTC = VSWTC,
$VSTART = VSTART,
$VSTOP = VSTOP,
$VSUSP = VSUSP,
$VEOL = VEOL,
$VREPRINT = VREPRINT,
$VDISCARD = VDISCARD,
$VWERASE = VWERASE,
$VLNEXT = VLNEXT,
$VEOL2 = VEOL2,
$IGNBRK = IGNBRK,
$BRKINT = BRKINT,
$IGNPAR = IGNPAR,
$PARMRK = PARMRK,
$INPCK = INPCK,
$ISTRIP = ISTRIP,
$INLCR = INLCR,
$IGNCR = IGNCR,
$ICRNL = ICRNL,
$IUCLC = IUCLC,
$IXON = IXON,
$IXANY = IXANY,
$IXOFF = IXOFF,
$IMAXBEL = IMAXBEL,
$IUTF8 = IUTF8,
$OPOST = OPOST,
$OLCUC = OLCUC,
$ONLCR = ONLCR,
$OCRNL = OCRNL,
$ONOCR = ONOCR,
$ONLRET = ONLRET,
$OFILL = OFILL,
$OFDEL = OFDEL,
$B0 = B0,
$B50 = B50,
$B75 = B75,
$B110 = B110,
$B134 = B134,
$B150 = B150,
$B200 = B200,
$B300 = B300,
$B600 = B600,
$B1200 = B1200,
$B1800 = B1800,
$B2400 = B2400,
$B4800 = B4800,
$B9600 = B9600,
$B19200 = B19200,
$B38400 = B38400,
$CSIZE = CSIZE,
$CS5 = CS5,
$CS6 = CS6,
$CS7 = CS7,
$CS8 = CS8,
$CSTOPB = CSTOPB,
$CREAD = CREAD,
$PARENB = PARENB,
$PARODD = PARODD,
$HUPCL = HUPCL,
$CLOCAL = CLOCAL,
$B57600 = B57600,
$B115200 = B115200,
$B230400 = B230400,
$B460800 = B460800,
$B500000 = B500000,
$B576000 = B576000,
$B921600 = B921600,
$B1000000 = B1000000,
$B1152000 = B1152000,
$B1500000 = B1500000,
$B2000000 = B2000000,
$B2500000 = B2500000,
$B3000000 = B3000000,
$B3500000 = B3500000,
$B4000000 = B4000000,
$ISIG = ISIG,
$ICANON = ICANON,
$XCASE = XCASE,
$ECHO = ECHO,
$ECHOE = ECHOE,
$ECHOK = ECHOK,
$ECHONL = ECHONL,
$NOFLSH = NOFLSH,
$TOSTOP = TOSTOP,
$ECHOCTL = ECHOCTL,
$ECHOPRT = ECHOPRT,
$ECHOKE = ECHOKE,
$FLUSHO = FLUSHO,
$PENDIN = PENDIN,
$IEXTEN = IEXTEN,
$TCGETS = TCGETS,
$TCSETS = TCSETS,
};
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.
// mkerrors.sh -f -m32
// mkerrors.sh -m32
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// godefs -c gcc -f -m32 -gsyscall -f -m32 _const.c
// MACHINE GENERATED - DO NOT EDIT.
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs -- -m32 _const.go
package syscall
// Constants
const (
AF_APPLETALK = 0x10
AF_CCITT = 0xa
......@@ -44,7 +42,7 @@ const (
AF_SNA = 0xb
AF_SYSTEM = 0x20
AF_UNIX = 0x1
AF_UNSPEC = 0
AF_UNSPEC = 0x0
BIOCFLUSH = 0x20004268
BIOCGBLEN = 0x40044266
BIOCGDLT = 0x4004426a
......@@ -68,23 +66,23 @@ const (
BIOCVERSION = 0x40044271
BPF_A = 0x10
BPF_ABS = 0x20
BPF_ADD = 0
BPF_ADD = 0x0
BPF_ALIGNMENT = 0x4
BPF_ALU = 0x4
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
BPF_H = 0x8
BPF_IMM = 0
BPF_IMM = 0x0
BPF_IND = 0x40
BPF_JA = 0
BPF_JA = 0x0
BPF_JEQ = 0x10
BPF_JGE = 0x30
BPF_JGT = 0x20
BPF_JMP = 0x5
BPF_JSET = 0x40
BPF_K = 0
BPF_LD = 0
BPF_K = 0x0
BPF_LD = 0x0
BPF_LDX = 0x1
BPF_LEN = 0x80
BPF_LSH = 0x60
......@@ -106,9 +104,9 @@ const (
BPF_ST = 0x2
BPF_STX = 0x3
BPF_SUB = 0x10
BPF_TAX = 0
BPF_TAX = 0x0
BPF_TXA = 0x80
BPF_W = 0
BPF_W = 0x0
BPF_X = 0x8
CTL_MAXNAME = 0xc
CTL_NET = 0x4
......@@ -129,7 +127,7 @@ const (
DLT_IEEE802_11_RADIO_AVS = 0xa3
DLT_LINUX_SLL = 0x71
DLT_LOOP = 0x6c
DLT_NULL = 0
DLT_NULL = 0x0
DLT_PFLOG = 0x75
DLT_PFSYNC = 0x12
DLT_PPP = 0x9
......@@ -146,7 +144,7 @@ const (
DT_LNK = 0xa
DT_REG = 0x8
DT_SOCK = 0xc
DT_UNKNOWN = 0
DT_UNKNOWN = 0x0
DT_WHT = 0xe
E2BIG = 0x7
EACCES = 0xd
......@@ -299,7 +297,7 @@ const (
F_ALLOCATEALL = 0x4
F_ALLOCATECONTIG = 0x2
F_CHKCLEAN = 0x29
F_DUPFD = 0
F_DUPFD = 0x0
F_FREEZE_FS = 0x35
F_FULLFSYNC = 0x33
F_GETFD = 0x1
......@@ -463,7 +461,7 @@ const (
IPPROTO_GRE = 0x2f
IPPROTO_HELLO = 0x3f
IPPROTO_HMP = 0x14
IPPROTO_HOPOPTS = 0
IPPROTO_HOPOPTS = 0x0
IPPROTO_ICMP = 0x1
IPPROTO_ICMPV6 = 0x3a
IPPROTO_IDP = 0x16
......@@ -475,7 +473,7 @@ const (
IPPROTO_IL = 0x28
IPPROTO_INLSP = 0x34
IPPROTO_INP = 0x20
IPPROTO_IP = 0
IPPROTO_IP = 0x0
IPPROTO_IPCOMP = 0x6c
IPPROTO_IPCV = 0x47
IPPROTO_IPEIP = 0x5e
......@@ -569,14 +567,14 @@ const (
IPV6_PKTINFO = 0x13
IPV6_PKTOPTIONS = 0x19
IPV6_PORTRANGE = 0xe
IPV6_PORTRANGE_DEFAULT = 0
IPV6_PORTRANGE_DEFAULT = 0x0
IPV6_PORTRANGE_HIGH = 0x1
IPV6_PORTRANGE_LOW = 0x2
IPV6_RECVTCLASS = 0x23
IPV6_RTHDR = 0x18
IPV6_RTHDR_LOOSE = 0
IPV6_RTHDR_LOOSE = 0x0
IPV6_RTHDR_STRICT = 0x1
IPV6_RTHDR_TYPE_0 = 0
IPV6_RTHDR_TYPE_0 = 0x0
IPV6_SOCKOPT_RESERVED1 = 0x3
IPV6_TCLASS = 0x24
IPV6_UNICAST_HOPS = 0x4
......@@ -620,7 +618,7 @@ const (
IP_OLD_FW_ZERO = 0x35
IP_OPTIONS = 0x1
IP_PORTRANGE = 0x13
IP_PORTRANGE_DEFAULT = 0
IP_PORTRANGE_DEFAULT = 0x0
IP_PORTRANGE_HIGH = 0x1
IP_PORTRANGE_LOW = 0x2
IP_RECVDSTADDR = 0x7
......@@ -643,14 +641,14 @@ const (
MADV_FREE = 0x5
MADV_FREE_REUSABLE = 0x7
MADV_FREE_REUSE = 0x8
MADV_NORMAL = 0
MADV_NORMAL = 0x0
MADV_RANDOM = 0x1
MADV_SEQUENTIAL = 0x2
MADV_WILLNEED = 0x3
MADV_ZERO_WIRED_PAGES = 0x6
MAP_ANON = 0x1000
MAP_COPY = 0x2
MAP_FILE = 0
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_HASSEMAPHORE = 0x200
MAP_NOCACHE = 0x400
......@@ -708,7 +706,7 @@ const (
O_NOFOLLOW = 0x100
O_NONBLOCK = 0x4
O_POPUP = 0x80000000
O_RDONLY = 0
O_RDONLY = 0x0
O_RDWR = 0x2
O_SHLOCK = 0x10
O_SYMLINK = 0x200000
......@@ -716,7 +714,7 @@ const (
O_TRUNC = 0x400
O_WRONLY = 0x1
PROT_EXEC = 0x4
PROT_NONE = 0
PROT_NONE = 0x0
PROT_READ = 0x1
PROT_WRITE = 0x2
PT_ATTACH = 0xa
......@@ -733,13 +731,13 @@ const (
PT_SIGEXC = 0xc
PT_STEP = 0x9
PT_THUPDATE = 0xd
PT_TRACE_ME = 0
PT_TRACE_ME = 0x0
PT_WRITE_D = 0x5
PT_WRITE_I = 0x4
PT_WRITE_U = 0x6
RTAX_AUTHOR = 0x6
RTAX_BRD = 0x7
RTAX_DST = 0
RTAX_DST = 0x0
RTAX_GATEWAY = 0x1
RTAX_GENMASK = 0x3
RTAX_IFA = 0x5
......@@ -811,7 +809,7 @@ const (
SCM_CREDS = 0x3
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SHUT_RD = 0
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
SIGABRT = 0x6
......@@ -1045,7 +1043,7 @@ const (
TIOCNXCL = 0x2000740e
TIOCOUTQ = 0x40047473
TIOCPKT = 0x80047470
TIOCPKT_DATA = 0
TIOCPKT_DATA = 0x0
TIOCPKT_DOSTOP = 0x20
TIOCPKT_FLUSHREAD = 0x1
TIOCPKT_FLUSHWRITE = 0x2
......@@ -1085,8 +1083,6 @@ const (
WUNTRACED = 0x2
)
// Types
// Error table
var errors = [...]string{
1: "operation not permitted",
......
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