...
Run Format

Source file src/runtime/defs_linux.go

Documentation: runtime

     1  // Copyright 2009 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build ignore
     6  
     7  /*
     8  Input to cgo -cdefs
     9  
    10  GOARCH=amd64 go tool cgo -cdefs defs_linux.go defs1_linux.go >defs_linux_amd64.h
    11  */
    12  
    13  package runtime
    14  
    15  /*
    16  // Linux glibc and Linux kernel define different and conflicting
    17  // definitions for struct sigaction, struct timespec, etc.
    18  // We want the kernel ones, which are in the asm/* headers.
    19  // But then we'd get conflicts when we include the system
    20  // headers for things like ucontext_t, so that happens in
    21  // a separate file, defs1.go.
    22  
    23  #define	_SYS_TYPES_H	// avoid inclusion of sys/types.h
    24  #include <asm/posix_types.h>
    25  #define size_t __kernel_size_t
    26  #include <asm/signal.h>
    27  #include <asm/siginfo.h>
    28  #include <asm/mman.h>
    29  #include <asm-generic/errno.h>
    30  #include <asm-generic/poll.h>
    31  #include <linux/eventpoll.h>
    32  #include <linux/time.h>
    33  */
    34  import "C"
    35  
    36  const (
    37  	EINTR  = C.EINTR
    38  	EAGAIN = C.EAGAIN
    39  	ENOMEM = C.ENOMEM
    40  
    41  	PROT_NONE  = C.PROT_NONE
    42  	PROT_READ  = C.PROT_READ
    43  	PROT_WRITE = C.PROT_WRITE
    44  	PROT_EXEC  = C.PROT_EXEC
    45  
    46  	MAP_ANON    = C.MAP_ANONYMOUS
    47  	MAP_PRIVATE = C.MAP_PRIVATE
    48  	MAP_FIXED   = C.MAP_FIXED
    49  
    50  	MADV_DONTNEED = C.MADV_DONTNEED
    51  
    52  	SA_RESTART = C.SA_RESTART
    53  	SA_ONSTACK = C.SA_ONSTACK
    54  	SA_SIGINFO = C.SA_SIGINFO
    55  
    56  	SIGHUP    = C.SIGHUP
    57  	SIGINT    = C.SIGINT
    58  	SIGQUIT   = C.SIGQUIT
    59  	SIGILL    = C.SIGILL
    60  	SIGTRAP   = C.SIGTRAP
    61  	SIGABRT   = C.SIGABRT
    62  	SIGBUS    = C.SIGBUS
    63  	SIGFPE    = C.SIGFPE
    64  	SIGKILL   = C.SIGKILL
    65  	SIGUSR1   = C.SIGUSR1
    66  	SIGSEGV   = C.SIGSEGV
    67  	SIGUSR2   = C.SIGUSR2
    68  	SIGPIPE   = C.SIGPIPE
    69  	SIGALRM   = C.SIGALRM
    70  	SIGSTKFLT = C.SIGSTKFLT
    71  	SIGCHLD   = C.SIGCHLD
    72  	SIGCONT   = C.SIGCONT
    73  	SIGSTOP   = C.SIGSTOP
    74  	SIGTSTP   = C.SIGTSTP
    75  	SIGTTIN   = C.SIGTTIN
    76  	SIGTTOU   = C.SIGTTOU
    77  	SIGURG    = C.SIGURG
    78  	SIGXCPU   = C.SIGXCPU
    79  	SIGXFSZ   = C.SIGXFSZ
    80  	SIGVTALRM = C.SIGVTALRM
    81  	SIGPROF   = C.SIGPROF
    82  	SIGWINCH  = C.SIGWINCH
    83  	SIGIO     = C.SIGIO
    84  	SIGPWR    = C.SIGPWR
    85  	SIGSYS    = C.SIGSYS
    86  
    87  	FPE_INTDIV = C.FPE_INTDIV
    88  	FPE_INTOVF = C.FPE_INTOVF
    89  	FPE_FLTDIV = C.FPE_FLTDIV
    90  	FPE_FLTOVF = C.FPE_FLTOVF
    91  	FPE_FLTUND = C.FPE_FLTUND
    92  	FPE_FLTRES = C.FPE_FLTRES
    93  	FPE_FLTINV = C.FPE_FLTINV
    94  	FPE_FLTSUB = C.FPE_FLTSUB
    95  
    96  	BUS_ADRALN = C.BUS_ADRALN
    97  	BUS_ADRERR = C.BUS_ADRERR
    98  	BUS_OBJERR = C.BUS_OBJERR
    99  
   100  	SEGV_MAPERR = C.SEGV_MAPERR
   101  	SEGV_ACCERR = C.SEGV_ACCERR
   102  
   103  	ITIMER_REAL    = C.ITIMER_REAL
   104  	ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
   105  	ITIMER_PROF    = C.ITIMER_PROF
   106  
   107  	EPOLLIN       = C.POLLIN
   108  	EPOLLOUT      = C.POLLOUT
   109  	EPOLLERR      = C.POLLERR
   110  	EPOLLHUP      = C.POLLHUP
   111  	EPOLLRDHUP    = C.POLLRDHUP
   112  	EPOLLET       = C.EPOLLET
   113  	EPOLL_CLOEXEC = C.EPOLL_CLOEXEC
   114  	EPOLL_CTL_ADD = C.EPOLL_CTL_ADD
   115  	EPOLL_CTL_DEL = C.EPOLL_CTL_DEL
   116  	EPOLL_CTL_MOD = C.EPOLL_CTL_MOD
   117  )
   118  
   119  type Sigset C.sigset_t
   120  type Timespec C.struct_timespec
   121  type Timeval C.struct_timeval
   122  type Sigaction C.struct_sigaction
   123  type Siginfo C.siginfo_t
   124  type Itimerval C.struct_itimerval
   125  type EpollEvent C.struct_epoll_event
   126  

View as plain text