initial commit
[govpp.git] / vendor / golang.org / x / sys / unix / types_solaris.go
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.
4
5 // +build ignore
6
7 /*
8 Input to cgo -godefs.  See README.md
9 */
10
11 // +godefs map struct_in_addr [4]byte /* in_addr */
12 // +godefs map struct_in6_addr [16]byte /* in6_addr */
13
14 package unix
15
16 /*
17 #define KERNEL
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
23 #include <dirent.h>
24 #include <fcntl.h>
25 #include <netdb.h>
26 #include <limits.h>
27 #include <signal.h>
28 #include <termios.h>
29 #include <termio.h>
30 #include <stdio.h>
31 #include <unistd.h>
32 #include <sys/mman.h>
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>
39 #include <sys/stat.h>
40 #include <sys/time.h>
41 #include <sys/times.h>
42 #include <sys/types.h>
43 #include <sys/utsname.h>
44 #include <sys/un.h>
45 #include <sys/wait.h>
46 #include <net/bpf.h>
47 #include <net/if.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>
53 #include <ustat.h>
54 #include <utime.h>
55
56 enum {
57         sizeofPtr = sizeof(void*),
58 };
59
60 union sockaddr_all {
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;
66 };
67
68 struct sockaddr_any {
69         struct sockaddr addr;
70         char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
71 };
72
73 */
74 import "C"
75
76 // Machine characteristics; for internal use.
77
78 const (
79         sizeofPtr      = C.sizeofPtr
80         sizeofShort    = C.sizeof_short
81         sizeofInt      = C.sizeof_int
82         sizeofLong     = C.sizeof_long
83         sizeofLongLong = C.sizeof_longlong
84         PathMax        = C.PATH_MAX
85         MaxHostNameLen = C.MAXHOSTNAMELEN
86 )
87
88 // Basic types
89
90 type (
91         _C_short     C.short
92         _C_int       C.int
93         _C_long      C.long
94         _C_long_long C.longlong
95 )
96
97 // Time
98
99 type Timespec C.struct_timespec
100
101 type Timeval C.struct_timeval
102
103 type Timeval32 C.struct_timeval32
104
105 type Tms C.struct_tms
106
107 type Utimbuf C.struct_utimbuf
108
109 // Processes
110
111 type Rusage C.struct_rusage
112
113 type Rlimit C.struct_rlimit
114
115 type _Gid_t C.gid_t
116
117 // Files
118
119 const ( // Directory mode bits
120         S_IFMT   = C.S_IFMT
121         S_IFIFO  = C.S_IFIFO
122         S_IFCHR  = C.S_IFCHR
123         S_IFDIR  = C.S_IFDIR
124         S_IFBLK  = C.S_IFBLK
125         S_IFREG  = C.S_IFREG
126         S_IFLNK  = C.S_IFLNK
127         S_IFSOCK = C.S_IFSOCK
128         S_ISUID  = C.S_ISUID
129         S_ISGID  = C.S_ISGID
130         S_ISVTX  = C.S_ISVTX
131         S_IRUSR  = C.S_IRUSR
132         S_IWUSR  = C.S_IWUSR
133         S_IXUSR  = C.S_IXUSR
134 )
135
136 type Stat_t C.struct_stat
137
138 type Flock_t C.struct_flock
139
140 type Dirent C.struct_dirent
141
142 // Sockets
143
144 type RawSockaddrInet4 C.struct_sockaddr_in
145
146 type RawSockaddrInet6 C.struct_sockaddr_in6
147
148 type RawSockaddrUnix C.struct_sockaddr_un
149
150 type RawSockaddrDatalink C.struct_sockaddr_dl
151
152 type RawSockaddr C.struct_sockaddr
153
154 type RawSockaddrAny C.struct_sockaddr_any
155
156 type _Socklen C.socklen_t
157
158 type Linger C.struct_linger
159
160 type Iovec C.struct_iovec
161
162 type IPMreq C.struct_ip_mreq
163
164 type IPv6Mreq C.struct_ipv6_mreq
165
166 type Msghdr C.struct_msghdr
167
168 type Cmsghdr C.struct_cmsghdr
169
170 type Inet6Pktinfo C.struct_in6_pktinfo
171
172 type IPv6MTUInfo C.struct_ip6_mtuinfo
173
174 type ICMPv6Filter C.struct_icmp6_filter
175
176 const (
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
190 )
191
192 // Select
193
194 type FdSet C.fd_set
195
196 // Misc
197
198 type Utsname C.struct_utsname
199
200 type Ustat_t C.struct_ustat
201
202 const (
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
208 )
209
210 // Routing and interface messages
211
212 const (
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
218 )
219
220 type IfMsghdr C.struct_if_msghdr
221
222 type IfData C.struct_if_data
223
224 type IfaMsghdr C.struct_ifa_msghdr
225
226 type RtMsghdr C.struct_rt_msghdr
227
228 type RtMetrics C.struct_rt_metrics
229
230 // Berkeley packet filter
231
232 const (
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
238 )
239
240 type BpfVersion C.struct_bpf_version
241
242 type BpfStat C.struct_bpf_stat
243
244 type BpfProgram C.struct_bpf_program
245
246 type BpfInsn C.struct_bpf_insn
247
248 type BpfTimeval C.struct_bpf_timeval
249
250 type BpfHdr C.struct_bpf_hdr
251
252 // sysconf information
253
254 const _SC_PAGESIZE = C._SC_PAGESIZE
255
256 // Terminal handling
257
258 type Termios C.struct_termios
259
260 type Termio C.struct_termio
261
262 type Winsize C.struct_winsize