...
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  	MADV_FREE       = C.MADV_FREE
    52  	MADV_HUGEPAGE   = C.MADV_HUGEPAGE
    53  	MADV_NOHUGEPAGE = C.MADV_HNOUGEPAGE
    54  
    55  	SA_RESTART = C.SA_RESTART
    56  	SA_ONSTACK = C.SA_ONSTACK
    57  	SA_SIGINFO = C.SA_SIGINFO
    58  
    59  	SIGHUP    = C.SIGHUP
    60  	SIGINT    = C.SIGINT
    61  	SIGQUIT   = C.SIGQUIT
    62  	SIGILL    = C.SIGILL
    63  	SIGTRAP   = C.SIGTRAP
    64  	SIGABRT   = C.SIGABRT
    65  	SIGBUS    = C.SIGBUS
    66  	SIGFPE    = C.SIGFPE
    67  	SIGKILL   = C.SIGKILL
    68  	SIGUSR1   = C.SIGUSR1
    69  	SIGSEGV   = C.SIGSEGV
    70  	SIGUSR2   = C.SIGUSR2
    71  	SIGPIPE   = C.SIGPIPE
    72  	SIGALRM   = C.SIGALRM
    73  	SIGSTKFLT = C.SIGSTKFLT
    74  	SIGCHLD   = C.SIGCHLD
    75  	SIGCONT   = C.SIGCONT
    76  	SIGSTOP   = C.SIGSTOP
    77  	SIGTSTP   = C.SIGTSTP
    78  	SIGTTIN   = C.SIGTTIN
    79  	SIGTTOU   = C.SIGTTOU
    80  	SIGURG    = C.SIGURG
    81  	SIGXCPU   = C.SIGXCPU
    82  	SIGXFSZ   = C.SIGXFSZ
    83  	SIGVTALRM = C.SIGVTALRM
    84  	SIGPROF   = C.SIGPROF
    85  	SIGWINCH  = C.SIGWINCH
    86  	SIGIO     = C.SIGIO
    87  	SIGPWR    = C.SIGPWR
    88  	SIGSYS    = C.SIGSYS
    89  
    90  	FPE_INTDIV = C.FPE_INTDIV
    91  	FPE_INTOVF = C.FPE_INTOVF
    92  	FPE_FLTDIV = C.FPE_FLTDIV
    93  	FPE_FLTOVF = C.FPE_FLTOVF
    94  	FPE_FLTUND = C.FPE_FLTUND
    95  	FPE_FLTRES = C.FPE_FLTRES
    96  	FPE_FLTINV = C.FPE_FLTINV
    97  	FPE_FLTSUB = C.FPE_FLTSUB
    98  
    99  	BUS_ADRALN = C.BUS_ADRALN
   100  	BUS_ADRERR = C.BUS_ADRERR
   101  	BUS_OBJERR = C.BUS_OBJERR
   102  
   103  	SEGV_MAPERR = C.SEGV_MAPERR
   104  	SEGV_ACCERR = C.SEGV_ACCERR
   105  
   106  	ITIMER_REAL    = C.ITIMER_REAL
   107  	ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
   108  	ITIMER_PROF    = C.ITIMER_PROF
   109  
   110  	EPOLLIN       = C.POLLIN
   111  	EPOLLOUT      = C.POLLOUT
   112  	EPOLLERR      = C.POLLERR
   113  	EPOLLHUP      = C.POLLHUP
   114  	EPOLLRDHUP    = C.POLLRDHUP
   115  	EPOLLET       = C.EPOLLET
   116  	EPOLL_CLOEXEC = C.EPOLL_CLOEXEC
   117  	EPOLL_CTL_ADD = C.EPOLL_CTL_ADD
   118  	EPOLL_CTL_DEL = C.EPOLL_CTL_DEL
   119  	EPOLL_CTL_MOD = C.EPOLL_CTL_MOD
   120  )
   121  
   122  type Sigset C.sigset_t
   123  type Timespec C.struct_timespec
   124  type Timeval C.struct_timeval
   125  type Sigaction C.struct_sigaction
   126  type Siginfo C.siginfo_t
   127  type Itimerval C.struct_itimerval
   128  type EpollEvent C.struct_epoll_event
   129  

View as plain text