.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / sys@v0.0.0-20210124154548-22da62e12c0c / unix / types_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 // +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 _WANT_FREEBSD11_STAT    1
18 #define _WANT_FREEBSD11_STATFS  1
19 #define _WANT_FREEBSD11_DIRENT  1
20 #define _WANT_FREEBSD11_KEVENT  1
21
22 #include <dirent.h>
23 #include <fcntl.h>
24 #include <poll.h>
25 #include <signal.h>
26 #include <termios.h>
27 #include <stdio.h>
28 #include <unistd.h>
29 #include <sys/capsicum.h>
30 #include <sys/event.h>
31 #include <sys/mman.h>
32 #include <sys/mount.h>
33 #include <sys/param.h>
34 #include <sys/ptrace.h>
35 #include <sys/resource.h>
36 #include <sys/select.h>
37 #include <sys/signal.h>
38 #include <sys/socket.h>
39 #include <sys/stat.h>
40 #include <sys/time.h>
41 #include <sys/types.h>
42 #include <sys/un.h>
43 #include <sys/utsname.h>
44 #include <sys/wait.h>
45 #include <net/bpf.h>
46 #include <net/if.h>
47 #include <net/if_dl.h>
48 #include <net/route.h>
49 #include <netinet/in.h>
50 #include <netinet/icmp6.h>
51 #include <netinet/tcp.h>
52
53 enum {
54         sizeofPtr = sizeof(void*),
55 };
56
57 union sockaddr_all {
58         struct sockaddr s1;     // this one gets used for fields
59         struct sockaddr_in s2;  // these pad it out
60         struct sockaddr_in6 s3;
61         struct sockaddr_un s4;
62         struct sockaddr_dl s5;
63 };
64
65 struct sockaddr_any {
66         struct sockaddr addr;
67         char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
68 };
69
70 // This structure is a duplicate of if_data on FreeBSD 8-STABLE.
71 // See /usr/include/net/if.h.
72 struct if_data8 {
73         u_char  ifi_type;
74         u_char  ifi_physical;
75         u_char  ifi_addrlen;
76         u_char  ifi_hdrlen;
77         u_char  ifi_link_state;
78         u_char  ifi_spare_char1;
79         u_char  ifi_spare_char2;
80         u_char  ifi_datalen;
81         u_long  ifi_mtu;
82         u_long  ifi_metric;
83         u_long  ifi_baudrate;
84         u_long  ifi_ipackets;
85         u_long  ifi_ierrors;
86         u_long  ifi_opackets;
87         u_long  ifi_oerrors;
88         u_long  ifi_collisions;
89         u_long  ifi_ibytes;
90         u_long  ifi_obytes;
91         u_long  ifi_imcasts;
92         u_long  ifi_omcasts;
93         u_long  ifi_iqdrops;
94         u_long  ifi_noproto;
95         u_long  ifi_hwassist;
96 // FIXME: these are now unions, so maybe need to change definitions?
97 #undef ifi_epoch
98         time_t  ifi_epoch;
99 #undef ifi_lastchange
100         struct  timeval ifi_lastchange;
101 };
102
103 // This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE.
104 // See /usr/include/net/if.h.
105 struct if_msghdr8 {
106         u_short ifm_msglen;
107         u_char  ifm_version;
108         u_char  ifm_type;
109         int     ifm_addrs;
110         int     ifm_flags;
111         u_short ifm_index;
112         struct  if_data8 ifm_data;
113 };
114 */
115 import "C"
116
117 // Machine characteristics
118
119 const (
120         SizeofPtr      = C.sizeofPtr
121         SizeofShort    = C.sizeof_short
122         SizeofInt      = C.sizeof_int
123         SizeofLong     = C.sizeof_long
124         SizeofLongLong = C.sizeof_longlong
125 )
126
127 // Basic types
128
129 type (
130         _C_short     C.short
131         _C_int       C.int
132         _C_long      C.long
133         _C_long_long C.longlong
134 )
135
136 // Time
137
138 type Timespec C.struct_timespec
139
140 type Timeval C.struct_timeval
141
142 // Processes
143
144 type Rusage C.struct_rusage
145
146 type Rlimit C.struct_rlimit
147
148 type _Gid_t C.gid_t
149
150 // Files
151
152 const (
153         _statfsVersion = C.STATFS_VERSION
154         _dirblksiz     = C.DIRBLKSIZ
155 )
156
157 type Stat_t C.struct_stat
158
159 type stat_freebsd11_t C.struct_freebsd11_stat
160
161 type Statfs_t C.struct_statfs
162
163 type statfs_freebsd11_t C.struct_freebsd11_statfs
164
165 type Flock_t C.struct_flock
166
167 type Dirent C.struct_dirent
168
169 type dirent_freebsd11 C.struct_freebsd11_dirent
170
171 type Fsid C.struct_fsid
172
173 // File system limits
174
175 const (
176         PathMax = C.PATH_MAX
177 )
178
179 // Advice to Fadvise
180
181 const (
182         FADV_NORMAL     = C.POSIX_FADV_NORMAL
183         FADV_RANDOM     = C.POSIX_FADV_RANDOM
184         FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL
185         FADV_WILLNEED   = C.POSIX_FADV_WILLNEED
186         FADV_DONTNEED   = C.POSIX_FADV_DONTNEED
187         FADV_NOREUSE    = C.POSIX_FADV_NOREUSE
188 )
189
190 // Sockets
191
192 type RawSockaddrInet4 C.struct_sockaddr_in
193
194 type RawSockaddrInet6 C.struct_sockaddr_in6
195
196 type RawSockaddrUnix C.struct_sockaddr_un
197
198 type RawSockaddrDatalink C.struct_sockaddr_dl
199
200 type RawSockaddr C.struct_sockaddr
201
202 type RawSockaddrAny C.struct_sockaddr_any
203
204 type _Socklen C.socklen_t
205
206 type Linger C.struct_linger
207
208 type Iovec C.struct_iovec
209
210 type IPMreq C.struct_ip_mreq
211
212 type IPMreqn C.struct_ip_mreqn
213
214 type IPv6Mreq C.struct_ipv6_mreq
215
216 type Msghdr C.struct_msghdr
217
218 type Cmsghdr C.struct_cmsghdr
219
220 type Inet6Pktinfo C.struct_in6_pktinfo
221
222 type IPv6MTUInfo C.struct_ip6_mtuinfo
223
224 type ICMPv6Filter C.struct_icmp6_filter
225
226 const (
227         SizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in
228         SizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6
229         SizeofSockaddrAny      = C.sizeof_struct_sockaddr_any
230         SizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un
231         SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
232         SizeofLinger           = C.sizeof_struct_linger
233         SizeofIovec            = C.sizeof_struct_iovec
234         SizeofIPMreq           = C.sizeof_struct_ip_mreq
235         SizeofIPMreqn          = C.sizeof_struct_ip_mreqn
236         SizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq
237         SizeofMsghdr           = C.sizeof_struct_msghdr
238         SizeofCmsghdr          = C.sizeof_struct_cmsghdr
239         SizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo
240         SizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo
241         SizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter
242 )
243
244 // Ptrace requests
245
246 const (
247         PTRACE_ATTACH     = C.PT_ATTACH
248         PTRACE_CONT       = C.PT_CONTINUE
249         PTRACE_DETACH     = C.PT_DETACH
250         PTRACE_GETFPREGS  = C.PT_GETFPREGS
251         PTRACE_GETFSBASE  = C.PT_GETFSBASE
252         PTRACE_GETLWPLIST = C.PT_GETLWPLIST
253         PTRACE_GETNUMLWPS = C.PT_GETNUMLWPS
254         PTRACE_GETREGS    = C.PT_GETREGS
255         PTRACE_GETXSTATE  = C.PT_GETXSTATE
256         PTRACE_IO         = C.PT_IO
257         PTRACE_KILL       = C.PT_KILL
258         PTRACE_LWPEVENTS  = C.PT_LWP_EVENTS
259         PTRACE_LWPINFO    = C.PT_LWPINFO
260         PTRACE_SETFPREGS  = C.PT_SETFPREGS
261         PTRACE_SETREGS    = C.PT_SETREGS
262         PTRACE_SINGLESTEP = C.PT_STEP
263         PTRACE_TRACEME    = C.PT_TRACE_ME
264 )
265
266 const (
267         PIOD_READ_D  = C.PIOD_READ_D
268         PIOD_WRITE_D = C.PIOD_WRITE_D
269         PIOD_READ_I  = C.PIOD_READ_I
270         PIOD_WRITE_I = C.PIOD_WRITE_I
271 )
272
273 const (
274         PL_FLAG_BORN   = C.PL_FLAG_BORN
275         PL_FLAG_EXITED = C.PL_FLAG_EXITED
276         PL_FLAG_SI     = C.PL_FLAG_SI
277 )
278
279 const (
280         TRAP_BRKPT = C.TRAP_BRKPT
281         TRAP_TRACE = C.TRAP_TRACE
282 )
283
284 type PtraceLwpInfoStruct C.struct_ptrace_lwpinfo
285
286 type __Siginfo C.struct___siginfo
287
288 type Sigset_t C.sigset_t
289
290 type Reg C.struct_reg
291
292 type FpReg C.struct_fpreg
293
294 type PtraceIoDesc C.struct_ptrace_io_desc
295
296 // Events (kqueue, kevent)
297
298 type Kevent_t C.struct_kevent_freebsd11
299
300 // Select
301
302 type FdSet C.fd_set
303
304 // Routing and interface messages
305
306 const (
307         sizeofIfMsghdr         = C.sizeof_struct_if_msghdr
308         SizeofIfMsghdr         = C.sizeof_struct_if_msghdr8
309         sizeofIfData           = C.sizeof_struct_if_data
310         SizeofIfData           = C.sizeof_struct_if_data8
311         SizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr
312         SizeofIfmaMsghdr       = C.sizeof_struct_ifma_msghdr
313         SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
314         SizeofRtMsghdr         = C.sizeof_struct_rt_msghdr
315         SizeofRtMetrics        = C.sizeof_struct_rt_metrics
316 )
317
318 type ifMsghdr C.struct_if_msghdr
319
320 type IfMsghdr C.struct_if_msghdr8
321
322 type ifData C.struct_if_data
323
324 type IfData C.struct_if_data8
325
326 type IfaMsghdr C.struct_ifa_msghdr
327
328 type IfmaMsghdr C.struct_ifma_msghdr
329
330 type IfAnnounceMsghdr C.struct_if_announcemsghdr
331
332 type RtMsghdr C.struct_rt_msghdr
333
334 type RtMetrics C.struct_rt_metrics
335
336 // Berkeley packet filter
337
338 const (
339         SizeofBpfVersion    = C.sizeof_struct_bpf_version
340         SizeofBpfStat       = C.sizeof_struct_bpf_stat
341         SizeofBpfZbuf       = C.sizeof_struct_bpf_zbuf
342         SizeofBpfProgram    = C.sizeof_struct_bpf_program
343         SizeofBpfInsn       = C.sizeof_struct_bpf_insn
344         SizeofBpfHdr        = C.sizeof_struct_bpf_hdr
345         SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header
346 )
347
348 type BpfVersion C.struct_bpf_version
349
350 type BpfStat C.struct_bpf_stat
351
352 type BpfZbuf C.struct_bpf_zbuf
353
354 type BpfProgram C.struct_bpf_program
355
356 type BpfInsn C.struct_bpf_insn
357
358 type BpfHdr C.struct_bpf_hdr
359
360 type BpfZbufHeader C.struct_bpf_zbuf_header
361
362 // Terminal handling
363
364 type Termios C.struct_termios
365
366 type Winsize C.struct_winsize
367
368 // fchmodat-like syscalls.
369
370 const (
371         AT_FDCWD            = C.AT_FDCWD
372         AT_REMOVEDIR        = C.AT_REMOVEDIR
373         AT_SYMLINK_FOLLOW   = C.AT_SYMLINK_FOLLOW
374         AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
375 )
376
377 // poll
378
379 type PollFd C.struct_pollfd
380
381 const (
382         POLLERR      = C.POLLERR
383         POLLHUP      = C.POLLHUP
384         POLLIN       = C.POLLIN
385         POLLINIGNEOF = C.POLLINIGNEOF
386         POLLNVAL     = C.POLLNVAL
387         POLLOUT      = C.POLLOUT
388         POLLPRI      = C.POLLPRI
389         POLLRDBAND   = C.POLLRDBAND
390         POLLRDNORM   = C.POLLRDNORM
391         POLLWRBAND   = C.POLLWRBAND
392         POLLWRNORM   = C.POLLWRNORM
393 )
394
395 // Capabilities
396
397 type CapRights C.struct_cap_rights
398
399 // Uname
400
401 type Utsname C.struct_utsname
402
403 // Clockinfo
404
405 const SizeofClockinfo = C.sizeof_struct_clockinfo
406
407 type Clockinfo C.struct_clockinfo