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
33 #include <sys/mount.h>
34 #include <sys/param.h>
35 #include <sys/resource.h>
36 #include <sys/select.h>
37 #include <sys/signal.h>
38 #include <sys/socket.h>
40 #include <sys/statvfs.h>
42 #include <sys/times.h>
43 #include <sys/types.h>
44 #include <sys/utsname.h>
49 #include <net/if_dl.h>
50 #include <net/route.h>
51 #include <netinet/in.h>
52 #include <netinet/icmp6.h>
53 #include <netinet/tcp.h>
58 sizeofPtr = sizeof(void*),
62 struct sockaddr s1; // this one gets used for fields
63 struct sockaddr_in s2; // these pad it out
64 struct sockaddr_in6 s3;
65 struct sockaddr_un s4;
66 struct sockaddr_dl s5;
71 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
77 // Machine characteristics; for internal use.
80 sizeofPtr = C.sizeofPtr
81 sizeofShort = C.sizeof_short
82 sizeofInt = C.sizeof_int
83 sizeofLong = C.sizeof_long
84 sizeofLongLong = C.sizeof_longlong
86 MaxHostNameLen = C.MAXHOSTNAMELEN
95 _C_long_long C.longlong
100 type Timespec C.struct_timespec
102 type Timeval C.struct_timeval
104 type Timeval32 C.struct_timeval32
106 type Tms C.struct_tms
108 type Utimbuf C.struct_utimbuf
112 type Rusage C.struct_rusage
114 type Rlimit C.struct_rlimit
120 const ( // Directory mode bits
128 S_IFSOCK = C.S_IFSOCK
137 type Stat_t C.struct_stat
139 type Flock_t C.struct_flock
141 type Dirent C.struct_dirent
145 type _Fsblkcnt_t C.fsblkcnt_t
147 type Statvfs_t C.struct_statvfs
151 type RawSockaddrInet4 C.struct_sockaddr_in
153 type RawSockaddrInet6 C.struct_sockaddr_in6
155 type RawSockaddrUnix C.struct_sockaddr_un
157 type RawSockaddrDatalink C.struct_sockaddr_dl
159 type RawSockaddr C.struct_sockaddr
161 type RawSockaddrAny C.struct_sockaddr_any
163 type _Socklen C.socklen_t
165 type Linger C.struct_linger
167 type Iovec C.struct_iovec
169 type IPMreq C.struct_ip_mreq
171 type IPv6Mreq C.struct_ipv6_mreq
173 type Msghdr C.struct_msghdr
175 type Cmsghdr C.struct_cmsghdr
177 type Inet6Pktinfo C.struct_in6_pktinfo
179 type IPv6MTUInfo C.struct_ip6_mtuinfo
181 type ICMPv6Filter C.struct_icmp6_filter
184 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
185 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
186 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
187 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
188 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
189 SizeofLinger = C.sizeof_struct_linger
190 SizeofIPMreq = C.sizeof_struct_ip_mreq
191 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
192 SizeofMsghdr = C.sizeof_struct_msghdr
193 SizeofCmsghdr = C.sizeof_struct_cmsghdr
194 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
195 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
196 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
205 type Utsname C.struct_utsname
207 type Ustat_t C.struct_ustat
210 AT_FDCWD = C.AT_FDCWD
211 AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
212 AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
213 AT_REMOVEDIR = C.AT_REMOVEDIR
214 AT_EACCESS = C.AT_EACCESS
217 // Routing and interface messages
220 SizeofIfMsghdr = C.sizeof_struct_if_msghdr
221 SizeofIfData = C.sizeof_struct_if_data
222 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
223 SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
224 SizeofRtMetrics = C.sizeof_struct_rt_metrics
227 type IfMsghdr C.struct_if_msghdr
229 type IfData C.struct_if_data
231 type IfaMsghdr C.struct_ifa_msghdr
233 type RtMsghdr C.struct_rt_msghdr
235 type RtMetrics C.struct_rt_metrics
237 // Berkeley packet filter
240 SizeofBpfVersion = C.sizeof_struct_bpf_version
241 SizeofBpfStat = C.sizeof_struct_bpf_stat
242 SizeofBpfProgram = C.sizeof_struct_bpf_program
243 SizeofBpfInsn = C.sizeof_struct_bpf_insn
244 SizeofBpfHdr = C.sizeof_struct_bpf_hdr
247 type BpfVersion C.struct_bpf_version
249 type BpfStat C.struct_bpf_stat
251 type BpfProgram C.struct_bpf_program
253 type BpfInsn C.struct_bpf_insn
255 type BpfTimeval C.struct_bpf_timeval
257 type BpfHdr C.struct_bpf_hdr
259 // sysconf information
261 const _SC_PAGESIZE = C._SC_PAGESIZE
265 type Termios C.struct_termios
267 type Termio C.struct_termio
269 type Winsize C.struct_winsize