Source file src/runtime/defs_freebsd.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.
     9  
    10  GOARCH=amd64 go tool cgo -cdefs defs_freebsd.go >defs_freebsd_amd64.h
    11  GOARCH=386 go tool cgo -cdefs defs_freebsd.go >defs_freebsd_386.h
    12  GOARCH=arm go tool cgo -cdefs defs_freebsd.go >defs_freebsd_arm.h
    13  */
    14  
    15  package runtime
    16  
    17  /*
    18  #include <sys/types.h>
    19  #include <sys/time.h>
    20  #include <signal.h>
    21  #include <errno.h>
    22  #define _WANT_FREEBSD11_KEVENT 1
    23  #include <sys/event.h>
    24  #include <sys/mman.h>
    25  #include <sys/ucontext.h>
    26  #include <sys/umtx.h>
    27  #include <sys/_umtx.h>
    28  #include <sys/rtprio.h>
    29  #include <sys/thr.h>
    30  #include <sys/_sigset.h>
    31  #include <sys/unistd.h>
    32  #include <sys/sysctl.h>
    33  #include <sys/cpuset.h>
    34  #include <sys/param.h>
    35  #include <sys/vdso.h>
    36  */
    37  import "C"
    38  
    39  // Local consts.
    40  const (
    41  	_NBBY            = C.NBBY            // Number of bits in a byte.
    42  	_CTL_MAXNAME     = C.CTL_MAXNAME     // Largest number of components supported.
    43  	_CPU_LEVEL_WHICH = C.CPU_LEVEL_WHICH // Actual mask/id for which.
    44  	_CPU_WHICH_PID   = C.CPU_WHICH_PID   // Specifies a process id.
    45  )
    46  
    47  const (
    48  	EINTR  = C.EINTR
    49  	EFAULT = C.EFAULT
    50  	EAGAIN = C.EAGAIN
    51  	ENOSYS = C.ENOSYS
    52  
    53  	O_NONBLOCK = C.O_NONBLOCK
    54  	O_CLOEXEC  = C.O_CLOEXEC
    55  
    56  	PROT_NONE  = C.PROT_NONE
    57  	PROT_READ  = C.PROT_READ
    58  	PROT_WRITE = C.PROT_WRITE
    59  	PROT_EXEC  = C.PROT_EXEC
    60  
    61  	MAP_ANON    = C.MAP_ANON
    62  	MAP_SHARED  = C.MAP_SHARED
    63  	MAP_PRIVATE = C.MAP_PRIVATE
    64  	MAP_FIXED   = C.MAP_FIXED
    65  
    66  	MADV_FREE = C.MADV_FREE
    67  
    68  	SA_SIGINFO = C.SA_SIGINFO
    69  	SA_RESTART = C.SA_RESTART
    70  	SA_ONSTACK = C.SA_ONSTACK
    71  
    72  	CLOCK_MONOTONIC = C.CLOCK_MONOTONIC
    73  	CLOCK_REALTIME  = C.CLOCK_REALTIME
    74  
    75  	UMTX_OP_WAIT_UINT         = C.UMTX_OP_WAIT_UINT
    76  	UMTX_OP_WAIT_UINT_PRIVATE = C.UMTX_OP_WAIT_UINT_PRIVATE
    77  	UMTX_OP_WAKE              = C.UMTX_OP_WAKE
    78  	UMTX_OP_WAKE_PRIVATE      = C.UMTX_OP_WAKE_PRIVATE
    79  
    80  	SIGHUP    = C.SIGHUP
    81  	SIGINT    = C.SIGINT
    82  	SIGQUIT   = C.SIGQUIT
    83  	SIGILL    = C.SIGILL
    84  	SIGTRAP   = C.SIGTRAP
    85  	SIGABRT   = C.SIGABRT
    86  	SIGEMT    = C.SIGEMT
    87  	SIGFPE    = C.SIGFPE
    88  	SIGKILL   = C.SIGKILL
    89  	SIGBUS    = C.SIGBUS
    90  	SIGSEGV   = C.SIGSEGV
    91  	SIGSYS    = C.SIGSYS
    92  	SIGPIPE   = C.SIGPIPE
    93  	SIGALRM   = C.SIGALRM
    94  	SIGTERM   = C.SIGTERM
    95  	SIGURG    = C.SIGURG
    96  	SIGSTOP   = C.SIGSTOP
    97  	SIGTSTP   = C.SIGTSTP
    98  	SIGCONT   = C.SIGCONT
    99  	SIGCHLD   = C.SIGCHLD
   100  	SIGTTIN   = C.SIGTTIN
   101  	SIGTTOU   = C.SIGTTOU
   102  	SIGIO     = C.SIGIO
   103  	SIGXCPU   = C.SIGXCPU
   104  	SIGXFSZ   = C.SIGXFSZ
   105  	SIGVTALRM = C.SIGVTALRM
   106  	SIGPROF   = C.SIGPROF
   107  	SIGWINCH  = C.SIGWINCH
   108  	SIGINFO   = C.SIGINFO
   109  	SIGUSR1   = C.SIGUSR1
   110  	SIGUSR2   = C.SIGUSR2
   111  
   112  	FPE_INTDIV = C.FPE_INTDIV
   113  	FPE_INTOVF = C.FPE_INTOVF
   114  	FPE_FLTDIV = C.FPE_FLTDIV
   115  	FPE_FLTOVF = C.FPE_FLTOVF
   116  	FPE_FLTUND = C.FPE_FLTUND
   117  	FPE_FLTRES = C.FPE_FLTRES
   118  	FPE_FLTINV = C.FPE_FLTINV
   119  	FPE_FLTSUB = C.FPE_FLTSUB
   120  
   121  	BUS_ADRALN = C.BUS_ADRALN
   122  	BUS_ADRERR = C.BUS_ADRERR
   123  	BUS_OBJERR = C.BUS_OBJERR
   124  
   125  	SEGV_MAPERR = C.SEGV_MAPERR
   126  	SEGV_ACCERR = C.SEGV_ACCERR
   127  
   128  	ITIMER_REAL    = C.ITIMER_REAL
   129  	ITIMER_VIRTUAL = C.ITIMER_VIRTUAL
   130  	ITIMER_PROF    = C.ITIMER_PROF
   131  
   132  	EV_ADD       = C.EV_ADD
   133  	EV_DELETE    = C.EV_DELETE
   134  	EV_CLEAR     = C.EV_CLEAR
   135  	EV_RECEIPT   = C.EV_RECEIPT
   136  	EV_ERROR     = C.EV_ERROR
   137  	EV_EOF       = C.EV_EOF
   138  	EVFILT_READ  = C.EVFILT_READ
   139  	EVFILT_WRITE = C.EVFILT_WRITE
   140  )
   141  
   142  type Rtprio C.struct_rtprio
   143  type ThrParam C.struct_thr_param
   144  type Sigset C.struct___sigset
   145  type StackT C.stack_t
   146  
   147  type Siginfo C.siginfo_t
   148  
   149  type Mcontext C.mcontext_t
   150  type Ucontext C.ucontext_t
   151  
   152  type Timespec C.struct_timespec
   153  type Timeval C.struct_timeval
   154  type Itimerval C.struct_itimerval
   155  
   156  type Umtx_time C.struct__umtx_time
   157  
   158  type Kevent C.struct_kevent_freebsd11
   159  
   160  type bintime C.struct_bintime
   161  type vdsoTimehands C.struct_vdso_timehands
   162  type vdsoTimekeep C.struct_vdso_timekeep
   163  
   164  const (
   165  	_VDSO_TK_VER_CURR = C.VDSO_TK_VER_CURR
   166  
   167  	vdsoTimehandsSize = C.sizeof_struct_vdso_timehands
   168  	vdsoTimekeepSize  = C.sizeof_struct_vdso_timekeep
   169  )
   170  

View as plain text