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>
41 #include <sys/times.h>
42 #include <sys/types.h>
43 #include <sys/utsname.h>
48 #include <net/if_dl.h>
49 #include <net/route.h>
50 #include <netinet/in.h>
51 #include <netinet/icmp6.h>
52 #include <netinet/tcp.h>
57 sizeofPtr = sizeof(void*),
61 struct sockaddr s1; // this one gets used for fields
62 struct sockaddr_in s2; // these pad it out
63 struct sockaddr_in6 s3;
64 struct sockaddr_un s4;
65 struct sockaddr_dl s5;
70 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
76 // Machine characteristics; for internal use.
79 sizeofPtr = C.sizeofPtr
80 sizeofShort = C.sizeof_short
81 sizeofInt = C.sizeof_int
82 sizeofLong = C.sizeof_long
83 sizeofLongLong = C.sizeof_longlong
85 MaxHostNameLen = C.MAXHOSTNAMELEN
94 _C_long_long C.longlong
99 type Timespec C.struct_timespec
101 type Timeval C.struct_timeval
103 type Timeval32 C.struct_timeval32
105 type Tms C.struct_tms
107 type Utimbuf C.struct_utimbuf
111 type Rusage C.struct_rusage
113 type Rlimit C.struct_rlimit
119 const ( // Directory mode bits
127 S_IFSOCK = C.S_IFSOCK
136 type Stat_t C.struct_stat
138 type Flock_t C.struct_flock
140 type Dirent C.struct_dirent
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 SizeofIPMreq = C.sizeof_struct_ip_mreq
184 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
185 SizeofMsghdr = C.sizeof_struct_msghdr
186 SizeofCmsghdr = C.sizeof_struct_cmsghdr
187 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
188 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
189 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
198 type Utsname C.struct_utsname
200 type Ustat_t C.struct_ustat
203 AT_FDCWD = C.AT_FDCWD
204 AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
205 AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
206 AT_REMOVEDIR = C.AT_REMOVEDIR
207 AT_EACCESS = C.AT_EACCESS
210 // Routing and interface messages
213 SizeofIfMsghdr = C.sizeof_struct_if_msghdr
214 SizeofIfData = C.sizeof_struct_if_data
215 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
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 RtMsghdr C.struct_rt_msghdr
228 type RtMetrics C.struct_rt_metrics
230 // Berkeley packet filter
233 SizeofBpfVersion = C.sizeof_struct_bpf_version
234 SizeofBpfStat = C.sizeof_struct_bpf_stat
235 SizeofBpfProgram = C.sizeof_struct_bpf_program
236 SizeofBpfInsn = C.sizeof_struct_bpf_insn
237 SizeofBpfHdr = C.sizeof_struct_bpf_hdr
240 type BpfVersion C.struct_bpf_version
242 type BpfStat C.struct_bpf_stat
244 type BpfProgram C.struct_bpf_program
246 type BpfInsn C.struct_bpf_insn
248 type BpfTimeval C.struct_bpf_timeval
250 type BpfHdr C.struct_bpf_hdr
252 // sysconf information
254 const _SC_PAGESIZE = C._SC_PAGESIZE
258 type Termios C.struct_termios
260 type Termio C.struct_termio
262 type Winsize C.struct_winsize