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 */
18 // These defines ensure that builds done on newer versions of Solaris are
19 // backwards-compatible with older versions of Solaris and
20 // OpenSolaris-based derivatives.
21 #define __USE_SUNOS_SOCKETS__ // msghdr
22 #define __USE_LEGACY_PROTOTYPES__ // iovec
34 #include <sys/mount.h>
35 #include <sys/param.h>
36 #include <sys/resource.h>
37 #include <sys/select.h>
38 #include <sys/signal.h>
39 #include <sys/socket.h>
41 #include <sys/statvfs.h>
43 #include <sys/times.h>
44 #include <sys/types.h>
45 #include <sys/utsname.h>
50 #include <net/if_dl.h>
51 #include <net/route.h>
52 #include <netinet/in.h>
53 #include <netinet/icmp6.h>
54 #include <netinet/tcp.h>
59 sizeofPtr = sizeof(void*),
63 struct sockaddr s1; // this one gets used for fields
64 struct sockaddr_in s2; // these pad it out
65 struct sockaddr_in6 s3;
66 struct sockaddr_un s4;
67 struct sockaddr_dl s5;
72 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
78 // Machine characteristics
81 SizeofPtr = C.sizeofPtr
82 SizeofShort = C.sizeof_short
83 SizeofInt = C.sizeof_int
84 SizeofLong = C.sizeof_long
85 SizeofLongLong = C.sizeof_longlong
87 MaxHostNameLen = C.MAXHOSTNAMELEN
96 _C_long_long C.longlong
101 type Timespec C.struct_timespec
103 type Timeval C.struct_timeval
105 type Timeval32 C.struct_timeval32
107 type Tms C.struct_tms
109 type Utimbuf C.struct_utimbuf
113 type Rusage C.struct_rusage
115 type Rlimit C.struct_rlimit
121 type Stat_t C.struct_stat
123 type Flock_t C.struct_flock
125 type Dirent C.struct_dirent
129 type _Fsblkcnt_t C.fsblkcnt_t
131 type Statvfs_t C.struct_statvfs
135 type RawSockaddrInet4 C.struct_sockaddr_in
137 type RawSockaddrInet6 C.struct_sockaddr_in6
139 type RawSockaddrUnix C.struct_sockaddr_un
141 type RawSockaddrDatalink C.struct_sockaddr_dl
143 type RawSockaddr C.struct_sockaddr
145 type RawSockaddrAny C.struct_sockaddr_any
147 type _Socklen C.socklen_t
149 type Linger C.struct_linger
151 type Iovec C.struct_iovec
153 type IPMreq C.struct_ip_mreq
155 type IPv6Mreq C.struct_ipv6_mreq
157 type Msghdr C.struct_msghdr
159 type Cmsghdr C.struct_cmsghdr
161 type Inet4Pktinfo C.struct_in_pktinfo
163 type Inet6Pktinfo C.struct_in6_pktinfo
165 type IPv6MTUInfo C.struct_ip6_mtuinfo
167 type ICMPv6Filter C.struct_icmp6_filter
170 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
171 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
172 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
173 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
174 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
175 SizeofLinger = C.sizeof_struct_linger
176 SizeofIovec = C.sizeof_struct_iovec
177 SizeofIPMreq = C.sizeof_struct_ip_mreq
178 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
179 SizeofMsghdr = C.sizeof_struct_msghdr
180 SizeofCmsghdr = C.sizeof_struct_cmsghdr
181 SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo
182 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
183 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
184 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
193 type Utsname C.struct_utsname
195 type Ustat_t C.struct_ustat
198 AT_FDCWD = C.AT_FDCWD
199 AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
200 AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
201 AT_REMOVEDIR = C.AT_REMOVEDIR
202 AT_EACCESS = C.AT_EACCESS
205 // Routing and interface messages
208 SizeofIfMsghdr = C.sizeof_struct_if_msghdr
209 SizeofIfData = C.sizeof_struct_if_data
210 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
211 SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
212 SizeofRtMetrics = C.sizeof_struct_rt_metrics
215 type IfMsghdr C.struct_if_msghdr
217 type IfData C.struct_if_data
219 type IfaMsghdr C.struct_ifa_msghdr
221 type RtMsghdr C.struct_rt_msghdr
223 type RtMetrics C.struct_rt_metrics
225 // Berkeley packet filter
228 SizeofBpfVersion = C.sizeof_struct_bpf_version
229 SizeofBpfStat = C.sizeof_struct_bpf_stat
230 SizeofBpfProgram = C.sizeof_struct_bpf_program
231 SizeofBpfInsn = C.sizeof_struct_bpf_insn
232 SizeofBpfHdr = C.sizeof_struct_bpf_hdr
235 type BpfVersion C.struct_bpf_version
237 type BpfStat C.struct_bpf_stat
239 type BpfProgram C.struct_bpf_program
241 type BpfInsn C.struct_bpf_insn
243 type BpfTimeval C.struct_bpf_timeval
245 type BpfHdr C.struct_bpf_hdr
249 type Termios C.struct_termios
251 type Termio C.struct_termio
253 type Winsize C.struct_winsize
257 type PollFd C.struct_pollfd
263 POLLNVAL = C.POLLNVAL
266 POLLRDBAND = C.POLLRDBAND
267 POLLRDNORM = C.POLLRDNORM
268 POLLWRBAND = C.POLLWRBAND
269 POLLWRNORM = C.POLLWRNORM