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

View as plain text