Black Lives Matter. Support the Equal Justice Initiative.

Source file src/syscall/types_netbsd.go

Documentation: syscall

     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  // +build ignore
     7  
     8  /*
     9  Input to cgo -godefs.  See also mkerrors.sh and mkall.sh
    10  */
    11  
    12  // +godefs map struct_in_addr [4]byte /* in_addr */
    13  // +godefs map struct_in6_addr [16]byte /* in6_addr */
    14  
    15  package syscall
    16  
    17  /*
    18  #define KERNEL
    19  #include <dirent.h>
    20  #include <fcntl.h>
    21  #include <signal.h>
    22  #include <termios.h>
    23  #include <stdio.h>
    24  #include <unistd.h>
    25  #include <sys/param.h>
    26  #include <sys/types.h>
    27  #include <sys/event.h>
    28  #include <sys/mman.h>
    29  #include <sys/mount.h>
    30  #include <sys/ptrace.h>
    31  #include <sys/resource.h>
    32  #include <sys/select.h>
    33  #include <sys/signal.h>
    34  #include <sys/socket.h>
    35  #include <sys/stat.h>
    36  #include <sys/sysctl.h>
    37  #include <sys/time.h>
    38  #include <sys/uio.h>
    39  #include <sys/un.h>
    40  #include <sys/wait.h>
    41  #include <net/bpf.h>
    42  #include <net/if.h>
    43  #include <net/if_dl.h>
    44  #include <net/route.h>
    45  #include <netinet/in.h>
    46  #include <netinet/icmp6.h>
    47  #include <netinet/tcp.h>
    48  
    49  enum {
    50  	sizeofPtr = sizeof(void*),
    51  };
    52  
    53  union sockaddr_all {
    54  	struct sockaddr s1;	// this one gets used for fields
    55  	struct sockaddr_in s2;	// these pad it out
    56  	struct sockaddr_in6 s3;
    57  	struct sockaddr_un s4;
    58  	struct sockaddr_dl s5;
    59  };
    60  
    61  struct sockaddr_any {
    62  	struct sockaddr addr;
    63  	char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
    64  };
    65  
    66  */
    67  import "C"
    68  
    69  // Machine characteristics; for internal use.
    70  
    71  const (
    72  	sizeofPtr      = C.sizeofPtr
    73  	sizeofShort    = C.sizeof_short
    74  	sizeofInt      = C.sizeof_int
    75  	sizeofLong     = C.sizeof_long
    76  	sizeofLongLong = C.sizeof_longlong
    77  )
    78  
    79  // Basic types
    80  
    81  type (
    82  	_C_short     C.short
    83  	_C_int       C.int
    84  	_C_long      C.long
    85  	_C_long_long C.longlong
    86  )
    87  
    88  // Time
    89  
    90  type Timespec C.struct_timespec
    91  
    92  type Timeval C.struct_timeval
    93  
    94  // Processes
    95  
    96  type Rusage C.struct_rusage
    97  
    98  type Rlimit C.struct_rlimit
    99  
   100  type _Gid_t C.gid_t
   101  
   102  // Files
   103  
   104  type Stat_t C.struct_stat
   105  
   106  type Statfs_t C.struct_statfs
   107  
   108  type Flock_t C.struct_flock
   109  
   110  type Dirent C.struct_dirent
   111  
   112  type Fsid C.fsid_t
   113  
   114  // File system limits
   115  
   116  const (
   117  	pathMax = C.PATH_MAX
   118  )
   119  
   120  // Sockets
   121  
   122  type RawSockaddrInet4 C.struct_sockaddr_in
   123  
   124  type RawSockaddrInet6 C.struct_sockaddr_in6
   125  
   126  type RawSockaddrUnix C.struct_sockaddr_un
   127  
   128  type RawSockaddrDatalink C.struct_sockaddr_dl
   129  
   130  type RawSockaddr C.struct_sockaddr
   131  
   132  type RawSockaddrAny C.struct_sockaddr_any
   133  
   134  type _Socklen C.socklen_t
   135  
   136  type Linger C.struct_linger
   137  
   138  type Iovec C.struct_iovec
   139  
   140  type IPMreq C.struct_ip_mreq
   141  
   142  type IPv6Mreq C.struct_ipv6_mreq
   143  
   144  type Msghdr C.struct_msghdr
   145  
   146  type Cmsghdr C.struct_cmsghdr
   147  
   148  type Inet6Pktinfo C.struct_in6_pktinfo
   149  
   150  type IPv6MTUInfo C.struct_ip6_mtuinfo
   151  
   152  type ICMPv6Filter C.struct_icmp6_filter
   153  
   154  const (
   155  	SizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in
   156  	SizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6
   157  	SizeofSockaddrAny      = C.sizeof_struct_sockaddr_any
   158  	SizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un
   159  	SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
   160  	SizeofLinger           = C.sizeof_struct_linger
   161  	SizeofIPMreq           = C.sizeof_struct_ip_mreq
   162  	SizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq
   163  	SizeofMsghdr           = C.sizeof_struct_msghdr
   164  	SizeofCmsghdr          = C.sizeof_struct_cmsghdr
   165  	SizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo
   166  	SizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo
   167  	SizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter
   168  )
   169  
   170  // Ptrace requests
   171  
   172  const (
   173  	PTRACE_TRACEME = C.PT_TRACE_ME
   174  	PTRACE_CONT    = C.PT_CONTINUE
   175  	PTRACE_KILL    = C.PT_KILL
   176  )
   177  
   178  // Events (kqueue, kevent)
   179  
   180  type Kevent_t C.struct_kevent
   181  
   182  // Select
   183  
   184  type FdSet C.fd_set
   185  
   186  // Routing and interface messages
   187  
   188  const (
   189  	SizeofIfMsghdr         = C.sizeof_struct_if_msghdr
   190  	SizeofIfData           = C.sizeof_struct_if_data
   191  	SizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr
   192  	SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
   193  	SizeofRtMsghdr         = C.sizeof_struct_rt_msghdr
   194  	SizeofRtMetrics        = C.sizeof_struct_rt_metrics
   195  )
   196  
   197  type IfMsghdr C.struct_if_msghdr
   198  
   199  type IfData C.struct_if_data
   200  
   201  type IfaMsghdr C.struct_ifa_msghdr
   202  
   203  type IfAnnounceMsghdr C.struct_if_announcemsghdr
   204  
   205  type RtMsghdr C.struct_rt_msghdr
   206  
   207  type RtMetrics C.struct_rt_metrics
   208  
   209  type Mclpool C.struct_mclpool
   210  
   211  // Berkeley packet filter
   212  
   213  const (
   214  	SizeofBpfVersion = C.sizeof_struct_bpf_version
   215  	SizeofBpfStat    = C.sizeof_struct_bpf_stat
   216  	SizeofBpfProgram = C.sizeof_struct_bpf_program
   217  	SizeofBpfInsn    = C.sizeof_struct_bpf_insn
   218  	SizeofBpfHdr     = C.sizeof_struct_bpf_hdr
   219  )
   220  
   221  type BpfVersion C.struct_bpf_version
   222  
   223  type BpfStat C.struct_bpf_stat
   224  
   225  type BpfProgram C.struct_bpf_program
   226  
   227  type BpfInsn C.struct_bpf_insn
   228  
   229  type BpfHdr C.struct_bpf_hdr
   230  
   231  type BpfTimeval C.struct_bpf_timeval
   232  
   233  // Misc
   234  
   235  const (
   236  	_AT_FDCWD = C.AT_FDCWD
   237  )
   238  
   239  // Terminal handling
   240  
   241  type Termios C.struct_termios
   242  
   243  // Sysctl
   244  
   245  type Sysctlnode C.struct_sysctlnode
   246  
   247  // Signals
   248  
   249  type sigset C.sigset_t
   250  

View as plain text