github.com/tidwall/go@v0.0.0-20170415222209-6694a6888b7d/src/runtime/defs_linux_386.go (about)

     1  // created by cgo -cdefs and then converted to Go
     2  // cgo -cdefs defs2_linux.go
     3  
     4  package runtime
     5  
     6  const (
     7  	_EINTR  = 0x4
     8  	_EAGAIN = 0xb
     9  	_ENOMEM = 0xc
    10  
    11  	_PROT_NONE  = 0x0
    12  	_PROT_READ  = 0x1
    13  	_PROT_WRITE = 0x2
    14  	_PROT_EXEC  = 0x4
    15  
    16  	_MAP_ANON    = 0x20
    17  	_MAP_PRIVATE = 0x2
    18  	_MAP_FIXED   = 0x10
    19  
    20  	_MADV_DONTNEED   = 0x4
    21  	_MADV_HUGEPAGE   = 0xe
    22  	_MADV_NOHUGEPAGE = 0xf
    23  
    24  	_SA_RESTART  = 0x10000000
    25  	_SA_ONSTACK  = 0x8000000
    26  	_SA_RESTORER = 0x4000000
    27  	_SA_SIGINFO  = 0x4
    28  
    29  	_SIGHUP    = 0x1
    30  	_SIGINT    = 0x2
    31  	_SIGQUIT   = 0x3
    32  	_SIGILL    = 0x4
    33  	_SIGTRAP   = 0x5
    34  	_SIGABRT   = 0x6
    35  	_SIGBUS    = 0x7
    36  	_SIGFPE    = 0x8
    37  	_SIGKILL   = 0x9
    38  	_SIGUSR1   = 0xa
    39  	_SIGSEGV   = 0xb
    40  	_SIGUSR2   = 0xc
    41  	_SIGPIPE   = 0xd
    42  	_SIGALRM   = 0xe
    43  	_SIGSTKFLT = 0x10
    44  	_SIGCHLD   = 0x11
    45  	_SIGCONT   = 0x12
    46  	_SIGSTOP   = 0x13
    47  	_SIGTSTP   = 0x14
    48  	_SIGTTIN   = 0x15
    49  	_SIGTTOU   = 0x16
    50  	_SIGURG    = 0x17
    51  	_SIGXCPU   = 0x18
    52  	_SIGXFSZ   = 0x19
    53  	_SIGVTALRM = 0x1a
    54  	_SIGPROF   = 0x1b
    55  	_SIGWINCH  = 0x1c
    56  	_SIGIO     = 0x1d
    57  	_SIGPWR    = 0x1e
    58  	_SIGSYS    = 0x1f
    59  
    60  	_FPE_INTDIV = 0x1
    61  	_FPE_INTOVF = 0x2
    62  	_FPE_FLTDIV = 0x3
    63  	_FPE_FLTOVF = 0x4
    64  	_FPE_FLTUND = 0x5
    65  	_FPE_FLTRES = 0x6
    66  	_FPE_FLTINV = 0x7
    67  	_FPE_FLTSUB = 0x8
    68  
    69  	_BUS_ADRALN = 0x1
    70  	_BUS_ADRERR = 0x2
    71  	_BUS_OBJERR = 0x3
    72  
    73  	_SEGV_MAPERR = 0x1
    74  	_SEGV_ACCERR = 0x2
    75  
    76  	_ITIMER_REAL    = 0x0
    77  	_ITIMER_VIRTUAL = 0x1
    78  	_ITIMER_PROF    = 0x2
    79  
    80  	_O_RDONLY  = 0x0
    81  	_O_CLOEXEC = 0x80000
    82  
    83  	_EPOLLIN       = 0x1
    84  	_EPOLLOUT      = 0x4
    85  	_EPOLLERR      = 0x8
    86  	_EPOLLHUP      = 0x10
    87  	_EPOLLRDHUP    = 0x2000
    88  	_EPOLLET       = 0x80000000
    89  	_EPOLL_CLOEXEC = 0x80000
    90  	_EPOLL_CTL_ADD = 0x1
    91  	_EPOLL_CTL_DEL = 0x2
    92  	_EPOLL_CTL_MOD = 0x3
    93  
    94  	_AF_UNIX    = 0x1
    95  	_F_SETFL    = 0x4
    96  	_SOCK_DGRAM = 0x2
    97  )
    98  
    99  type fpreg struct {
   100  	significand [4]uint16
   101  	exponent    uint16
   102  }
   103  
   104  type fpxreg struct {
   105  	significand [4]uint16
   106  	exponent    uint16
   107  	padding     [3]uint16
   108  }
   109  
   110  type xmmreg struct {
   111  	element [4]uint32
   112  }
   113  
   114  type fpstate struct {
   115  	cw        uint32
   116  	sw        uint32
   117  	tag       uint32
   118  	ipoff     uint32
   119  	cssel     uint32
   120  	dataoff   uint32
   121  	datasel   uint32
   122  	_st       [8]fpreg
   123  	status    uint16
   124  	magic     uint16
   125  	_fxsr_env [6]uint32
   126  	mxcsr     uint32
   127  	reserved  uint32
   128  	_fxsr_st  [8]fpxreg
   129  	_xmm      [8]xmmreg
   130  	padding1  [44]uint32
   131  	anon0     [48]byte
   132  }
   133  
   134  type timespec struct {
   135  	tv_sec  int32
   136  	tv_nsec int32
   137  }
   138  
   139  func (ts *timespec) set_sec(x int64) {
   140  	ts.tv_sec = int32(x)
   141  }
   142  
   143  func (ts *timespec) set_nsec(x int32) {
   144  	ts.tv_nsec = x
   145  }
   146  
   147  type timeval struct {
   148  	tv_sec  int32
   149  	tv_usec int32
   150  }
   151  
   152  func (tv *timeval) set_usec(x int32) {
   153  	tv.tv_usec = x
   154  }
   155  
   156  type sigactiont struct {
   157  	sa_handler  uintptr
   158  	sa_flags    uint32
   159  	sa_restorer uintptr
   160  	sa_mask     uint64
   161  }
   162  
   163  type siginfo struct {
   164  	si_signo int32
   165  	si_errno int32
   166  	si_code  int32
   167  	// below here is a union; si_addr is the only field we use
   168  	si_addr uint32
   169  }
   170  
   171  type stackt struct {
   172  	ss_sp    *byte
   173  	ss_flags int32
   174  	ss_size  uintptr
   175  }
   176  
   177  type sigcontext struct {
   178  	gs            uint16
   179  	__gsh         uint16
   180  	fs            uint16
   181  	__fsh         uint16
   182  	es            uint16
   183  	__esh         uint16
   184  	ds            uint16
   185  	__dsh         uint16
   186  	edi           uint32
   187  	esi           uint32
   188  	ebp           uint32
   189  	esp           uint32
   190  	ebx           uint32
   191  	edx           uint32
   192  	ecx           uint32
   193  	eax           uint32
   194  	trapno        uint32
   195  	err           uint32
   196  	eip           uint32
   197  	cs            uint16
   198  	__csh         uint16
   199  	eflags        uint32
   200  	esp_at_signal uint32
   201  	ss            uint16
   202  	__ssh         uint16
   203  	fpstate       *fpstate
   204  	oldmask       uint32
   205  	cr2           uint32
   206  }
   207  
   208  type ucontext struct {
   209  	uc_flags    uint32
   210  	uc_link     *ucontext
   211  	uc_stack    stackt
   212  	uc_mcontext sigcontext
   213  	uc_sigmask  uint32
   214  }
   215  
   216  type itimerval struct {
   217  	it_interval timeval
   218  	it_value    timeval
   219  }
   220  
   221  type epollevent struct {
   222  	events uint32
   223  	data   [8]byte // to match amd64
   224  }
   225  
   226  type sockaddr_un struct {
   227  	family uint16
   228  	path   [108]byte
   229  }