github.com/alexis81/domosgo@v0.0.0-20191016125037-5aee90a434af/Domos/src/golang.org/x/sys/unix/types_solaris.go (about) 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 <poll.h> 28 #include <signal.h> 29 #include <termios.h> 30 #include <termio.h> 31 #include <stdio.h> 32 #include <unistd.h> 33 #include <sys/mman.h> 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> 40 #include <sys/stat.h> 41 #include <sys/statvfs.h> 42 #include <sys/time.h> 43 #include <sys/times.h> 44 #include <sys/types.h> 45 #include <sys/utsname.h> 46 #include <sys/un.h> 47 #include <sys/wait.h> 48 #include <net/bpf.h> 49 #include <net/if.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> 55 #include <ustat.h> 56 #include <utime.h> 57 58 enum { 59 sizeofPtr = sizeof(void*), 60 }; 61 62 union sockaddr_all { 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; 68 }; 69 70 struct sockaddr_any { 71 struct sockaddr addr; 72 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 73 }; 74 75 */ 76 import "C" 77 78 // Machine characteristics; for internal use. 79 80 const ( 81 sizeofPtr = C.sizeofPtr 82 sizeofShort = C.sizeof_short 83 sizeofInt = C.sizeof_int 84 sizeofLong = C.sizeof_long 85 sizeofLongLong = C.sizeof_longlong 86 PathMax = C.PATH_MAX 87 MaxHostNameLen = C.MAXHOSTNAMELEN 88 ) 89 90 // Basic types 91 92 type ( 93 _C_short C.short 94 _C_int C.int 95 _C_long C.long 96 _C_long_long C.longlong 97 ) 98 99 // Time 100 101 type Timespec C.struct_timespec 102 103 type Timeval C.struct_timeval 104 105 type Timeval32 C.struct_timeval32 106 107 type Tms C.struct_tms 108 109 type Utimbuf C.struct_utimbuf 110 111 // Processes 112 113 type Rusage C.struct_rusage 114 115 type Rlimit C.struct_rlimit 116 117 type _Gid_t C.gid_t 118 119 // Files 120 121 const ( // Directory mode bits 122 S_IFMT = C.S_IFMT 123 S_IFIFO = C.S_IFIFO 124 S_IFCHR = C.S_IFCHR 125 S_IFDIR = C.S_IFDIR 126 S_IFBLK = C.S_IFBLK 127 S_IFREG = C.S_IFREG 128 S_IFLNK = C.S_IFLNK 129 S_IFSOCK = C.S_IFSOCK 130 S_ISUID = C.S_ISUID 131 S_ISGID = C.S_ISGID 132 S_ISVTX = C.S_ISVTX 133 S_IRUSR = C.S_IRUSR 134 S_IWUSR = C.S_IWUSR 135 S_IXUSR = C.S_IXUSR 136 ) 137 138 type Stat_t C.struct_stat 139 140 type Flock_t C.struct_flock 141 142 type Dirent C.struct_dirent 143 144 // Filesystems 145 146 type _Fsblkcnt_t C.fsblkcnt_t 147 148 type Statvfs_t C.struct_statvfs 149 150 // Sockets 151 152 type RawSockaddrInet4 C.struct_sockaddr_in 153 154 type RawSockaddrInet6 C.struct_sockaddr_in6 155 156 type RawSockaddrUnix C.struct_sockaddr_un 157 158 type RawSockaddrDatalink C.struct_sockaddr_dl 159 160 type RawSockaddr C.struct_sockaddr 161 162 type RawSockaddrAny C.struct_sockaddr_any 163 164 type _Socklen C.socklen_t 165 166 type Linger C.struct_linger 167 168 type Iovec C.struct_iovec 169 170 type IPMreq C.struct_ip_mreq 171 172 type IPv6Mreq C.struct_ipv6_mreq 173 174 type Msghdr C.struct_msghdr 175 176 type Cmsghdr C.struct_cmsghdr 177 178 type Inet6Pktinfo C.struct_in6_pktinfo 179 180 type IPv6MTUInfo C.struct_ip6_mtuinfo 181 182 type ICMPv6Filter C.struct_icmp6_filter 183 184 const ( 185 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 186 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 187 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 188 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 189 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 190 SizeofLinger = C.sizeof_struct_linger 191 SizeofIPMreq = C.sizeof_struct_ip_mreq 192 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 193 SizeofMsghdr = C.sizeof_struct_msghdr 194 SizeofCmsghdr = C.sizeof_struct_cmsghdr 195 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 196 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 197 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 198 ) 199 200 // Select 201 202 type FdSet C.fd_set 203 204 // Misc 205 206 type Utsname C.struct_utsname 207 208 type Ustat_t C.struct_ustat 209 210 const ( 211 AT_FDCWD = C.AT_FDCWD 212 AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW 213 AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW 214 AT_REMOVEDIR = C.AT_REMOVEDIR 215 AT_EACCESS = C.AT_EACCESS 216 ) 217 218 // Routing and interface messages 219 220 const ( 221 SizeofIfMsghdr = C.sizeof_struct_if_msghdr 222 SizeofIfData = C.sizeof_struct_if_data 223 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 224 SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 225 SizeofRtMetrics = C.sizeof_struct_rt_metrics 226 ) 227 228 type IfMsghdr C.struct_if_msghdr 229 230 type IfData C.struct_if_data 231 232 type IfaMsghdr C.struct_ifa_msghdr 233 234 type RtMsghdr C.struct_rt_msghdr 235 236 type RtMetrics C.struct_rt_metrics 237 238 // Berkeley packet filter 239 240 const ( 241 SizeofBpfVersion = C.sizeof_struct_bpf_version 242 SizeofBpfStat = C.sizeof_struct_bpf_stat 243 SizeofBpfProgram = C.sizeof_struct_bpf_program 244 SizeofBpfInsn = C.sizeof_struct_bpf_insn 245 SizeofBpfHdr = C.sizeof_struct_bpf_hdr 246 ) 247 248 type BpfVersion C.struct_bpf_version 249 250 type BpfStat C.struct_bpf_stat 251 252 type BpfProgram C.struct_bpf_program 253 254 type BpfInsn C.struct_bpf_insn 255 256 type BpfTimeval C.struct_bpf_timeval 257 258 type BpfHdr C.struct_bpf_hdr 259 260 // Terminal handling 261 262 type Termios C.struct_termios 263 264 type Termio C.struct_termio 265 266 type Winsize C.struct_winsize 267 268 // poll 269 270 type PollFd C.struct_pollfd 271 272 const ( 273 POLLERR = C.POLLERR 274 POLLHUP = C.POLLHUP 275 POLLIN = C.POLLIN 276 POLLNVAL = C.POLLNVAL 277 POLLOUT = C.POLLOUT 278 POLLPRI = C.POLLPRI 279 POLLRDBAND = C.POLLRDBAND 280 POLLRDNORM = C.POLLRDNORM 281 POLLWRBAND = C.POLLWRBAND 282 POLLWRNORM = C.POLLWRNORM 283 )