socket_openbsd_386.go 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899
  1. // Code generated by 'ccgo sys/socket/gen.c -crt-import-path "" -export-defines "" -export-enums "" -export-externs X -export-fields F -export-structs "" -export-typedefs "" -header -hide _OSSwapInt16,_OSSwapInt32,_OSSwapInt64 -ignore-unsupported-alignment -o sys/socket/socket_openbsd_386.go -pkgname socket', DO NOT EDIT.
  2. package socket
  3. import (
  4. "math"
  5. "reflect"
  6. "sync/atomic"
  7. "unsafe"
  8. )
  9. var _ = math.Pi
  10. var _ reflect.Kind
  11. var _ atomic.Value
  12. var _ unsafe.Pointer
  13. const (
  14. AF_APPLETALK = 16 // socket.h:181:1:
  15. AF_BLUETOOTH = 32 // socket.h:199:1:
  16. AF_CCITT = 10 // socket.h:175:1:
  17. AF_CHAOS = 5 // socket.h:169:1:
  18. AF_CNT = 21 // socket.h:186:1:
  19. AF_COIP = 20 // socket.h:185:1:
  20. AF_DATAKIT = 9 // socket.h:174:1:
  21. AF_DECnet = 12 // socket.h:177:1:
  22. AF_DLI = 13 // socket.h:178:1:
  23. AF_E164 = 26 // socket.h:192:1:
  24. AF_ECMA = 8 // socket.h:173:1:
  25. AF_ENCAP = 28 // socket.h:194:1:
  26. AF_HYLINK = 15 // socket.h:180:1:
  27. AF_IMPLINK = 3 // socket.h:167:1:
  28. AF_INET = 2 // socket.h:166:1:
  29. AF_INET6 = 24 // socket.h:189:1:
  30. AF_IPX = 23 // socket.h:188:1:
  31. AF_ISDN = 26 // socket.h:191:1:
  32. AF_ISO = 7 // socket.h:171:1:
  33. AF_KEY = 30 // socket.h:196:1:
  34. AF_LAT = 14 // socket.h:179:1:
  35. AF_LINK = 18 // socket.h:183:1:
  36. AF_LOCAL = 1 // socket.h:165:1:
  37. AF_MAX = 36 // socket.h:203:1:
  38. AF_MPLS = 33 // socket.h:200:1:
  39. AF_NATM = 27 // socket.h:193:1:
  40. AF_NS = 6 // socket.h:170:1:
  41. AF_OSI = 7 // socket.h:172:1:
  42. AF_PUP = 4 // socket.h:168:1:
  43. AF_ROUTE = 17 // socket.h:182:1:
  44. AF_SIP = 29 // socket.h:195:1:
  45. AF_SNA = 11 // socket.h:176:1:
  46. AF_UNIX = 1 // socket.h:164:1:
  47. AF_UNSPEC = 0 // socket.h:163:1:
  48. BIG_ENDIAN = 4321 // endian.h:45:1:
  49. BYTE_ORDER = 1234 // endian.h:47:1:
  50. LITTLE_ENDIAN = 1234 // endian.h:44:1:
  51. MSG_BCAST = 0x100 // socket.h:508:1:
  52. MSG_CMSG_CLOEXEC = 0x800 // socket.h:511:1:
  53. MSG_CTRUNC = 0x20 // socket.h:505:1:
  54. MSG_DONTROUTE = 0x4 // socket.h:502:1:
  55. MSG_DONTWAIT = 0x80 // socket.h:507:1:
  56. MSG_EOR = 0x8 // socket.h:503:1:
  57. MSG_MCAST = 0x200 // socket.h:509:1:
  58. MSG_NOSIGNAL = 0x400 // socket.h:510:1:
  59. MSG_OOB = 0x1 // socket.h:500:1:
  60. MSG_PEEK = 0x2 // socket.h:501:1:
  61. MSG_TRUNC = 0x10 // socket.h:504:1:
  62. MSG_WAITALL = 0x40 // socket.h:506:1:
  63. MSG_WAITFORONE = 0x1000 // socket.h:512:1:
  64. NET_BPF_BUFSIZE = 1 // socket.h:452:1:
  65. NET_BPF_MAXBUFSIZE = 2 // socket.h:453:1:
  66. NET_BPF_MAXID = 3 // socket.h:454:1:
  67. NET_KEY_MAXID = 3 // socket.h:441:1:
  68. NET_KEY_SADB_DUMP = 1 // socket.h:439:1:
  69. NET_KEY_SPD_DUMP = 2 // socket.h:440:1:
  70. NET_LINK_IFRXQ = 1 // socket.h:416:1:
  71. NET_LINK_IFRXQ_MAXID = 3 // socket.h:428:1:
  72. NET_LINK_IFRXQ_PRESSURE_DROP = 2 // socket.h:426:1:
  73. NET_LINK_IFRXQ_PRESSURE_RETURN = 1 // socket.h:424:1:
  74. NET_LINK_MAXID = 2 // socket.h:417:1:
  75. NET_MAXID = 36 // socket.h:314:1:
  76. NET_PFLOW_MAXID = 2 // socket.h:466:1:
  77. NET_PFLOW_STATS = 1 // socket.h:465:1:
  78. NET_RT_DUMP = 1 // socket.h:365:1:
  79. NET_RT_FLAGS = 2 // socket.h:366:1:
  80. NET_RT_IFLIST = 3 // socket.h:367:1:
  81. NET_RT_IFNAMES = 6 // socket.h:370:1:
  82. NET_RT_MAXID = 8 // socket.h:372:1:
  83. NET_RT_SOURCE = 7 // socket.h:371:1:
  84. NET_RT_STATS = 4 // socket.h:368:1:
  85. NET_RT_TABLE = 5 // socket.h:369:1:
  86. NET_UNIX_DEFERRED = 7 // socket.h:389:1:
  87. NET_UNIX_INFLIGHT = 6 // socket.h:388:1:
  88. NET_UNIX_MAXID = 8 // socket.h:390:1:
  89. NET_UNIX_PROTO_MAXID = 3 // socket.h:405:1:
  90. PDP_ENDIAN = 3412 // endian.h:46:1:
  91. PF_APPLETALK = 16 // socket.h:267:1:
  92. PF_BLUETOOTH = 32 // socket.h:283:1:
  93. PF_BPF = 31 // socket.h:282:1:
  94. PF_CCITT = 10 // socket.h:261:1:
  95. PF_CHAOS = 5 // socket.h:255:1:
  96. PF_CNT = 21 // socket.h:272:1:
  97. PF_COIP = 20 // socket.h:271:1:
  98. PF_DATAKIT = 9 // socket.h:260:1:
  99. PF_DECnet = 12 // socket.h:263:1:
  100. PF_DLI = 13 // socket.h:264:1:
  101. PF_ECMA = 8 // socket.h:259:1:
  102. PF_ENCAP = 28 // socket.h:279:1:
  103. PF_HYLINK = 15 // socket.h:266:1:
  104. PF_IMPLINK = 3 // socket.h:253:1:
  105. PF_INET = 2 // socket.h:252:1:
  106. PF_INET6 = 24 // socket.h:274:1:
  107. PF_IPX = 23 // socket.h:273:1:
  108. PF_ISDN = 26 // socket.h:277:1:
  109. PF_ISO = 7 // socket.h:257:1:
  110. PF_KEY = 30 // socket.h:281:1:
  111. PF_LAT = 14 // socket.h:265:1:
  112. PF_LINK = 18 // socket.h:269:1:
  113. PF_LOCAL = 1 // socket.h:250:1:
  114. PF_MAX = 36 // socket.h:287:1:
  115. PF_MPLS = 33 // socket.h:284:1:
  116. PF_NATM = 27 // socket.h:278:1:
  117. PF_NS = 6 // socket.h:256:1:
  118. PF_OSI = 7 // socket.h:258:1:
  119. PF_PFLOW = 34 // socket.h:285:1:
  120. PF_PIP = 25 // socket.h:276:1:
  121. PF_PIPEX = 35 // socket.h:286:1:
  122. PF_PUP = 4 // socket.h:254:1:
  123. PF_ROUTE = 17 // socket.h:268:1:
  124. PF_RTIP = 22 // socket.h:275:1:
  125. PF_SIP = 29 // socket.h:280:1:
  126. PF_SNA = 11 // socket.h:262:1:
  127. PF_UNIX = 1 // socket.h:251:1:
  128. PF_UNSPEC = 0 // socket.h:249:1:
  129. PF_XTP = 19 // socket.h:270:1:
  130. RT_TABLEID_BITS = 8 // socket.h:150:1:
  131. RT_TABLEID_MASK = 0xff // socket.h:151:1:
  132. RT_TABLEID_MAX = 255 // socket.h:149:1:
  133. SCM_RIGHTS = 0x01 // socket.h:560:1:
  134. SCM_TIMESTAMP = 0x04 // socket.h:561:1:
  135. SHUT_RD = 0 // socket.h:292:1:
  136. SHUT_RDWR = 2 // socket.h:294:1:
  137. SHUT_WR = 1 // socket.h:293:1:
  138. SOCK_CLOEXEC = 0x8000 // socket.h:76:1:
  139. SOCK_DGRAM = 2 // socket.h:64:1:
  140. SOCK_DNS = 0x1000 // socket.h:81:1:
  141. SOCK_NONBLOCK = 0x4000 // socket.h:77:1:
  142. SOCK_RAW = 3 // socket.h:65:1:
  143. SOCK_RDM = 4 // socket.h:66:1:
  144. SOCK_SEQPACKET = 5 // socket.h:67:1:
  145. SOCK_STREAM = 1 // socket.h:63:1:
  146. SOL_SOCKET = 0xffff // socket.h:158:1:
  147. SOMAXCONN = 128 // socket.h:477:1:
  148. SO_ACCEPTCONN = 0x0002 // socket.h:88:1:
  149. SO_BINDANY = 0x1000 // socket.h:98:1:
  150. SO_BROADCAST = 0x0020 // socket.h:92:1:
  151. SO_DEBUG = 0x0001 // socket.h:87:1:
  152. SO_DOMAIN = 0x1024 // socket.h:116:1:
  153. SO_DONTROUTE = 0x0010 // socket.h:91:1:
  154. SO_ERROR = 0x1007 // socket.h:110:1:
  155. SO_KEEPALIVE = 0x0008 // socket.h:90:1:
  156. SO_LINGER = 0x0080 // socket.h:94:1:
  157. SO_NETPROC = 0x1020 // socket.h:112:1:
  158. SO_OOBINLINE = 0x0100 // socket.h:95:1:
  159. SO_PEERCRED = 0x1022 // socket.h:114:1:
  160. SO_PROTOCOL = 0x1025 // socket.h:117:1:
  161. SO_RCVBUF = 0x1002 // socket.h:105:1:
  162. SO_RCVLOWAT = 0x1004 // socket.h:107:1:
  163. SO_RCVTIMEO = 0x1006 // socket.h:109:1:
  164. SO_REUSEADDR = 0x0004 // socket.h:89:1:
  165. SO_REUSEPORT = 0x0200 // socket.h:96:1:
  166. SO_RTABLE = 0x1021 // socket.h:113:1:
  167. SO_SNDBUF = 0x1001 // socket.h:104:1:
  168. SO_SNDLOWAT = 0x1003 // socket.h:106:1:
  169. SO_SNDTIMEO = 0x1005 // socket.h:108:1:
  170. SO_SPLICE = 0x1023 // socket.h:115:1:
  171. SO_TIMESTAMP = 0x0800 // socket.h:97:1:
  172. SO_TYPE = 0x1008 // socket.h:111:1:
  173. SO_USELOOPBACK = 0x0040 // socket.h:93:1:
  174. SO_ZEROIZE = 0x2000 // socket.h:99:1:
  175. UIO_MAXIOV = 1024 // uio.h:84:1:
  176. UNPCTL_RECVSPACE = 1 // socket.h:403:1:
  177. UNPCTL_SENDSPACE = 2 // socket.h:404:1:
  178. X_BIG_ENDIAN = 4321 // _endian.h:43:1:
  179. X_BYTE_ORDER = 1234 // endian.h:58:1:
  180. X_CLOCKID_T_DEFINED_ = 0 // types.h:162:1:
  181. X_CLOCK_T_DEFINED_ = 0 // types.h:157:1:
  182. X_FILE_OFFSET_BITS = 64 // <builtin>:25:1:
  183. X_ILP32 = 1 // <predefined>:1:1:
  184. X_INT16_T_DEFINED_ = 0 // types.h:84:1:
  185. X_INT32_T_DEFINED_ = 0 // types.h:94:1:
  186. X_INT64_T_DEFINED_ = 0 // types.h:104:1:
  187. X_INT8_T_DEFINED_ = 0 // types.h:74:1:
  188. X_LITTLE_ENDIAN = 1234 // _endian.h:42:1:
  189. X_MACHINE_CDEFS_H_ = 0 // cdefs.h:9:1:
  190. X_MACHINE_ENDIAN_H_ = 0 // endian.h:28:1:
  191. X_MACHINE__TYPES_H_ = 0 // _types.h:36:1:
  192. X_MAX_PAGE_SHIFT = 12 // _types.h:52:1:
  193. X_OFF_T_DEFINED_ = 0 // types.h:192:1:
  194. X_PDP_ENDIAN = 3412 // _endian.h:44:1:
  195. X_PID_T_DEFINED_ = 0 // types.h:167:1:
  196. X_QUAD_HIGHWORD = 1 // _endian.h:95:1:
  197. X_QUAD_LOWWORD = 0 // _endian.h:96:1:
  198. X_SA_FAMILY_T_DEFINED_ = 0 // socket.h:51:1:
  199. X_SIZE_T_DEFINED_ = 0 // uio.h:42:1:
  200. X_SOCKLEN_T_DEFINED_ = 0 // socket.h:46:1:
  201. X_SSIZE_T_DEFINED_ = 0 // uio.h:47:1:
  202. X_STACKALIGNBYTES = 15 // _types.h:49:1:
  203. X_SYS_CDEFS_H_ = 0 // cdefs.h:39:1:
  204. X_SYS_ENDIAN_H_ = 0 // endian.h:38:1:
  205. X_SYS_SOCKET_H_ = 0 // socket.h:36:1:
  206. X_SYS_TYPES_H_ = 0 // types.h:41:1:
  207. X_SYS_UIO_H_ = 0 // uio.h:36:1:
  208. X_SYS__ENDIAN_H_ = 0 // _endian.h:34:1:
  209. X_SYS__TYPES_H_ = 0 // _types.h:35:1:
  210. X_TIMER_T_DEFINED_ = 0 // types.h:187:1:
  211. X_TIMEVAL_DECLARED = 0 // socket.h:130:1:
  212. X_TIME_T_DEFINED_ = 0 // types.h:182:1:
  213. X_UINT16_T_DEFINED_ = 0 // types.h:89:1:
  214. X_UINT32_T_DEFINED_ = 0 // types.h:99:1:
  215. X_UINT64_T_DEFINED_ = 0 // types.h:109:1:
  216. X_UINT8_T_DEFINED_ = 0 // types.h:79:1:
  217. I386 = 1 // <predefined>:339:1:
  218. Pseudo_AF_HDRCMPLT = 31 // socket.h:197:1:
  219. Pseudo_AF_PFLOW = 34 // socket.h:201:1:
  220. Pseudo_AF_PIP = 25 // socket.h:190:1:
  221. Pseudo_AF_PIPEX = 35 // socket.h:202:1:
  222. Pseudo_AF_RTIP = 22 // socket.h:187:1:
  223. Pseudo_AF_XTP = 19 // socket.h:184:1:
  224. Unix = 1 // <predefined>:340:1:
  225. )
  226. const ( /* uio.h:57:1: */
  227. UIO_READ = 0
  228. UIO_WRITE = 1
  229. )
  230. // Segment flag values.
  231. const ( /* uio.h:60:1: */
  232. UIO_USERSPACE = 0 // from user data space
  233. UIO_SYSSPACE = 1
  234. )
  235. type Ptrdiff_t = int32 /* <builtin>:3:26 */
  236. type Size_t = uint32 /* <builtin>:9:23 */
  237. type Wchar_t = int32 /* <builtin>:15:24 */
  238. type X__builtin_va_list = uintptr /* <builtin>:46:14 */
  239. type X__float128 = float64 /* <builtin>:47:21 */
  240. // $OpenBSD: socket.h,v 1.105 2022/09/03 21:13:48 mbuhl Exp $
  241. // $NetBSD: socket.h,v 1.14 1996/02/09 18:25:36 christos Exp $
  242. // Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
  243. // The Regents of the University of California. All rights reserved.
  244. //
  245. // Redistribution and use in source and binary forms, with or without
  246. // modification, are permitted provided that the following conditions
  247. // are met:
  248. // 1. Redistributions of source code must retain the above copyright
  249. // notice, this list of conditions and the following disclaimer.
  250. // 2. Redistributions in binary form must reproduce the above copyright
  251. // notice, this list of conditions and the following disclaimer in the
  252. // documentation and/or other materials provided with the distribution.
  253. // 3. Neither the name of the University nor the names of its contributors
  254. // may be used to endorse or promote products derived from this software
  255. // without specific prior written permission.
  256. //
  257. // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  258. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  259. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  260. // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  261. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  262. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  263. // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  264. // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  265. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  266. // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  267. // SUCH DAMAGE.
  268. //
  269. // @(#)socket.h 8.4 (Berkeley) 2/21/94
  270. // get the definitions for struct iovec, size_t, ssize_t, and <sys/cdefs.h>
  271. // $OpenBSD: uio.h,v 1.19 2018/08/20 16:00:22 mpi Exp $
  272. // $NetBSD: uio.h,v 1.12 1996/02/09 18:25:45 christos Exp $
  273. // Copyright (c) 1982, 1986, 1993, 1994
  274. // The Regents of the University of California. All rights reserved.
  275. //
  276. // Redistribution and use in source and binary forms, with or without
  277. // modification, are permitted provided that the following conditions
  278. // are met:
  279. // 1. Redistributions of source code must retain the above copyright
  280. // notice, this list of conditions and the following disclaimer.
  281. // 2. Redistributions in binary form must reproduce the above copyright
  282. // notice, this list of conditions and the following disclaimer in the
  283. // documentation and/or other materials provided with the distribution.
  284. // 3. Neither the name of the University nor the names of its contributors
  285. // may be used to endorse or promote products derived from this software
  286. // without specific prior written permission.
  287. //
  288. // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  289. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  290. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  291. // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  292. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  293. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  294. // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  295. // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  296. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  297. // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  298. // SUCH DAMAGE.
  299. //
  300. // @(#)uio.h 8.5 (Berkeley) 2/22/94
  301. // $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
  302. // $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
  303. // Copyright (c) 1991, 1993
  304. // The Regents of the University of California. All rights reserved.
  305. //
  306. // This code is derived from software contributed to Berkeley by
  307. // Berkeley Software Design, Inc.
  308. //
  309. // Redistribution and use in source and binary forms, with or without
  310. // modification, are permitted provided that the following conditions
  311. // are met:
  312. // 1. Redistributions of source code must retain the above copyright
  313. // notice, this list of conditions and the following disclaimer.
  314. // 2. Redistributions in binary form must reproduce the above copyright
  315. // notice, this list of conditions and the following disclaimer in the
  316. // documentation and/or other materials provided with the distribution.
  317. // 3. Neither the name of the University nor the names of its contributors
  318. // may be used to endorse or promote products derived from this software
  319. // without specific prior written permission.
  320. //
  321. // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  322. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  323. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  324. // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  325. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  326. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  327. // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  328. // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  329. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  330. // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  331. // SUCH DAMAGE.
  332. //
  333. // @(#)cdefs.h 8.7 (Berkeley) 1/21/94
  334. // $OpenBSD: cdefs.h,v 1.10 2013/03/28 17:30:45 martynas Exp $
  335. // Written by J.T. Conklin <jtc@wimsey.com> 01/17/95.
  336. // Public domain.
  337. // Macro to test if we're using a specific version of gcc or later.
  338. // The __CONCAT macro is used to concatenate parts of symbol names, e.g.
  339. // with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
  340. // The __CONCAT macro is a bit tricky -- make sure you don't put spaces
  341. // in between its arguments. Do not use __CONCAT on double-quoted strings,
  342. // such as those from the __STRING macro: to concatenate strings just put
  343. // them next to each other.
  344. // GCC1 and some versions of GCC2 declare dead (non-returning) and
  345. // pure (no side effects) functions using "volatile" and "const";
  346. // unfortunately, these then cause warnings under "-ansi -pedantic".
  347. // GCC >= 2.5 uses the __attribute__((attrs)) style. All of these
  348. // work for GNU C++ (modulo a slight glitch in the C++ grammar in
  349. // the distribution version of 2.5.5).
  350. // __returns_twice makes the compiler not assume the function
  351. // only returns once. This affects registerisation of variables:
  352. // even local variables need to be in memory across such a call.
  353. // Example: setjmp()
  354. // __only_inline makes the compiler only use this function definition
  355. // for inlining; references that can't be inlined will be left as
  356. // external references instead of generating a local copy. The
  357. // matching library should include a simple extern definition for
  358. // the function to handle those references. c.f. ctype.h
  359. // GNU C version 2.96 adds explicit branch prediction so that
  360. // the CPU back-end can hint the processor and also so that
  361. // code blocks can be reordered such that the predicted path
  362. // sees a more linear flow, thus improving cache behavior, etc.
  363. //
  364. // The following two macros provide us with a way to utilize this
  365. // compiler feature. Use __predict_true() if you expect the expression
  366. // to evaluate to true, and __predict_false() if you expect the
  367. // expression to evaluate to false.
  368. //
  369. // A few notes about usage:
  370. //
  371. // * Generally, __predict_false() error condition checks (unless
  372. // you have some _strong_ reason to do otherwise, in which case
  373. // document it), and/or __predict_true() `no-error' condition
  374. // checks, assuming you want to optimize for the no-error case.
  375. //
  376. // * Other than that, if you don't know the likelihood of a test
  377. // succeeding from empirical or other `hard' evidence, don't
  378. // make predictions.
  379. //
  380. // * These are meant to be used in places that are run `a lot'.
  381. // It is wasteful to make predictions in code that is run
  382. // seldomly (e.g. at subsystem initialization time) as the
  383. // basic block reordering that this affects can often generate
  384. // larger code.
  385. // Delete pseudo-keywords wherever they are not available or needed.
  386. // The __packed macro indicates that a variable or structure members
  387. // should have the smallest possible alignment, despite any host CPU
  388. // alignment requirements.
  389. //
  390. // The __aligned(x) macro specifies the minimum alignment of a
  391. // variable or structure.
  392. //
  393. // These macros together are useful for describing the layout and
  394. // alignment of messages exchanged with hardware or other systems.
  395. // "The nice thing about standards is that there are so many to choose from."
  396. // There are a number of "feature test macros" specified by (different)
  397. // standards that determine which interfaces and types the header files
  398. // should expose.
  399. //
  400. // Because of inconsistencies in these macros, we define our own
  401. // set in the private name space that end in _VISIBLE. These are
  402. // always defined and so headers can test their values easily.
  403. // Things can get tricky when multiple feature macros are defined.
  404. // We try to take the union of all the features requested.
  405. //
  406. // The following macros are guaranteed to have a value after cdefs.h
  407. // has been included:
  408. // __POSIX_VISIBLE
  409. // __XPG_VISIBLE
  410. // __ISO_C_VISIBLE
  411. // __BSD_VISIBLE
  412. // X/Open Portability Guides and Single Unix Specifications.
  413. // _XOPEN_SOURCE XPG3
  414. // _XOPEN_SOURCE && _XOPEN_VERSION = 4 XPG4
  415. // _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1 XPG4v2
  416. // _XOPEN_SOURCE == 500 XPG5
  417. // _XOPEN_SOURCE == 520 XPG5v2
  418. // _XOPEN_SOURCE == 600 POSIX 1003.1-2001 with XSI
  419. // _XOPEN_SOURCE == 700 POSIX 1003.1-2008 with XSI
  420. //
  421. // The XPG spec implies a specific value for _POSIX_C_SOURCE.
  422. // POSIX macros, these checks must follow the XOPEN ones above.
  423. //
  424. // _POSIX_SOURCE == 1 1003.1-1988 (superseded by _POSIX_C_SOURCE)
  425. // _POSIX_C_SOURCE == 1 1003.1-1990
  426. // _POSIX_C_SOURCE == 2 1003.2-1992
  427. // _POSIX_C_SOURCE == 199309L 1003.1b-1993
  428. // _POSIX_C_SOURCE == 199506L 1003.1c-1995, 1003.1i-1995,
  429. // and the omnibus ISO/IEC 9945-1:1996
  430. // _POSIX_C_SOURCE == 200112L 1003.1-2001
  431. // _POSIX_C_SOURCE == 200809L 1003.1-2008
  432. //
  433. // The POSIX spec implies a specific value for __ISO_C_VISIBLE, though
  434. // this may be overridden by the _ISOC99_SOURCE macro later.
  435. // _ANSI_SOURCE means to expose ANSI C89 interfaces only.
  436. // If the user defines it in addition to one of the POSIX or XOPEN
  437. // macros, assume the POSIX/XOPEN macro(s) should take precedence.
  438. // _ISOC99_SOURCE, _ISOC11_SOURCE, __STDC_VERSION__, and __cplusplus
  439. // override any of the other macros since they are non-exclusive.
  440. // Finally deal with BSD-specific interfaces that are not covered
  441. // by any standards. We expose these when none of the POSIX or XPG
  442. // macros is defined or if the user explicitly asks for them.
  443. // Default values.
  444. // $OpenBSD: _types.h,v 1.10 2022/08/06 13:31:13 semarie Exp $
  445. // -
  446. // Copyright (c) 1990, 1993
  447. // The Regents of the University of California. All rights reserved.
  448. //
  449. // Redistribution and use in source and binary forms, with or without
  450. // modification, are permitted provided that the following conditions
  451. // are met:
  452. // 1. Redistributions of source code must retain the above copyright
  453. // notice, this list of conditions and the following disclaimer.
  454. // 2. Redistributions in binary form must reproduce the above copyright
  455. // notice, this list of conditions and the following disclaimer in the
  456. // documentation and/or other materials provided with the distribution.
  457. // 3. Neither the name of the University nor the names of its contributors
  458. // may be used to endorse or promote products derived from this software
  459. // without specific prior written permission.
  460. //
  461. // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  462. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  463. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  464. // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  465. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  466. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  467. // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  468. // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  469. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  470. // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  471. // SUCH DAMAGE.
  472. //
  473. // @(#)types.h 8.3 (Berkeley) 1/5/94
  474. // $OpenBSD: _types.h,v 1.23 2018/03/05 01:15:25 deraadt Exp $
  475. // -
  476. // Copyright (c) 1990, 1993
  477. // The Regents of the University of California. All rights reserved.
  478. //
  479. // Redistribution and use in source and binary forms, with or without
  480. // modification, are permitted provided that the following conditions
  481. // are met:
  482. // 1. Redistributions of source code must retain the above copyright
  483. // notice, this list of conditions and the following disclaimer.
  484. // 2. Redistributions in binary form must reproduce the above copyright
  485. // notice, this list of conditions and the following disclaimer in the
  486. // documentation and/or other materials provided with the distribution.
  487. // 3. Neither the name of the University nor the names of its contributors
  488. // may be used to endorse or promote products derived from this software
  489. // without specific prior written permission.
  490. //
  491. // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  492. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  493. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  494. // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  495. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  496. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  497. // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  498. // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  499. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  500. // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  501. // SUCH DAMAGE.
  502. //
  503. // @(#)types.h 8.3 (Berkeley) 1/5/94
  504. // @(#)ansi.h 8.2 (Berkeley) 1/4/94
  505. // _ALIGN(p) rounds p (pointer or byte index) up to a correctly-aligned
  506. // value for all data types (int, long, ...). The result is an
  507. // unsigned long and must be cast to any desired pointer type.
  508. //
  509. // _ALIGNED_POINTER is a boolean macro that checks whether an address
  510. // is valid to fetch data elements of type t from on this architecture.
  511. // This does not reflect the optimal alignment, just the possibility
  512. // (within reasonable limits).
  513. // 7.18.1.1 Exact-width integer types
  514. type X__int8_t = int8 /* _types.h:61:22 */
  515. type X__uint8_t = uint8 /* _types.h:62:24 */
  516. type X__int16_t = int16 /* _types.h:63:17 */
  517. type X__uint16_t = uint16 /* _types.h:64:25 */
  518. type X__int32_t = int32 /* _types.h:65:15 */
  519. type X__uint32_t = uint32 /* _types.h:66:23 */
  520. type X__int64_t = int64 /* _types.h:67:20 */
  521. type X__uint64_t = uint64 /* _types.h:68:28 */
  522. // 7.18.1.2 Minimum-width integer types
  523. type X__int_least8_t = X__int8_t /* _types.h:71:19 */
  524. type X__uint_least8_t = X__uint8_t /* _types.h:72:20 */
  525. type X__int_least16_t = X__int16_t /* _types.h:73:20 */
  526. type X__uint_least16_t = X__uint16_t /* _types.h:74:21 */
  527. type X__int_least32_t = X__int32_t /* _types.h:75:20 */
  528. type X__uint_least32_t = X__uint32_t /* _types.h:76:21 */
  529. type X__int_least64_t = X__int64_t /* _types.h:77:20 */
  530. type X__uint_least64_t = X__uint64_t /* _types.h:78:21 */
  531. // 7.18.1.3 Fastest minimum-width integer types
  532. type X__int_fast8_t = X__int32_t /* _types.h:81:20 */
  533. type X__uint_fast8_t = X__uint32_t /* _types.h:82:21 */
  534. type X__int_fast16_t = X__int32_t /* _types.h:83:20 */
  535. type X__uint_fast16_t = X__uint32_t /* _types.h:84:21 */
  536. type X__int_fast32_t = X__int32_t /* _types.h:85:20 */
  537. type X__uint_fast32_t = X__uint32_t /* _types.h:86:21 */
  538. type X__int_fast64_t = X__int64_t /* _types.h:87:20 */
  539. type X__uint_fast64_t = X__uint64_t /* _types.h:88:21 */
  540. // 7.18.1.4 Integer types capable of holding object pointers
  541. type X__intptr_t = int32 /* _types.h:103:16 */
  542. type X__uintptr_t = uint32 /* _types.h:104:24 */
  543. // 7.18.1.5 Greatest-width integer types
  544. type X__intmax_t = X__int64_t /* _types.h:107:20 */
  545. type X__uintmax_t = X__uint64_t /* _types.h:108:21 */
  546. // Register size
  547. type X__register_t = int32 /* _types.h:111:16 */
  548. // VM system types
  549. type X__vaddr_t = uint32 /* _types.h:114:24 */
  550. type X__paddr_t = uint32 /* _types.h:115:24 */
  551. type X__vsize_t = uint32 /* _types.h:116:24 */
  552. type X__psize_t = uint32 /* _types.h:117:24 */
  553. // Standard system types
  554. type X__double_t = float64 /* _types.h:120:22 */
  555. type X__float_t = float64 /* _types.h:121:22 */
  556. type X__ptrdiff_t = int32 /* _types.h:122:16 */
  557. type X__size_t = uint32 /* _types.h:123:24 */
  558. type X__ssize_t = int32 /* _types.h:124:16 */
  559. type X__va_list = X__builtin_va_list /* _types.h:126:27 */
  560. // Wide character support types
  561. type X__wchar_t = int32 /* _types.h:133:15 */
  562. type X__wint_t = int32 /* _types.h:135:15 */
  563. type X__rune_t = int32 /* _types.h:136:15 */
  564. type X__wctrans_t = uintptr /* _types.h:137:14 */
  565. type X__wctype_t = uintptr /* _types.h:138:14 */
  566. type X__blkcnt_t = X__int64_t /* _types.h:39:19 */ // blocks allocated for file
  567. type X__blksize_t = X__int32_t /* _types.h:40:19 */ // optimal blocksize for I/O
  568. type X__clock_t = X__int64_t /* _types.h:41:19 */ // ticks in CLOCKS_PER_SEC
  569. type X__clockid_t = X__int32_t /* _types.h:42:19 */ // CLOCK_* identifiers
  570. type X__cpuid_t = uint32 /* _types.h:43:23 */ // CPU id
  571. type X__dev_t = X__int32_t /* _types.h:44:19 */ // device number
  572. type X__fixpt_t = X__uint32_t /* _types.h:45:20 */ // fixed point number
  573. type X__fsblkcnt_t = X__uint64_t /* _types.h:46:20 */ // file system block count
  574. type X__fsfilcnt_t = X__uint64_t /* _types.h:47:20 */ // file system file count
  575. type X__gid_t = X__uint32_t /* _types.h:48:20 */ // group id
  576. type X__id_t = X__uint32_t /* _types.h:49:20 */ // may contain pid, uid or gid
  577. type X__in_addr_t = X__uint32_t /* _types.h:50:20 */ // base type for internet address
  578. type X__in_port_t = X__uint16_t /* _types.h:51:20 */ // IP port type
  579. type X__ino_t = X__uint64_t /* _types.h:52:20 */ // inode number
  580. type X__key_t = int32 /* _types.h:53:15 */ // IPC key (for Sys V IPC)
  581. type X__mode_t = X__uint32_t /* _types.h:54:20 */ // permissions
  582. type X__nlink_t = X__uint32_t /* _types.h:55:20 */ // link count
  583. type X__off_t = X__int64_t /* _types.h:56:19 */ // file offset or size
  584. type X__pid_t = X__int32_t /* _types.h:57:19 */ // process id
  585. type X__rlim_t = X__uint64_t /* _types.h:58:20 */ // resource limit
  586. type X__sa_family_t = X__uint8_t /* _types.h:59:19 */ // sockaddr address family type
  587. type X__segsz_t = X__int32_t /* _types.h:60:19 */ // segment size
  588. type X__socklen_t = X__uint32_t /* _types.h:61:20 */ // length type for network syscalls
  589. type X__suseconds_t = int32 /* _types.h:62:15 */ // microseconds (signed)
  590. type X__time_t = X__int64_t /* _types.h:63:19 */ // epoch time
  591. type X__timer_t = X__int32_t /* _types.h:64:19 */ // POSIX timer identifiers
  592. type X__uid_t = X__uint32_t /* _types.h:65:20 */ // user id
  593. type X__useconds_t = X__uint32_t /* _types.h:66:20 */ // microseconds
  594. // mbstate_t is an opaque object to keep conversion state, during multibyte
  595. // stream conversions. The content must not be referenced by user programs.
  596. type X__mbstate_t = struct {
  597. F__ccgo_pad1 [0]uint32
  598. F__mbstate8 [128]int8
  599. } /* _types.h:75:3 */
  600. type Ssize_t = X__ssize_t /* uio.h:48:19 */
  601. type Iovec = struct {
  602. Fiov_base uintptr
  603. Fiov_len Size_t
  604. } /* uio.h:51:1 */
  605. // Tell sys/endian.h we have MD variants of the swap macros.
  606. // Note that these macros evaluate their arguments several times.
  607. // Public names
  608. // These are specified to be function-like macros to match the spec
  609. // POSIX names
  610. // original BSD names
  611. // these were exposed here before
  612. // ancient stuff
  613. type U_char = uint8 /* types.h:51:23 */
  614. type U_short = uint16 /* types.h:52:24 */
  615. type U_int = uint32 /* types.h:53:22 */
  616. type U_long = uint32 /* types.h:54:23 */
  617. type Unchar = uint8 /* types.h:56:23 */ // Sys V compatibility
  618. type Ushort = uint16 /* types.h:57:24 */ // Sys V compatibility
  619. type Uint = uint32 /* types.h:58:22 */ // Sys V compatibility
  620. type Ulong = uint32 /* types.h:59:23 */ // Sys V compatibility
  621. type Cpuid_t = X__cpuid_t /* types.h:61:19 */ // CPU id
  622. type Register_t = X__register_t /* types.h:62:22 */ // register-sized type
  623. // XXX The exact-width bit types should only be exposed if __BSD_VISIBLE
  624. // but the rest of the includes are not ready for that yet.
  625. type Int8_t = X__int8_t /* types.h:75:19 */
  626. type Uint8_t = X__uint8_t /* types.h:80:20 */
  627. type Int16_t = X__int16_t /* types.h:85:20 */
  628. type Uint16_t = X__uint16_t /* types.h:90:21 */
  629. type Int32_t = X__int32_t /* types.h:95:20 */
  630. type Uint32_t = X__uint32_t /* types.h:100:21 */
  631. type Int64_t = X__int64_t /* types.h:105:20 */
  632. type Uint64_t = X__uint64_t /* types.h:110:21 */
  633. // BSD-style unsigned bits types
  634. type U_int8_t = X__uint8_t /* types.h:114:19 */
  635. type U_int16_t = X__uint16_t /* types.h:115:20 */
  636. type U_int32_t = X__uint32_t /* types.h:116:20 */
  637. type U_int64_t = X__uint64_t /* types.h:117:20 */
  638. // quads, deprecated in favor of 64 bit int types
  639. type Quad_t = X__int64_t /* types.h:120:19 */
  640. type U_quad_t = X__uint64_t /* types.h:121:20 */
  641. // VM system types
  642. type Vaddr_t = X__vaddr_t /* types.h:125:19 */
  643. type Paddr_t = X__paddr_t /* types.h:126:19 */
  644. type Vsize_t = X__vsize_t /* types.h:127:19 */
  645. type Psize_t = X__psize_t /* types.h:128:19 */
  646. // Standard system types
  647. type Blkcnt_t = X__blkcnt_t /* types.h:132:20 */ // blocks allocated for file
  648. type Blksize_t = X__blksize_t /* types.h:133:21 */ // optimal blocksize for I/O
  649. type Caddr_t = uintptr /* types.h:134:14 */ // core address
  650. type Daddr32_t = X__int32_t /* types.h:135:19 */ // 32-bit disk address
  651. type Daddr_t = X__int64_t /* types.h:136:19 */ // 64-bit disk address
  652. type Dev_t = X__dev_t /* types.h:137:18 */ // device number
  653. type Fixpt_t = X__fixpt_t /* types.h:138:19 */ // fixed point number
  654. type Gid_t = X__gid_t /* types.h:139:18 */ // group id
  655. type Id_t = X__id_t /* types.h:140:17 */ // may contain pid, uid or gid
  656. type Ino_t = X__ino_t /* types.h:141:18 */ // inode number
  657. type Key_t = X__key_t /* types.h:142:18 */ // IPC key (for Sys V IPC)
  658. type Mode_t = X__mode_t /* types.h:143:18 */ // permissions
  659. type Nlink_t = X__nlink_t /* types.h:144:19 */ // link count
  660. type Rlim_t = X__rlim_t /* types.h:145:18 */ // resource limit
  661. type Segsz_t = X__segsz_t /* types.h:146:19 */ // segment size
  662. type Uid_t = X__uid_t /* types.h:147:18 */ // user id
  663. type Useconds_t = X__useconds_t /* types.h:148:22 */ // microseconds
  664. type Suseconds_t = X__suseconds_t /* types.h:149:23 */ // microseconds (signed)
  665. type Fsblkcnt_t = X__fsblkcnt_t /* types.h:150:22 */ // file system block count
  666. type Fsfilcnt_t = X__fsfilcnt_t /* types.h:151:22 */ // file system file count
  667. // The following types may be defined in multiple header files.
  668. type Clock_t = X__clock_t /* types.h:158:19 */
  669. type Clockid_t = X__clockid_t /* types.h:163:21 */
  670. type Pid_t = X__pid_t /* types.h:168:18 */
  671. type Time_t = X__time_t /* types.h:183:18 */
  672. type Timer_t = X__timer_t /* types.h:188:19 */
  673. type Off_t = X__off_t /* types.h:193:18 */
  674. // Major, minor numbers, dev_t's.
  675. type Socklen_t = X__socklen_t /* socket.h:47:21 */ // length type for network syscalls
  676. type Sa_family_t = X__sa_family_t /* socket.h:52:23 */ // sockaddr address family type
  677. // Definitions related to sockets: types, address families, options.
  678. // Types
  679. // Socket creation flags
  680. // Option flags per-socket.
  681. // Additional options, not kept in so_options.
  682. // Structure used for manipulating linger option.
  683. type Linger = struct {
  684. Fl_onoff int32
  685. Fl_linger int32
  686. } /* socket.h:122:1 */
  687. type Timeval = struct {
  688. Ftv_sec Time_t
  689. Ftv_usec Suseconds_t
  690. } /* socket.h:131:1 */
  691. // Structure used for manipulating splice option.
  692. type Splice = struct {
  693. Fsp_fd int32
  694. Fsp_max Off_t
  695. Fsp_idle struct {
  696. Ftv_sec Time_t
  697. Ftv_usec Suseconds_t
  698. }
  699. } /* socket.h:140:1 */
  700. // Maximum number of alternate routing tables
  701. // Level number for (get/set)sockopt() to apply to socket itself.
  702. // Address families.
  703. // Structure used by kernel to store most
  704. // addresses.
  705. type Sockaddr = struct {
  706. Fsa_len X__uint8_t
  707. Fsa_family Sa_family_t
  708. Fsa_data [14]int8
  709. } /* socket.h:209:1 */
  710. // Sockaddr type which can hold any sockaddr type available
  711. // in the system.
  712. //
  713. // Note: __ss_{len,family} is defined in RFC2553. During RFC2553 discussion
  714. // the field name went back and forth between ss_len and __ss_len,
  715. // and RFC2553 specifies it to be __ss_len. openbsd picked ss_len.
  716. // For maximum portability, userland programmer would need to
  717. // (1) make the code never touch ss_len portion (cast it into sockaddr and
  718. // touch sa_len), or (2) add "-Dss_len=__ss_len" into CFLAGS to unify all
  719. // occurrences (including header file) to __ss_len.
  720. type Sockaddr_storage = struct {
  721. Fss_len X__uint8_t
  722. Fss_family Sa_family_t
  723. F__ss_pad1 [6]uint8
  724. F__ss_pad2 X__uint64_t
  725. F__ss_pad3 [240]uint8
  726. } /* socket.h:227:1 */
  727. // Protocol families, same as address families for now.
  728. // These are the valid values for the "how" field used by shutdown(2).
  729. // Read using getsockopt() with SOL_SOCKET, SO_PEERCRED
  730. type Sockpeercred = struct {
  731. Fuid Uid_t
  732. Fgid Gid_t
  733. Fpid Pid_t
  734. } /* socket.h:300:1 */
  735. // Definitions for network related sysctl, CTL_NET.
  736. //
  737. // Second level is protocol family.
  738. // Third level is protocol number.
  739. //
  740. // Further levels are defined by the individual families below.
  741. // PF_ROUTE - Routing table
  742. //
  743. // Four additional levels are defined:
  744. // Fourth: address family, 0 is wildcard
  745. // Fifth: type of info, defined below
  746. // Sixth: flag(s) to mask with for NET_RT_FLAGS
  747. // Seventh: routing table to use (facultative, defaults to 0)
  748. // NET_RT_TABLE has the table id as sixth element.
  749. // PF_UNIX - unix socket tunables
  750. // PF_LINK - link layer or device tunables
  751. // PF_KEY - Key Management
  752. // PF_BPF not really a family, but connected under CTL_NET
  753. // PF_PFLOW not really a family, but connected under CTL_NET
  754. // Maximum queue length specifiable by listen(2).
  755. // Message header for recvmsg and sendmsg calls.
  756. // Used value-result for recvmsg, value only for sendmsg.
  757. type Msghdr = struct {
  758. Fmsg_name uintptr
  759. Fmsg_namelen Socklen_t
  760. Fmsg_iov uintptr
  761. Fmsg_iovlen uint32
  762. Fmsg_control uintptr
  763. Fmsg_controllen Socklen_t
  764. Fmsg_flags int32
  765. } /* socket.h:483:1 */
  766. type Mmsghdr = struct {
  767. Fmsg_hdr struct {
  768. Fmsg_name uintptr
  769. Fmsg_namelen Socklen_t
  770. Fmsg_iov uintptr
  771. Fmsg_iovlen uint32
  772. Fmsg_control uintptr
  773. Fmsg_controllen Socklen_t
  774. Fmsg_flags int32
  775. }
  776. Fmsg_len uint32
  777. } /* socket.h:493:1 */
  778. // Header for ancillary data objects in msg_control buffer.
  779. // Used for additional information with/about a datagram
  780. // not expressible by flags. The format is a sequence
  781. // of message elements headed by cmsghdr structures.
  782. type Cmsghdr = struct {
  783. Fcmsg_len Socklen_t
  784. Fcmsg_level int32
  785. Fcmsg_type int32
  786. } /* socket.h:520:1 */
  787. var _ int8 /* gen.c:2:13: */