Black Lives Matter. Support the Equal Justice Initiative.

Source file src/runtime/defs_linux_386.go

Documentation: runtime

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

View as plain text