Source file src/runtime/defs_linux.go

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

View as plain text