1 // Copyright 2018 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.
9 Input to cgo -godefs. See also mkerrors.sh and mkall.sh
12 // +godefs map struct_in_addr [4]byte /* in_addr */
13 // +godefs map struct_in6_addr [16]byte /* in6_addr */
18 #include <sys/types.h>
20 #include <sys/limits.h>
23 #include <sys/utsname.h>
25 #include <sys/resource.h>
27 #include <sys/statfs.h>
28 #include <sys/termio.h>
29 #include <sys/ioctl.h>
34 #include <net/if_dl.h>
35 #include <netinet/in.h>
36 #include <netinet/icmp6.h>
43 sizeofPtr = sizeof(void*),
47 struct sockaddr s1; // this one gets used for fields
48 struct sockaddr_in s2; // these pad it out
49 struct sockaddr_in6 s3;
50 struct sockaddr_un s4;
51 struct sockaddr_dl s5;
56 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
62 // Machine characteristics
65 SizeofPtr = C.sizeofPtr
66 SizeofShort = C.sizeof_short
67 SizeofInt = C.sizeof_int
68 SizeofLong = C.sizeof_long
69 SizeofLongLong = C.sizeof_longlong
79 _C_long_long C.longlong
88 type Timespec C.struct_timespec
90 type Timeval C.struct_timeval
92 type Timeval32 C.struct_timeval32
94 type Timex C.struct_timex
100 type Utimbuf C.struct_utimbuf
102 type Timezone C.struct_timezone
106 type Rusage C.struct_rusage
108 type Rlimit C.struct_rlimit64
118 type Stat_t C.struct_stat
120 type StatxTimestamp C.struct_statx_timestamp
122 type Statx_t C.struct_statx
124 type Dirent C.struct_dirent
128 type RawSockaddrInet4 C.struct_sockaddr_in
130 type RawSockaddrInet6 C.struct_sockaddr_in6
132 type RawSockaddrUnix C.struct_sockaddr_un
134 type RawSockaddrDatalink C.struct_sockaddr_dl
136 type RawSockaddr C.struct_sockaddr
138 type RawSockaddrAny C.struct_sockaddr_any
140 type _Socklen C.socklen_t
142 type Cmsghdr C.struct_cmsghdr
144 type ICMPv6Filter C.struct_icmp6_filter
146 type Iovec C.struct_iovec
148 type IPMreq C.struct_ip_mreq
150 type IPv6Mreq C.struct_ipv6_mreq
152 type IPv6MTUInfo C.struct_ip6_mtuinfo
154 type Linger C.struct_linger
156 type Msghdr C.struct_msghdr
159 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
160 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
161 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
162 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
163 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
164 SizeofLinger = C.sizeof_struct_linger
165 SizeofIovec = C.sizeof_struct_iovec
166 SizeofIPMreq = C.sizeof_struct_ip_mreq
167 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
168 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
169 SizeofMsghdr = C.sizeof_struct_msghdr
170 SizeofCmsghdr = C.sizeof_struct_cmsghdr
171 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
174 // Routing and interface messages
177 SizeofIfMsghdr = C.sizeof_struct_if_msghdr
180 type IfMsgHdr C.struct_if_msghdr
186 type Utsname C.struct_utsname
188 type Ustat_t C.struct_ustat
190 type Sigset_t C.sigset_t
193 AT_FDCWD = C.AT_FDCWD
194 AT_REMOVEDIR = C.AT_REMOVEDIR
195 AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
200 type Termios C.struct_termios
202 type Termio C.struct_termio
204 type Winsize C.struct_winsize
218 POLLNVAL = C.POLLNVAL
221 POLLRDBAND = C.POLLRDBAND
222 POLLRDNORM = C.POLLRDNORM
223 POLLWRBAND = C.POLLWRBAND
224 POLLWRNORM = C.POLLWRNORM
229 type Flock_t C.struct_flock64
233 type Fsid_t C.struct_fsid_t
234 type Fsid64_t C.struct_fsid64_t
236 type Statfs_t C.struct_statfs
238 const RNDGETENTCNT = 0x80045200