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