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.
8 Input to cgo -godefs. See README.md
11 // +godefs map struct_in_addr [4]byte /* in_addr */
12 // +godefs map struct_in6_addr [16]byte /* in6_addr */
25 #include <sys/param.h>
26 #include <sys/types.h>
27 #include <sys/event.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>
36 #include <sys/statvfs.h>
37 #include <sys/sysctl.h>
41 #include <sys/utsname.h>
45 #include <net/if_dl.h>
46 #include <net/route.h>
47 #include <netinet/in.h>
48 #include <netinet/icmp6.h>
49 #include <netinet/tcp.h>
52 sizeofPtr = sizeof(void*),
56 struct sockaddr s1; // this one gets used for fields
57 struct sockaddr_in s2; // these pad it out
58 struct sockaddr_in6 s3;
59 struct sockaddr_un s4;
60 struct sockaddr_dl s5;
65 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
71 // Machine characteristics
74 SizeofPtr = C.sizeofPtr
75 SizeofShort = C.sizeof_short
76 SizeofInt = C.sizeof_int
77 SizeofLong = C.sizeof_long
78 SizeofLongLong = C.sizeof_longlong
87 _C_long_long C.longlong
92 type Timespec C.struct_timespec
94 type Timeval C.struct_timeval
98 type Rusage C.struct_rusage
100 type Rlimit C.struct_rlimit
106 type Stat_t C.struct_stat
108 type Statfs_t C.struct_statfs
110 type Statvfs_t C.struct_statvfs
112 type Flock_t C.struct_flock
114 type Dirent C.struct_dirent
118 // File system limits
124 // Fstatvfs/Statvfs flags
128 ST_NOWAIT = C.ST_NOWAIT
134 FADV_NORMAL = C.POSIX_FADV_NORMAL
135 FADV_RANDOM = C.POSIX_FADV_RANDOM
136 FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL
137 FADV_WILLNEED = C.POSIX_FADV_WILLNEED
138 FADV_DONTNEED = C.POSIX_FADV_DONTNEED
139 FADV_NOREUSE = C.POSIX_FADV_NOREUSE
144 type RawSockaddrInet4 C.struct_sockaddr_in
146 type RawSockaddrInet6 C.struct_sockaddr_in6
148 type RawSockaddrUnix C.struct_sockaddr_un
150 type RawSockaddrDatalink C.struct_sockaddr_dl
152 type RawSockaddr C.struct_sockaddr
154 type RawSockaddrAny C.struct_sockaddr_any
156 type _Socklen C.socklen_t
158 type Linger C.struct_linger
160 type Iovec C.struct_iovec
162 type IPMreq C.struct_ip_mreq
164 type IPv6Mreq C.struct_ipv6_mreq
166 type Msghdr C.struct_msghdr
168 type Cmsghdr C.struct_cmsghdr
170 type Inet6Pktinfo C.struct_in6_pktinfo
172 type IPv6MTUInfo C.struct_ip6_mtuinfo
174 type ICMPv6Filter C.struct_icmp6_filter
177 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
178 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
179 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
180 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
181 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
182 SizeofLinger = C.sizeof_struct_linger
183 SizeofIovec = C.sizeof_struct_iovec
184 SizeofIPMreq = C.sizeof_struct_ip_mreq
185 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
186 SizeofMsghdr = C.sizeof_struct_msghdr
187 SizeofCmsghdr = C.sizeof_struct_cmsghdr
188 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
189 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
190 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
196 PTRACE_TRACEME = C.PT_TRACE_ME
197 PTRACE_CONT = C.PT_CONTINUE
198 PTRACE_KILL = C.PT_KILL
201 // Events (kqueue, kevent)
203 type Kevent_t C.struct_kevent
209 // Routing and interface messages
212 SizeofIfMsghdr = C.sizeof_struct_if_msghdr
213 SizeofIfData = C.sizeof_struct_if_data
214 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
215 SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
216 SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
217 SizeofRtMetrics = C.sizeof_struct_rt_metrics
220 type IfMsghdr C.struct_if_msghdr
222 type IfData C.struct_if_data
224 type IfaMsghdr C.struct_ifa_msghdr
226 type IfAnnounceMsghdr C.struct_if_announcemsghdr
228 type RtMsghdr C.struct_rt_msghdr
230 type RtMetrics C.struct_rt_metrics
232 type Mclpool C.struct_mclpool
234 // Berkeley packet filter
237 SizeofBpfVersion = C.sizeof_struct_bpf_version
238 SizeofBpfStat = C.sizeof_struct_bpf_stat
239 SizeofBpfProgram = C.sizeof_struct_bpf_program
240 SizeofBpfInsn = C.sizeof_struct_bpf_insn
241 SizeofBpfHdr = C.sizeof_struct_bpf_hdr
244 type BpfVersion C.struct_bpf_version
246 type BpfStat C.struct_bpf_stat
248 type BpfProgram C.struct_bpf_program
250 type BpfInsn C.struct_bpf_insn
252 type BpfHdr C.struct_bpf_hdr
254 type BpfTimeval C.struct_bpf_timeval
258 type Termios C.struct_termios
260 type Winsize C.struct_winsize
262 type Ptmget C.struct_ptmget
264 // fchmodat-like syscalls.
267 AT_FDCWD = C.AT_FDCWD
268 AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
269 AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
274 type PollFd C.struct_pollfd
280 POLLNVAL = C.POLLNVAL
283 POLLRDBAND = C.POLLRDBAND
284 POLLRDNORM = C.POLLRDNORM
285 POLLWRBAND = C.POLLWRBAND
286 POLLWRNORM = C.POLLWRNORM
291 type Sysctlnode C.struct_sysctlnode
295 type Utsname C.struct_utsname
299 const SizeofClockinfo = C.sizeof_struct_clockinfo
301 type Clockinfo C.struct_clockinfo