vendor/golang.org/x/sys/unix/types_netbsd.go
changeset 251 1c52a0eeb952
parent 250 c040f992052f
child 252 8399cd48111b
equal deleted inserted replaced
250:c040f992052f 251:1c52a0eeb952
     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 -godefs.  See README.md
       
     9 */
       
    10 
       
    11 // +godefs map struct_in_addr [4]byte /* in_addr */
       
    12 // +godefs map struct_in6_addr [16]byte /* in6_addr */
       
    13 
       
    14 package unix
       
    15 
       
    16 /*
       
    17 #define KERNEL
       
    18 #include <dirent.h>
       
    19 #include <fcntl.h>
       
    20 #include <poll.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/utsname.h>
       
    41 #include <sys/wait.h>
       
    42 #include <net/bpf.h>
       
    43 #include <net/if.h>
       
    44 #include <net/if_dl.h>
       
    45 #include <net/route.h>
       
    46 #include <netinet/in.h>
       
    47 #include <netinet/icmp6.h>
       
    48 #include <netinet/tcp.h>
       
    49 
       
    50 enum {
       
    51 	sizeofPtr = sizeof(void*),
       
    52 };
       
    53 
       
    54 union sockaddr_all {
       
    55 	struct sockaddr s1;	// this one gets used for fields
       
    56 	struct sockaddr_in s2;	// these pad it out
       
    57 	struct sockaddr_in6 s3;
       
    58 	struct sockaddr_un s4;
       
    59 	struct sockaddr_dl s5;
       
    60 };
       
    61 
       
    62 struct sockaddr_any {
       
    63 	struct sockaddr addr;
       
    64 	char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
       
    65 };
       
    66 
       
    67 */
       
    68 import "C"
       
    69 
       
    70 // Machine characteristics; for internal use.
       
    71 
       
    72 const (
       
    73 	sizeofPtr      = C.sizeofPtr
       
    74 	sizeofShort    = C.sizeof_short
       
    75 	sizeofInt      = C.sizeof_int
       
    76 	sizeofLong     = C.sizeof_long
       
    77 	sizeofLongLong = C.sizeof_longlong
       
    78 )
       
    79 
       
    80 // Basic types
       
    81 
       
    82 type (
       
    83 	_C_short     C.short
       
    84 	_C_int       C.int
       
    85 	_C_long      C.long
       
    86 	_C_long_long C.longlong
       
    87 )
       
    88 
       
    89 // Time
       
    90 
       
    91 type Timespec C.struct_timespec
       
    92 
       
    93 type Timeval C.struct_timeval
       
    94 
       
    95 // Processes
       
    96 
       
    97 type Rusage C.struct_rusage
       
    98 
       
    99 type Rlimit C.struct_rlimit
       
   100 
       
   101 type _Gid_t C.gid_t
       
   102 
       
   103 // Files
       
   104 
       
   105 type Stat_t C.struct_stat
       
   106 
       
   107 type Statfs_t C.struct_statfs
       
   108 
       
   109 type Flock_t C.struct_flock
       
   110 
       
   111 type Dirent C.struct_dirent
       
   112 
       
   113 type Fsid C.fsid_t
       
   114 
       
   115 // File system limits
       
   116 
       
   117 const (
       
   118 	PathMax = C.PATH_MAX
       
   119 )
       
   120 
       
   121 // Advice to Fadvise
       
   122 
       
   123 const (
       
   124 	FADV_NORMAL     = C.POSIX_FADV_NORMAL
       
   125 	FADV_RANDOM     = C.POSIX_FADV_RANDOM
       
   126 	FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL
       
   127 	FADV_WILLNEED   = C.POSIX_FADV_WILLNEED
       
   128 	FADV_DONTNEED   = C.POSIX_FADV_DONTNEED
       
   129 	FADV_NOREUSE    = C.POSIX_FADV_NOREUSE
       
   130 )
       
   131 
       
   132 // Sockets
       
   133 
       
   134 type RawSockaddrInet4 C.struct_sockaddr_in
       
   135 
       
   136 type RawSockaddrInet6 C.struct_sockaddr_in6
       
   137 
       
   138 type RawSockaddrUnix C.struct_sockaddr_un
       
   139 
       
   140 type RawSockaddrDatalink C.struct_sockaddr_dl
       
   141 
       
   142 type RawSockaddr C.struct_sockaddr
       
   143 
       
   144 type RawSockaddrAny C.struct_sockaddr_any
       
   145 
       
   146 type _Socklen C.socklen_t
       
   147 
       
   148 type Linger C.struct_linger
       
   149 
       
   150 type Iovec C.struct_iovec
       
   151 
       
   152 type IPMreq C.struct_ip_mreq
       
   153 
       
   154 type IPv6Mreq C.struct_ipv6_mreq
       
   155 
       
   156 type Msghdr C.struct_msghdr
       
   157 
       
   158 type Cmsghdr C.struct_cmsghdr
       
   159 
       
   160 type Inet6Pktinfo C.struct_in6_pktinfo
       
   161 
       
   162 type IPv6MTUInfo C.struct_ip6_mtuinfo
       
   163 
       
   164 type ICMPv6Filter C.struct_icmp6_filter
       
   165 
       
   166 const (
       
   167 	SizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in
       
   168 	SizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6
       
   169 	SizeofSockaddrAny      = C.sizeof_struct_sockaddr_any
       
   170 	SizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un
       
   171 	SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
       
   172 	SizeofLinger           = C.sizeof_struct_linger
       
   173 	SizeofIPMreq           = C.sizeof_struct_ip_mreq
       
   174 	SizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq
       
   175 	SizeofMsghdr           = C.sizeof_struct_msghdr
       
   176 	SizeofCmsghdr          = C.sizeof_struct_cmsghdr
       
   177 	SizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo
       
   178 	SizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo
       
   179 	SizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter
       
   180 )
       
   181 
       
   182 // Ptrace requests
       
   183 
       
   184 const (
       
   185 	PTRACE_TRACEME = C.PT_TRACE_ME
       
   186 	PTRACE_CONT    = C.PT_CONTINUE
       
   187 	PTRACE_KILL    = C.PT_KILL
       
   188 )
       
   189 
       
   190 // Events (kqueue, kevent)
       
   191 
       
   192 type Kevent_t C.struct_kevent
       
   193 
       
   194 // Select
       
   195 
       
   196 type FdSet C.fd_set
       
   197 
       
   198 // Routing and interface messages
       
   199 
       
   200 const (
       
   201 	SizeofIfMsghdr         = C.sizeof_struct_if_msghdr
       
   202 	SizeofIfData           = C.sizeof_struct_if_data
       
   203 	SizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr
       
   204 	SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
       
   205 	SizeofRtMsghdr         = C.sizeof_struct_rt_msghdr
       
   206 	SizeofRtMetrics        = C.sizeof_struct_rt_metrics
       
   207 )
       
   208 
       
   209 type IfMsghdr C.struct_if_msghdr
       
   210 
       
   211 type IfData C.struct_if_data
       
   212 
       
   213 type IfaMsghdr C.struct_ifa_msghdr
       
   214 
       
   215 type IfAnnounceMsghdr C.struct_if_announcemsghdr
       
   216 
       
   217 type RtMsghdr C.struct_rt_msghdr
       
   218 
       
   219 type RtMetrics C.struct_rt_metrics
       
   220 
       
   221 type Mclpool C.struct_mclpool
       
   222 
       
   223 // Berkeley packet filter
       
   224 
       
   225 const (
       
   226 	SizeofBpfVersion = C.sizeof_struct_bpf_version
       
   227 	SizeofBpfStat    = C.sizeof_struct_bpf_stat
       
   228 	SizeofBpfProgram = C.sizeof_struct_bpf_program
       
   229 	SizeofBpfInsn    = C.sizeof_struct_bpf_insn
       
   230 	SizeofBpfHdr     = C.sizeof_struct_bpf_hdr
       
   231 )
       
   232 
       
   233 type BpfVersion C.struct_bpf_version
       
   234 
       
   235 type BpfStat C.struct_bpf_stat
       
   236 
       
   237 type BpfProgram C.struct_bpf_program
       
   238 
       
   239 type BpfInsn C.struct_bpf_insn
       
   240 
       
   241 type BpfHdr C.struct_bpf_hdr
       
   242 
       
   243 type BpfTimeval C.struct_bpf_timeval
       
   244 
       
   245 // Terminal handling
       
   246 
       
   247 type Termios C.struct_termios
       
   248 
       
   249 type Winsize C.struct_winsize
       
   250 
       
   251 // fchmodat-like syscalls.
       
   252 
       
   253 const (
       
   254 	AT_FDCWD            = C.AT_FDCWD
       
   255 	AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
       
   256 )
       
   257 
       
   258 // poll
       
   259 
       
   260 type PollFd C.struct_pollfd
       
   261 
       
   262 const (
       
   263 	POLLERR    = C.POLLERR
       
   264 	POLLHUP    = C.POLLHUP
       
   265 	POLLIN     = C.POLLIN
       
   266 	POLLNVAL   = C.POLLNVAL
       
   267 	POLLOUT    = C.POLLOUT
       
   268 	POLLPRI    = C.POLLPRI
       
   269 	POLLRDBAND = C.POLLRDBAND
       
   270 	POLLRDNORM = C.POLLRDNORM
       
   271 	POLLWRBAND = C.POLLWRBAND
       
   272 	POLLWRNORM = C.POLLWRNORM
       
   273 )
       
   274 
       
   275 // Sysctl
       
   276 
       
   277 type Sysctlnode C.struct_sysctlnode
       
   278 
       
   279 // Uname
       
   280 
       
   281 type Utsname C.struct_utsname
       
   282 
       
   283 // Clockinfo
       
   284 
       
   285 const SizeofClockinfo = C.sizeof_struct_clockinfo
       
   286 
       
   287 type Clockinfo C.struct_clockinfo