PageRenderTime 79ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/package/uclibc/0.9.33.2/uclibc-0035-socket.h-pull-socket_type.h-from-eglibc.patch

https://github.com/fanicy/buildroot
Patch | 1374 lines | 1353 code | 21 blank | 0 comment | 0 complexity | 20946ea18e045dcbc37cac907c7d590a MD5 | raw file
Possible License(s): GPL-2.0
  1. From 8eccce991d08960d135b97066621c8d3248a79b7 Mon Sep 17 00:00:00 2001
  2. From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
  3. Date: Thu, 17 Jan 2013 19:29:22 +0100
  4. Subject: [PATCH] socket.h: pull socket_type.h from eglibc
  5. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
  6. ---
  7. Makefile.in | 2 +-
  8. libc/inet/opensock.c | 9 +-
  9. libc/sysdeps/linux/alpha/bits/socket_type.h | 54 ++++
  10. libc/sysdeps/linux/common/bits/kernel-features.h | 10 +-
  11. libc/sysdeps/linux/common/bits/socket.h | 104 +++---
  12. libc/sysdeps/linux/common/bits/socket_type.h | 54 ++++
  13. libc/sysdeps/linux/common/cmsg_nxthdr.c | 1 +
  14. libc/sysdeps/linux/hppa/bits/socket_type.h | 54 ++++
  15. libc/sysdeps/linux/mips/bits/socket.h | 369 ---------------------
  16. libc/sysdeps/linux/mips/bits/socket_type.h | 55 ++++
  17. libc/sysdeps/linux/sparc/bits/socket.h | 376 ----------------------
  18. libc/sysdeps/linux/sparc/bits/socket_type.h | 54 ++++
  19. 12 files changed, 325 insertions(+), 817 deletions(-)
  20. create mode 100644 libc/sysdeps/linux/alpha/bits/socket_type.h
  21. create mode 100644 libc/sysdeps/linux/common/bits/socket_type.h
  22. create mode 100644 libc/sysdeps/linux/hppa/bits/socket_type.h
  23. delete mode 100644 libc/sysdeps/linux/mips/bits/socket.h
  24. create mode 100644 libc/sysdeps/linux/mips/bits/socket_type.h
  25. delete mode 100644 libc/sysdeps/linux/sparc/bits/socket.h
  26. create mode 100644 libc/sysdeps/linux/sparc/bits/socket_type.h
  27. diff --git a/Makefile.in b/Makefile.in
  28. index 87b8e4b..69abfaf 100644
  29. --- a/Makefile.in
  30. +++ b/Makefile.in
  31. @@ -255,7 +255,7 @@ HEADERS_RM-$(UCLIBC_HAS_REALTIME) += mqueue.h bits/mqueue.h sched.h \
  32. HEADERS_RM-$(UCLIBC_HAS_REGEX) += regex.h regexp.h
  33. HEADERS_RM-$(UCLIBC_HAS_RPC) += rpc
  34. HEADERS_RM-$(UCLIBC_HAS_SHADOW) += shadow.h
  35. -HEADERS_RM-$(UCLIBC_HAS_SOCKET) += sys/socket.h bits/socket.h sys/socketvar.h
  36. +HEADERS_RM-$(UCLIBC_HAS_SOCKET) += sys/socket.h bits/socket.h sys/socketvar.h bits/socket_type.h
  37. HEADERS_RM-$(UCLIBC_HAS_SYSLOG) += syslog.h sys/syslog.h bits/syslog*.h
  38. HEADERS_RM-$(UCLIBC_HAS_THREADS) += *thread*.h semaphore.h \
  39. bits/*thread*.h \
  40. diff --git a/libc/inet/opensock.c b/libc/inet/opensock.c
  41. index 86f8c59..da5858f 100644
  42. --- a/libc/inet/opensock.c
  43. +++ b/libc/inet/opensock.c
  44. @@ -16,14 +16,11 @@
  45. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  46. 02111-1307 USA. */
  47. -#include <assert.h>
  48. -#include <errno.h>
  49. -#include <stdio.h>
  50. -#include <string.h>
  51. -#include <unistd.h>
  52. -#include <sys/socket.h>
  53. +
  54. #include <features.h>
  55. #include <libc-internal.h>
  56. +#include <sys/socket.h>
  57. +#include <bits/kernel-features.h>
  58. /* Return a socket of any type. The socket can be used in subsequent
  59. ioctl calls to talk to the kernel. */
  60. diff --git a/libc/sysdeps/linux/alpha/bits/socket_type.h b/libc/sysdeps/linux/alpha/bits/socket_type.h
  61. new file mode 100644
  62. index 0000000..ee55d66
  63. --- /dev/null
  64. +++ b/libc/sysdeps/linux/alpha/bits/socket_type.h
  65. @@ -0,0 +1,54 @@
  66. +/* Define enum __socket_type for Linux/Alpha.
  67. + Copyright (C) 1991-2012 Free Software Foundation, Inc.
  68. + This file is part of the GNU C Library.
  69. +
  70. + The GNU C Library is free software; you can redistribute it and/or
  71. + modify it under the terms of the GNU Lesser General Public
  72. + License as published by the Free Software Foundation; either
  73. + version 2.1 of the License, or (at your option) any later version.
  74. +
  75. + The GNU C Library is distributed in the hope that it will be useful,
  76. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  77. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  78. + Lesser General Public License for more details.
  79. +
  80. + You should have received a copy of the GNU Lesser General Public
  81. + License along with the GNU C Library. If not, see
  82. + <http://www.gnu.org/licenses/>. */
  83. +
  84. +#ifndef _SYS_SOCKET_H
  85. +# error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
  86. +#endif
  87. +
  88. +/* Types of sockets. */
  89. +enum __socket_type
  90. +{
  91. + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
  92. + byte streams. */
  93. +#define SOCK_STREAM SOCK_STREAM
  94. + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
  95. + of fixed maximum length. */
  96. +#define SOCK_DGRAM SOCK_DGRAM
  97. + SOCK_RAW = 3, /* Raw protocol interface. */
  98. +#define SOCK_RAW SOCK_RAW
  99. + SOCK_RDM = 4, /* Reliably-delivered messages. */
  100. +#define SOCK_RDM SOCK_RDM
  101. + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  102. + datagrams of fixed maximum length. */
  103. +#define SOCK_SEQPACKET SOCK_SEQPACKET
  104. + SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */
  105. +#define SOCK_DCCP SOCK_DCCP
  106. + SOCK_PACKET = 10, /* Linux specific way of getting packets
  107. + at the dev level. For writing rarp and
  108. + other similar things on the user level. */
  109. +#define SOCK_PACKET SOCK_PACKET
  110. +
  111. + /* Flags to be ORed into the type parameter of socket and socketpair. */
  112. +
  113. + SOCK_CLOEXEC = 010000000, /* Atomically set close-on-exec flag for the
  114. + new descriptor(s). */
  115. +#define SOCK_CLOEXEC SOCK_CLOEXEC
  116. + SOCK_NONBLOCK = 0x40000000 /* Atomically mark descriptor(s) as
  117. + non-blocking. */
  118. +#define SOCK_NONBLOCK SOCK_NONBLOCK
  119. +};
  120. diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
  121. index 5ea85d2..5665e24 100644
  122. --- a/libc/sysdeps/linux/common/bits/kernel-features.h
  123. +++ b/libc/sysdeps/linux/common/bits/kernel-features.h
  124. @@ -311,17 +311,19 @@
  125. /* Support for various CLOEXEC and NONBLOCK flags was added for x86,
  126. * x86-64, PPC, IA-64, and SPARC in 2.6.27. */
  127. -#if __LINUX_KERNEL_VERSION >= 0x02061b \
  128. - && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
  129. - || defined __ia64__ || defined __sparc__ || defined __s390__)
  130. +#if (__LINUX_KERNEL_VERSION >= 0x02061b \
  131. + && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
  132. + || defined __ia64__ || defined __sparc__ || defined __s390__) \
  133. + ) || (__LINUX_KERNEL_VERSION >= 0x020621 && defined __alpha__) \
  134. + || defined __aarch64__ || defined __tile__
  135. /* # define __ASSUME_SOCK_CLOEXEC 1 */
  136. /* # define __ASSUME_IN_NONBLOCK 1 */
  137. # define __ASSUME_PIPE2 1
  138. /* # define __ASSUME_EVENTFD2 1 */
  139. /* # define __ASSUME_SIGNALFD4 1 */
  140. +/* # define __ASSUME_DUP3 1 */
  141. #endif
  142. -
  143. /* These features were surely available with 2.4.12. */
  144. #if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__
  145. # define __ASSUME_MMAP2_SYSCALL 1
  146. diff --git a/libc/sysdeps/linux/common/bits/socket.h b/libc/sysdeps/linux/common/bits/socket.h
  147. index 7e12733..6a89340 100644
  148. --- a/libc/sysdeps/linux/common/bits/socket.h
  149. +++ b/libc/sysdeps/linux/common/bits/socket.h
  150. @@ -1,5 +1,6 @@
  151. /* System-specific socket constants and types. Linux version.
  152. - Copyright (C) 1991,1992,1994-2001,2004,2006 Free Software Foundation, Inc.
  153. + Copyright (C) 1991,1992,1994-2001,2004,2006-2012
  154. + Free Software Foundation, Inc.
  155. This file is part of the GNU C Library.
  156. The GNU C Library is free software; you can redistribute it and/or
  157. @@ -20,12 +21,11 @@
  158. #ifndef __BITS_SOCKET_H
  159. #define __BITS_SOCKET_H
  160. -#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
  161. +#ifndef _SYS_SOCKET_H
  162. # error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
  163. #endif
  164. #define __need_size_t
  165. -#define __need_NULL
  166. #include <stddef.h>
  167. #include <limits.h>
  168. @@ -37,37 +37,8 @@ typedef __socklen_t socklen_t;
  169. # define __socklen_t_defined
  170. #endif
  171. -/* Types of sockets. */
  172. -enum __socket_type
  173. -{
  174. - SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
  175. - byte streams. */
  176. -#define SOCK_STREAM SOCK_STREAM
  177. - SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
  178. - of fixed maximum length. */
  179. -#define SOCK_DGRAM SOCK_DGRAM
  180. - SOCK_RAW = 3, /* Raw protocol interface. */
  181. -#define SOCK_RAW SOCK_RAW
  182. - SOCK_RDM = 4, /* Reliably-delivered messages. */
  183. -#define SOCK_RDM SOCK_RDM
  184. - SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  185. - datagrams of fixed maximum length. */
  186. -#define SOCK_SEQPACKET SOCK_SEQPACKET
  187. - SOCK_PACKET = 10, /* Linux specific way of getting packets
  188. - at the dev level. For writing rarp and
  189. - other similar things on the user level. */
  190. -#define SOCK_PACKET SOCK_PACKET
  191. -
  192. - /* Flags to be ORed into the type parameter of socket and socketpair and
  193. - used for the flags parameter of paccept. */
  194. -
  195. - SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the
  196. - new descriptor(s). */
  197. -#define SOCK_CLOEXEC SOCK_CLOEXEC
  198. - SOCK_NONBLOCK = 04000 /* Atomically mark descriptor(s) as
  199. - non-blocking. */
  200. -#define SOCK_NONBLOCK SOCK_NONBLOCK
  201. -};
  202. +/* Get the architecture-dependent definition of enum __socket_type. */
  203. +#include <bits/socket_type.h>
  204. /* Protocol families. */
  205. #define PF_UNSPEC 0 /* Unspecified. */
  206. @@ -94,22 +65,24 @@ enum __socket_type
  207. #define PF_ASH 18 /* Ash. */
  208. #define PF_ECONET 19 /* Acorn Econet. */
  209. #define PF_ATMSVC 20 /* ATM SVCs. */
  210. +#define PF_RDS 21 /* RDS sockets. */
  211. #define PF_SNA 22 /* Linux SNA Project */
  212. #define PF_IRDA 23 /* IRDA sockets. */
  213. #define PF_PPPOX 24 /* PPPoX sockets. */
  214. #define PF_WANPIPE 25 /* Wanpipe API sockets. */
  215. -#define PF_LLC 26 /* Linux LLC. */
  216. -#define PF_CAN 29 /* Controller Area Network. */
  217. -#define PF_TIPC 30 /* TIPC sockets. */
  218. +#define PF_LLC 26 /* Linux LLC. */
  219. +#define PF_CAN 29 /* Controller Area Network. */
  220. +#define PF_TIPC 30 /* TIPC sockets. */
  221. #define PF_BLUETOOTH 31 /* Bluetooth sockets. */
  222. #define PF_IUCV 32 /* IUCV sockets. */
  223. -#define PF_RXRPC 33 /* RxRPC sockets. */
  224. -#define PF_ISDN 34 /* mISDN sockets. */
  225. -#define PF_PHONET 35 /* Phonet sockets. */
  226. -#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
  227. -#define PF_CAIF 37 /* CAIF sockets. */
  228. -#define PF_ALG 38 /* Algorithm sockets. */
  229. -#define PF_MAX 39 /* For now.. */
  230. +#define PF_RXRPC 33 /* RxRPC sockets. */
  231. +#define PF_ISDN 34 /* mISDN sockets. */
  232. +#define PF_PHONET 35 /* Phonet sockets. */
  233. +#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
  234. +#define PF_CAIF 37 /* CAIF sockets. */
  235. +#define PF_ALG 38 /* Algorithm sockets. */
  236. +#define PF_NFC 39 /* NFC sockets. */
  237. +#define PF_MAX 40 /* For now.. */
  238. /* Address families. */
  239. #define AF_UNSPEC PF_UNSPEC
  240. @@ -136,21 +109,23 @@ enum __socket_type
  241. #define AF_ASH PF_ASH
  242. #define AF_ECONET PF_ECONET
  243. #define AF_ATMSVC PF_ATMSVC
  244. +#define AF_RDS PF_RDS
  245. #define AF_SNA PF_SNA
  246. #define AF_IRDA PF_IRDA
  247. #define AF_PPPOX PF_PPPOX
  248. #define AF_WANPIPE PF_WANPIPE
  249. -#define AF_LLC PF_LLC
  250. -#define AF_CAN PF_CAN
  251. -#define AF_TIPC PF_TIPC
  252. +#define AF_LLC PF_LLC
  253. +#define AF_CAN PF_CAN
  254. +#define AF_TIPC PF_TIPC
  255. #define AF_BLUETOOTH PF_BLUETOOTH
  256. -#define AF_IUCV PF_IUCV
  257. -#define AF_RXRPC PF_RXRPC
  258. -#define AF_ISDN PF_ISDN
  259. -#define AF_PHONET PF_PHONET
  260. -#define AF_IEEE802154 PF_IEEE802154
  261. -#define AF_CAIF PF_CAIF
  262. -#define AF_ALG PF_ALG
  263. +#define AF_IUCV PF_IUCV
  264. +#define AF_RXRPC PF_RXRPC
  265. +#define AF_ISDN PF_ISDN
  266. +#define AF_PHONET PF_PHONET
  267. +#define AF_IEEE802154 PF_IEEE802154
  268. +#define AF_CAIF PF_CAIF
  269. +#define AF_ALG PF_ALG
  270. +#define AF_NFC PF_NFC
  271. #define AF_MAX PF_MAX
  272. /* Socket level values. Others are defined in the appropriate headers.
  273. @@ -235,8 +210,14 @@ enum
  274. #define MSG_ERRQUEUE MSG_ERRQUEUE
  275. MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
  276. #define MSG_NOSIGNAL MSG_NOSIGNAL
  277. - MSG_MORE = 0x8000 /* Sender will send more. */
  278. + MSG_MORE = 0x8000, /* Sender will send more. */
  279. #define MSG_MORE MSG_MORE
  280. + MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/
  281. +#define MSG_WAITFORONE MSG_WAITFORONE
  282. + MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
  283. + descriptor received through
  284. + SCM_RIGHTS. */
  285. +#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
  286. };
  287. @@ -290,7 +271,7 @@ struct cmsghdr
  288. #define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
  289. #define CMSG_FIRSTHDR(mhdr) \
  290. ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
  291. - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
  292. + ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
  293. #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
  294. & (size_t) ~(sizeof (size_t) - 1))
  295. #define CMSG_SPACE(len) (CMSG_ALIGN (len) \
  296. @@ -302,14 +283,14 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
  297. libc_hidden_proto(__cmsg_nxthdr)
  298. #ifdef __USE_EXTERN_INLINES
  299. # ifndef _EXTERN_INLINE
  300. -# define _EXTERN_INLINE extern __inline
  301. +# define _EXTERN_INLINE __extern_inline
  302. # endif
  303. _EXTERN_INLINE struct cmsghdr *
  304. __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
  305. {
  306. if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
  307. /* The kernel header does this so there may be a reason. */
  308. - return 0;
  309. + return (struct cmsghdr *) 0;
  310. __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
  311. + CMSG_ALIGN (__cmsg->cmsg_len));
  312. @@ -318,7 +299,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
  313. || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
  314. > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
  315. /* No more entries. */
  316. - return 0;
  317. + return (struct cmsghdr *) 0;
  318. return __cmsg;
  319. }
  320. #endif /* Use `extern inline'. */
  321. @@ -329,20 +310,21 @@ enum
  322. {
  323. SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
  324. #define SCM_RIGHTS SCM_RIGHTS
  325. -#ifdef __USE_BSD
  326. +#ifdef __USE_GNU
  327. , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
  328. # define SCM_CREDENTIALS SCM_CREDENTIALS
  329. #endif
  330. };
  331. +#ifdef __USE_GNU
  332. /* User visible structure for SCM_CREDENTIALS message */
  333. -
  334. struct ucred
  335. {
  336. pid_t pid; /* PID of sending process. */
  337. uid_t uid; /* UID of sending process. */
  338. gid_t gid; /* GID of sending process. */
  339. };
  340. +#endif
  341. /* Get socket manipulation related informations from kernel headers. */
  342. #ifndef __GLIBC__
  343. diff --git a/libc/sysdeps/linux/common/bits/socket_type.h b/libc/sysdeps/linux/common/bits/socket_type.h
  344. new file mode 100644
  345. index 0000000..65436b0
  346. --- /dev/null
  347. +++ b/libc/sysdeps/linux/common/bits/socket_type.h
  348. @@ -0,0 +1,54 @@
  349. +/* Define enum __socket_type for generic Linux.
  350. + Copyright (C) 1991-2012 Free Software Foundation, Inc.
  351. + This file is part of the GNU C Library.
  352. +
  353. + The GNU C Library is free software; you can redistribute it and/or
  354. + modify it under the terms of the GNU Lesser General Public
  355. + License as published by the Free Software Foundation; either
  356. + version 2.1 of the License, or (at your option) any later version.
  357. +
  358. + The GNU C Library is distributed in the hope that it will be useful,
  359. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  360. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  361. + Lesser General Public License for more details.
  362. +
  363. + You should have received a copy of the GNU Lesser General Public
  364. + License along with the GNU C Library; if not, see
  365. + <http://www.gnu.org/licenses/>. */
  366. +
  367. +#ifndef _SYS_SOCKET_H
  368. +# error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
  369. +#endif
  370. +
  371. +/* Types of sockets. */
  372. +enum __socket_type
  373. +{
  374. + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
  375. + byte streams. */
  376. +#define SOCK_STREAM SOCK_STREAM
  377. + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
  378. + of fixed maximum length. */
  379. +#define SOCK_DGRAM SOCK_DGRAM
  380. + SOCK_RAW = 3, /* Raw protocol interface. */
  381. +#define SOCK_RAW SOCK_RAW
  382. + SOCK_RDM = 4, /* Reliably-delivered messages. */
  383. +#define SOCK_RDM SOCK_RDM
  384. + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  385. + datagrams of fixed maximum length. */
  386. +#define SOCK_SEQPACKET SOCK_SEQPACKET
  387. + SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */
  388. +#define SOCK_DCCP SOCK_DCCP
  389. + SOCK_PACKET = 10, /* Linux specific way of getting packets
  390. + at the dev level. For writing rarp and
  391. + other similar things on the user level. */
  392. +#define SOCK_PACKET SOCK_PACKET
  393. +
  394. + /* Flags to be ORed into the type parameter of socket and socketpair. */
  395. +
  396. + SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the
  397. + new descriptor(s). */
  398. +#define SOCK_CLOEXEC SOCK_CLOEXEC
  399. + SOCK_NONBLOCK = 00004000 /* Atomically mark descriptor(s) as
  400. + non-blocking. */
  401. +#define SOCK_NONBLOCK SOCK_NONBLOCK
  402. +};
  403. diff --git a/libc/sysdeps/linux/common/cmsg_nxthdr.c b/libc/sysdeps/linux/common/cmsg_nxthdr.c
  404. index 0360b47..9c21190 100644
  405. --- a/libc/sysdeps/linux/common/cmsg_nxthdr.c
  406. +++ b/libc/sysdeps/linux/common/cmsg_nxthdr.c
  407. @@ -19,6 +19,7 @@
  408. #define __FORCE_GLIBC
  409. #include <features.h>
  410. +#include <stddef.h>
  411. /* Prevent math.h from defining a colliding inline */
  412. #undef __USE_EXTERN_INLINES
  413. #include <sys/socket.h>
  414. diff --git a/libc/sysdeps/linux/hppa/bits/socket_type.h b/libc/sysdeps/linux/hppa/bits/socket_type.h
  415. new file mode 100644
  416. index 0000000..c6df6c3
  417. --- /dev/null
  418. +++ b/libc/sysdeps/linux/hppa/bits/socket_type.h
  419. @@ -0,0 +1,54 @@
  420. +/* Define enum __socket_type for Linux/HP-PARISC.
  421. + Copyright (C) 2012 Free Software Foundation, Inc.
  422. + This file is part of the GNU C Library.
  423. +
  424. + The GNU C Library is free software; you can redistribute it and/or
  425. + modify it under the terms of the GNU Lesser General Public
  426. + License as published by the Free Software Foundation; either
  427. + version 2.1 of the License, or (at your option) any later version.
  428. +
  429. + The GNU C Library is distributed in the hope that it will be useful,
  430. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  431. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  432. + Lesser General Public License for more details.
  433. +
  434. + You should have received a copy of the GNU Lesser General Public
  435. + License along with the GNU C Library; if not, see
  436. + <http://www.gnu.org/licenses/>. */
  437. +
  438. +#ifndef _SYS_SOCKET_H
  439. +# error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
  440. +#endif
  441. +
  442. +/* Types of sockets. */
  443. +enum __socket_type
  444. +{
  445. + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
  446. + byte streams. */
  447. +#define SOCK_STREAM SOCK_STREAM
  448. + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
  449. + of fixed maximum length. */
  450. +#define SOCK_DGRAM SOCK_DGRAM
  451. + SOCK_RAW = 3, /* Raw protocol interface. */
  452. +#define SOCK_RAW SOCK_RAW
  453. + SOCK_RDM = 4, /* Reliably-delivered messages. */
  454. +#define SOCK_RDM SOCK_RDM
  455. + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  456. + datagrams of fixed maximum length. */
  457. +#define SOCK_SEQPACKET SOCK_SEQPACKET
  458. + SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */
  459. +#define SOCK_DCCP SOCK_DCCP
  460. + SOCK_PACKET = 10, /* Linux specific way of getting packets
  461. + at the dev level. For writing rarp and
  462. + other similar things on the user level. */
  463. +#define SOCK_PACKET SOCK_PACKET
  464. +
  465. + /* Flags to be ORed into the type parameter of socket and socketpair. */
  466. +
  467. + SOCK_CLOEXEC = 010000000, /* Atomically set close-on-exec flag for the
  468. + new descriptor(s). */
  469. +#define SOCK_CLOEXEC SOCK_CLOEXEC
  470. + SOCK_NONBLOCK = 0x40000000 /* Atomically mark descriptor(s) as
  471. + non-blocking. */
  472. +#define SOCK_NONBLOCK SOCK_NONBLOCK
  473. +};
  474. diff --git a/libc/sysdeps/linux/mips/bits/socket.h b/libc/sysdeps/linux/mips/bits/socket.h
  475. deleted file mode 100644
  476. index 27ceafa..0000000
  477. --- a/libc/sysdeps/linux/mips/bits/socket.h
  478. +++ /dev/null
  479. @@ -1,369 +0,0 @@
  480. -/* System-specific socket constants and types. Linux/MIPS version.
  481. - Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006
  482. - Free Software Foundation, Inc.
  483. - This file is part of the GNU C Library.
  484. -
  485. - The GNU C Library is free software; you can redistribute it and/or
  486. - modify it under the terms of the GNU Lesser General Public
  487. - License as published by the Free Software Foundation; either
  488. - version 2.1 of the License, or (at your option) any later version.
  489. -
  490. - The GNU C Library is distributed in the hope that it will be useful,
  491. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  492. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  493. - Lesser General Public License for more details.
  494. -
  495. - You should have received a copy of the GNU Lesser General Public
  496. - License along with the GNU C Library; if not, write to the Free
  497. - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  498. - 02111-1307 USA. */
  499. -
  500. -#ifndef __BITS_SOCKET_H
  501. -#define __BITS_SOCKET_H
  502. -
  503. -#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
  504. -# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
  505. -#endif
  506. -
  507. -#define __need_size_t
  508. -#define __need_NULL
  509. -#include <stddef.h>
  510. -
  511. -#include <limits.h>
  512. -#include <sys/types.h>
  513. -
  514. -/* Type for length arguments in socket calls. */
  515. -#ifndef __socklen_t_defined
  516. -typedef __socklen_t socklen_t;
  517. -# define __socklen_t_defined
  518. -#endif
  519. -
  520. -/* Types of sockets. */
  521. -enum __socket_type
  522. -{
  523. - SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams
  524. - of fixed maximum length. */
  525. -#define SOCK_DGRAM SOCK_DGRAM
  526. - SOCK_STREAM = 2, /* Sequenced, reliable, connection-based
  527. - byte streams. */
  528. -#define SOCK_STREAM SOCK_STREAM
  529. - SOCK_RAW = 3, /* Raw protocol interface. */
  530. -#define SOCK_RAW SOCK_RAW
  531. - SOCK_RDM = 4, /* Reliably-delivered messages. */
  532. -#define SOCK_RDM SOCK_RDM
  533. - SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  534. - datagrams of fixed maximum length. */
  535. -#define SOCK_SEQPACKET SOCK_SEQPACKET
  536. - SOCK_DCCP = 6,
  537. -#define SOCK_DCCP SOCK_DCCP /* Datagram Congestion Control Protocol. */
  538. - SOCK_PACKET = 10, /* Linux specific way of getting packets
  539. - at the dev level. For writing rarp and
  540. - other similar things on the user level. */
  541. -#define SOCK_PACKET SOCK_PACKET
  542. - /* Flags to be ORed into the type parameter of socket and socketpair and
  543. - used for the flags parameter of paccept. */
  544. -
  545. - SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the
  546. - new descriptor(s). */
  547. -#define SOCK_CLOEXEC SOCK_CLOEXEC
  548. - SOCK_NONBLOCK = 0200 /* Atomically mark descriptor(s) as
  549. - non-blocking. */
  550. -#define SOCK_NONBLOCK SOCK_NONBLOCK
  551. -};
  552. -
  553. -/* Protocol families. */
  554. -#define PF_UNSPEC 0 /* Unspecified. */
  555. -#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
  556. -#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
  557. -#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
  558. -#define PF_INET 2 /* IP protocol family. */
  559. -#define PF_AX25 3 /* Amateur Radio AX.25. */
  560. -#define PF_IPX 4 /* Novell Internet Protocol. */
  561. -#define PF_APPLETALK 5 /* Appletalk DDP. */
  562. -#define PF_NETROM 6 /* Amateur radio NetROM. */
  563. -#define PF_BRIDGE 7 /* Multiprotocol bridge. */
  564. -#define PF_ATMPVC 8 /* ATM PVCs. */
  565. -#define PF_X25 9 /* Reserved for X.25 project. */
  566. -#define PF_INET6 10 /* IP version 6. */
  567. -#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
  568. -#define PF_DECnet 12 /* Reserved for DECnet project. */
  569. -#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
  570. -#define PF_SECURITY 14 /* Security callback pseudo AF. */
  571. -#define PF_KEY 15 /* PF_KEY key management API. */
  572. -#define PF_NETLINK 16
  573. -#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
  574. -#define PF_PACKET 17 /* Packet family. */
  575. -#define PF_ASH 18 /* Ash. */
  576. -#define PF_ECONET 19 /* Acorn Econet. */
  577. -#define PF_ATMSVC 20 /* ATM SVCs. */
  578. -#define PF_SNA 22 /* Linux SNA Project */
  579. -#define PF_IRDA 23 /* IRDA sockets. */
  580. -#define PF_PPPOX 24 /* PPPoX sockets. */
  581. -#define PF_WANPIPE 25 /* Wanpipe API sockets. */
  582. -#define PF_LLC 26 /* Linux LLC. */
  583. -#define PF_CAN 29 /* Controller Area Network. */
  584. -#define PF_TIPC 30 /* TIPC sockets. */
  585. -#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
  586. -#define PF_IUCV 32 /* IUCV sockets. */
  587. -#define PF_RXRPC 33 /* RxRPC sockets. */
  588. -#define PF_ISDN 34 /* mISDN sockets. */
  589. -#define PF_PHONET 35 /* Phonet sockets. */
  590. -#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
  591. -#define PF_CAIF 37 /* CAIF sockets. */
  592. -#define PF_ALG 38 /* Algorithm sockets. */
  593. -#define PF_MAX 39 /* For now.. */
  594. -
  595. -/* Address families. */
  596. -#define AF_UNSPEC PF_UNSPEC
  597. -#define AF_LOCAL PF_LOCAL
  598. -#define AF_UNIX PF_UNIX
  599. -#define AF_FILE PF_FILE
  600. -#define AF_INET PF_INET
  601. -#define AF_AX25 PF_AX25
  602. -#define AF_IPX PF_IPX
  603. -#define AF_APPLETALK PF_APPLETALK
  604. -#define AF_NETROM PF_NETROM
  605. -#define AF_BRIDGE PF_BRIDGE
  606. -#define AF_ATMPVC PF_ATMPVC
  607. -#define AF_X25 PF_X25
  608. -#define AF_INET6 PF_INET6
  609. -#define AF_ROSE PF_ROSE
  610. -#define AF_DECnet PF_DECnet
  611. -#define AF_NETBEUI PF_NETBEUI
  612. -#define AF_SECURITY PF_SECURITY
  613. -#define AF_KEY PF_KEY
  614. -#define AF_NETLINK PF_NETLINK
  615. -#define AF_ROUTE PF_ROUTE
  616. -#define AF_PACKET PF_PACKET
  617. -#define AF_ASH PF_ASH
  618. -#define AF_ECONET PF_ECONET
  619. -#define AF_ATMSVC PF_ATMSVC
  620. -#define AF_SNA PF_SNA
  621. -#define AF_IRDA PF_IRDA
  622. -#define AF_PPPOX PF_PPPOX
  623. -#define AF_WANPIPE PF_WANPIPE
  624. -#define AF_LLC PF_LLC
  625. -#define AF_CAN PF_CAN
  626. -#define AF_TIPC PF_TIPC
  627. -#define AF_BLUETOOTH PF_BLUETOOTH
  628. -#define AF_IUCV PF_IUCV
  629. -#define AF_RXRPC PF_RXRPC
  630. -#define AF_ISDN PF_ISDN
  631. -#define AF_PHONET PF_PHONET
  632. -#define AF_IEEE802154 PF_IEEE802154
  633. -#define AF_CAIF PF_CAIF
  634. -#define AF_ALG PF_ALG
  635. -#define AF_MAX PF_MAX
  636. -
  637. -/* Socket level values. Others are defined in the appropriate headers.
  638. -
  639. - XXX These definitions also should go into the appropriate headers as
  640. - far as they are available. */
  641. -#define SOL_RAW 255
  642. -#define SOL_DECNET 261
  643. -#define SOL_X25 262
  644. -#define SOL_PACKET 263
  645. -#define SOL_ATM 264 /* ATM layer (cell level). */
  646. -#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
  647. -#define SOL_IRDA 266
  648. -
  649. -/* Maximum queue length specifiable by listen. */
  650. -#define SOMAXCONN 128
  651. -
  652. -/* Get the definition of the macro to define the common sockaddr members. */
  653. -#include <bits/sockaddr.h>
  654. -
  655. -/* Structure describing a generic socket address. */
  656. -struct sockaddr
  657. - {
  658. - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
  659. - char sa_data[14]; /* Address data. */
  660. - };
  661. -
  662. -
  663. -/* Structure large enough to hold any socket address (with the historical
  664. - exception of AF_UNIX). We reserve 128 bytes. */
  665. -#define __ss_aligntype unsigned long int
  666. -#define _SS_SIZE 128
  667. -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
  668. -
  669. -struct sockaddr_storage
  670. - {
  671. - __SOCKADDR_COMMON (ss_); /* Address family, etc. */
  672. - __ss_aligntype __ss_align; /* Force desired alignment. */
  673. - char __ss_padding[_SS_PADSIZE];
  674. - };
  675. -
  676. -
  677. -/* Bits in the FLAGS argument to `send', `recv', et al. */
  678. -enum
  679. - {
  680. - MSG_OOB = 0x01, /* Process out-of-band data. */
  681. -#define MSG_OOB MSG_OOB
  682. - MSG_PEEK = 0x02, /* Peek at incoming messages. */
  683. -#define MSG_PEEK MSG_PEEK
  684. - MSG_DONTROUTE = 0x04, /* Don't use local routing. */
  685. -#define MSG_DONTROUTE MSG_DONTROUTE
  686. -#ifdef __USE_GNU
  687. - /* DECnet uses a different name. */
  688. - MSG_TRYHARD = MSG_DONTROUTE,
  689. -# define MSG_TRYHARD MSG_DONTROUTE
  690. -#endif
  691. - MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
  692. -#define MSG_CTRUNC MSG_CTRUNC
  693. - MSG_PROXY = 0x10, /* Supply or ask second address. */
  694. -#define MSG_PROXY MSG_PROXY
  695. - MSG_TRUNC = 0x20,
  696. -#define MSG_TRUNC MSG_TRUNC
  697. - MSG_DONTWAIT = 0x40, /* Nonblocking IO. */
  698. -#define MSG_DONTWAIT MSG_DONTWAIT
  699. - MSG_EOR = 0x80, /* End of record. */
  700. -#define MSG_EOR MSG_EOR
  701. - MSG_WAITALL = 0x100, /* Wait for a full request. */
  702. -#define MSG_WAITALL MSG_WAITALL
  703. - MSG_FIN = 0x200,
  704. -#define MSG_FIN MSG_FIN
  705. - MSG_SYN = 0x400,
  706. -#define MSG_SYN MSG_SYN
  707. - MSG_CONFIRM = 0x800, /* Confirm path validity. */
  708. -#define MSG_CONFIRM MSG_CONFIRM
  709. - MSG_RST = 0x1000,
  710. -#define MSG_RST MSG_RST
  711. - MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */
  712. -#define MSG_ERRQUEUE MSG_ERRQUEUE
  713. - MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
  714. -#define MSG_NOSIGNAL MSG_NOSIGNAL
  715. - MSG_MORE = 0x8000, /* Sender will send more. */
  716. -#define MSG_MORE MSG_MORE
  717. - MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/
  718. -#define MSG_WAITFORONE MSG_WAITFORONE
  719. -
  720. - MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
  721. - descriptor received through
  722. - SCM_RIGHTS. */
  723. -#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
  724. - };
  725. -
  726. -
  727. -/* Structure describing messages sent by
  728. - `sendmsg' and received by `recvmsg'. */
  729. -/* Note: do not change these members to match glibc; these match the
  730. - SuSv3 spec already (e.g. msg_iovlen/msg_controllen).
  731. - http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */
  732. -/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit
  733. - platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */
  734. -struct msghdr
  735. - {
  736. - void *msg_name; /* Address to send to/receive from. */
  737. - socklen_t msg_namelen; /* Length of address data. */
  738. -
  739. - struct iovec *msg_iov; /* Vector of data to send/receive into. */
  740. -#if __WORDSIZE == 32
  741. - int msg_iovlen; /* Number of elements in the vector. */
  742. -#else
  743. - size_t msg_iovlen; /* Number of elements in the vector. */
  744. -#endif
  745. -
  746. - void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
  747. -#if __WORDSIZE == 32
  748. - socklen_t msg_controllen; /* Ancillary data buffer length. */
  749. -#else
  750. - size_t msg_controllen; /* Ancillary data buffer length. */
  751. -#endif
  752. -
  753. - int msg_flags; /* Flags on received message. */
  754. - };
  755. -
  756. -/* Structure used for storage of ancillary data object information. */
  757. -struct cmsghdr
  758. - {
  759. - size_t cmsg_len; /* Length of data in cmsg_data plus length
  760. - of cmsghdr structure. */
  761. - int cmsg_level; /* Originating protocol. */
  762. - int cmsg_type; /* Protocol specific type. */
  763. -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
  764. - __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
  765. -#endif
  766. - };
  767. -
  768. -/* Ancillary data object manipulation macros. */
  769. -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
  770. -# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
  771. -#else
  772. -# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
  773. -#endif
  774. -#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
  775. -#define CMSG_FIRSTHDR(mhdr) \
  776. - ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
  777. - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
  778. -#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
  779. - & (size_t) ~(sizeof (size_t) - 1))
  780. -#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
  781. - + CMSG_ALIGN (sizeof (struct cmsghdr)))
  782. -#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
  783. -
  784. -extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
  785. - struct cmsghdr *__cmsg) __THROW;
  786. -libc_hidden_proto(__cmsg_nxthdr)
  787. -#ifdef __USE_EXTERN_INLINES
  788. -# ifndef _EXTERN_INLINE
  789. -# define _EXTERN_INLINE extern __inline
  790. -# endif
  791. -_EXTERN_INLINE struct cmsghdr *
  792. -__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
  793. -{
  794. - if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
  795. - /* The kernel header does this so there may be a reason. */
  796. - return 0;
  797. -
  798. - __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
  799. - + CMSG_ALIGN (__cmsg->cmsg_len));
  800. - if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
  801. - + __mhdr->msg_controllen)
  802. - || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
  803. - > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
  804. - /* No more entries. */
  805. - return 0;
  806. - return __cmsg;
  807. -}
  808. -#endif /* Use `extern inline'. */
  809. -
  810. -/* Socket level message types. This must match the definitions in
  811. - <linux/socket.h>. */
  812. -enum
  813. - {
  814. - SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
  815. -#define SCM_RIGHTS SCM_RIGHTS
  816. -#ifdef __USE_BSD
  817. - , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
  818. -# define SCM_CREDENTIALS SCM_CREDENTIALS
  819. -#endif
  820. - };
  821. -
  822. -/* User visible structure for SCM_CREDENTIALS message */
  823. -
  824. -struct ucred
  825. -{
  826. - pid_t pid; /* PID of sending process. */
  827. - uid_t uid; /* UID of sending process. */
  828. - gid_t gid; /* GID of sending process. */
  829. -};
  830. -
  831. -/* Get socket manipulation related informations from kernel headers. */
  832. -#ifndef __GLIBC__
  833. -#define __GLIBC__ 2
  834. -#include <asm/socket.h>
  835. -#undef __GLIBC__
  836. -#else
  837. -#include <asm/socket.h>
  838. -#endif
  839. -
  840. -
  841. -/* Structure used to manipulate the SO_LINGER option. */
  842. -struct linger
  843. - {
  844. - int l_onoff; /* Nonzero to linger on close. */
  845. - int l_linger; /* Time to linger. */
  846. - };
  847. -
  848. -#endif /* bits/socket.h */
  849. diff --git a/libc/sysdeps/linux/mips/bits/socket_type.h b/libc/sysdeps/linux/mips/bits/socket_type.h
  850. new file mode 100644
  851. index 0000000..20d2732
  852. --- /dev/null
  853. +++ b/libc/sysdeps/linux/mips/bits/socket_type.h
  854. @@ -0,0 +1,55 @@
  855. +/* System-specific socket constants and types. Linux/MIPS version.
  856. + Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006
  857. + Free Software Foundation, Inc.
  858. + This file is part of the GNU C Library.
  859. +
  860. + The GNU C Library is free software; you can redistribute it and/or
  861. + modify it under the terms of the GNU Lesser General Public
  862. + License as published by the Free Software Foundation; either
  863. + version 2.1 of the License, or (at your option) any later version.
  864. +
  865. + The GNU C Library is distributed in the hope that it will be useful,
  866. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  867. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  868. + Lesser General Public License for more details.
  869. +
  870. + You should have received a copy of the GNU Lesser General Public
  871. + License along with the GNU C Library; if not, see
  872. + <http://www.gnu.org/licenses/>. */
  873. +
  874. +#ifndef _SYS_SOCKET_H
  875. +# error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
  876. +#endif
  877. +
  878. +/* Types of sockets. */
  879. +enum __socket_type
  880. +{
  881. + SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams
  882. + of fixed maximum length. */
  883. +#define SOCK_DGRAM SOCK_DGRAM
  884. + SOCK_STREAM = 2, /* Sequenced, reliable, connection-based
  885. + byte streams. */
  886. +#define SOCK_STREAM SOCK_STREAM
  887. + SOCK_RAW = 3, /* Raw protocol interface. */
  888. +#define SOCK_RAW SOCK_RAW
  889. + SOCK_RDM = 4, /* Reliably-delivered messages. */
  890. +#define SOCK_RDM SOCK_RDM
  891. + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  892. + datagrams of fixed maximum length. */
  893. +#define SOCK_SEQPACKET SOCK_SEQPACKET
  894. + SOCK_DCCP = 6,
  895. +#define SOCK_DCCP SOCK_DCCP /* Datagram Congestion Control Protocol. */
  896. + SOCK_PACKET = 10, /* Linux specific way of getting packets
  897. + at the dev level. For writing rarp and
  898. + other similar things on the user level. */
  899. +#define SOCK_PACKET SOCK_PACKET
  900. +
  901. + /* Flags to be ORed into the type parameter of socket and socketpair. */
  902. +
  903. + SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the
  904. + new descriptor(s). */
  905. +#define SOCK_CLOEXEC SOCK_CLOEXEC
  906. + SOCK_NONBLOCK = 00000200 /* Atomically mark descriptor(s) as
  907. + non-blocking. */
  908. +#define SOCK_NONBLOCK SOCK_NONBLOCK
  909. +};
  910. diff --git a/libc/sysdeps/linux/sparc/bits/socket.h b/libc/sysdeps/linux/sparc/bits/socket.h
  911. deleted file mode 100644
  912. index 64973e2..0000000
  913. --- a/libc/sysdeps/linux/sparc/bits/socket.h
  914. +++ /dev/null
  915. @@ -1,376 +0,0 @@
  916. -/* System-specific socket constants and types. Linux version.
  917. - Copyright (C) 1991,1992,1994-2001,2004,2006 Free Software Foundation, Inc.
  918. - This file is part of the GNU C Library.
  919. -
  920. - The GNU C Library is free software; you can redistribute it and/or
  921. - modify it under the terms of the GNU Lesser General Public
  922. - License as published by the Free Software Foundation; either
  923. - version 2.1 of the License, or (at your option) any later version.
  924. -
  925. - The GNU C Library is distributed in the hope that it will be useful,
  926. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  927. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  928. - Lesser General Public License for more details.
  929. -
  930. - You should have received a copy of the GNU Lesser General Public
  931. - License along with the GNU C Library; if not, write to the Free
  932. - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  933. - 02111-1307 USA. */
  934. -
  935. -#ifndef __BITS_SOCKET_H
  936. -#define __BITS_SOCKET_H
  937. -
  938. -#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
  939. -# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
  940. -#endif
  941. -
  942. -#define __need_size_t
  943. -#define __need_NULL
  944. -#include <stddef.h>
  945. -
  946. -#include <limits.h>
  947. -#include <sys/types.h>
  948. -
  949. -/* Type for length arguments in socket calls. */
  950. -#ifndef __socklen_t_defined
  951. -typedef __socklen_t socklen_t;
  952. -# define __socklen_t_defined
  953. -#endif
  954. -
  955. -/* Types of sockets. */
  956. -enum __socket_type
  957. -{
  958. - SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
  959. - byte streams. */
  960. -#define SOCK_STREAM SOCK_STREAM
  961. - SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
  962. - of fixed maximum length. */
  963. -#define SOCK_DGRAM SOCK_DGRAM
  964. - SOCK_RAW = 3, /* Raw protocol interface. */
  965. -#define SOCK_RAW SOCK_RAW
  966. - SOCK_RDM = 4, /* Reliably-delivered messages. */
  967. -#define SOCK_RDM SOCK_RDM
  968. - SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  969. - datagrams of fixed maximum length. */
  970. -#define SOCK_SEQPACKET SOCK_SEQPACKET
  971. - SOCK_PACKET = 10 /* Linux specific way of getting packets
  972. - at the dev level. For writing rarp and
  973. - other similar things on the user level. */
  974. -#define SOCK_PACKET SOCK_PACKET
  975. -};
  976. -
  977. -/* Protocol families. */
  978. -#define PF_UNSPEC 0 /* Unspecified. */
  979. -#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
  980. -#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
  981. -#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
  982. -#define PF_INET 2 /* IP protocol family. */
  983. -#define PF_AX25 3 /* Amateur Radio AX.25. */
  984. -#define PF_IPX 4 /* Novell Internet Protocol. */
  985. -#define PF_APPLETALK 5 /* Appletalk DDP. */
  986. -#define PF_NETROM 6 /* Amateur radio NetROM. */
  987. -#define PF_BRIDGE 7 /* Multiprotocol bridge. */
  988. -#define PF_ATMPVC 8 /* ATM PVCs. */
  989. -#define PF_X25 9 /* Reserved for X.25 project. */
  990. -#define PF_INET6 10 /* IP version 6. */
  991. -#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
  992. -#define PF_DECnet 12 /* Reserved for DECnet project. */
  993. -#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
  994. -#define PF_SECURITY 14 /* Security callback pseudo AF. */
  995. -#define PF_KEY 15 /* PF_KEY key management API. */
  996. -#define PF_NETLINK 16
  997. -#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
  998. -#define PF_PACKET 17 /* Packet family. */
  999. -#define PF_ASH 18 /* Ash. */
  1000. -#define PF_ECONET 19 /* Acorn Econet. */
  1001. -#define PF_ATMSVC 20 /* ATM SVCs. */
  1002. -#define PF_SNA 22 /* Linux SNA Project */
  1003. -#define PF_IRDA 23 /* IRDA sockets. */
  1004. -#define PF_PPPOX 24 /* PPPoX sockets. */
  1005. -#define PF_WANPIPE 25 /* Wanpipe API sockets. */
  1006. -#define PF_LLC 26 /* Linux LLC. */
  1007. -#define PF_CAN 29 /* Controller Area Network. */
  1008. -#define PF_TIPC 30 /* TIPC sockets. */
  1009. -#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
  1010. -#define PF_IUCV 32 /* IUCV sockets. */
  1011. -#define PF_RXRPC 33 /* RxRPC sockets. */
  1012. -#define PF_ISDN 34 /* mISDN sockets. */
  1013. -#define PF_PHONET 35 /* Phonet sockets. */
  1014. -#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
  1015. -#define PF_CAIF 37 /* CAIF sockets. */
  1016. -#define PF_ALG 38 /* Algorithm sockets. */
  1017. -#define PF_MAX 39 /* For now.. */
  1018. -
  1019. -/* Address families. */
  1020. -#define AF_UNSPEC PF_UNSPEC
  1021. -#define AF_LOCAL PF_LOCAL
  1022. -#define AF_UNIX PF_UNIX
  1023. -#define AF_FILE PF_FILE
  1024. -#define AF_INET PF_INET
  1025. -#define AF_AX25 PF_AX25
  1026. -#define AF_IPX PF_IPX
  1027. -#define AF_APPLETALK PF_APPLETALK
  1028. -#define AF_NETROM PF_NETROM
  1029. -#define AF_BRIDGE PF_BRIDGE
  1030. -#define AF_ATMPVC PF_ATMPVC
  1031. -#define AF_X25 PF_X25
  1032. -#define AF_INET6 PF_INET6
  1033. -#define AF_ROSE PF_ROSE
  1034. -#define AF_DECnet PF_DECnet
  1035. -#define AF_NETBEUI PF_NETBEUI
  1036. -#define AF_SECURITY PF_SECURITY
  1037. -#define AF_KEY PF_KEY
  1038. -#define AF_NETLINK PF_NETLINK
  1039. -#define AF_ROUTE PF_ROUTE
  1040. -#define AF_PACKET PF_PACKET
  1041. -#define AF_ASH PF_ASH
  1042. -#define AF_ECONET PF_ECONET
  1043. -#define AF_ATMSVC PF_ATMSVC
  1044. -#define AF_SNA PF_SNA
  1045. -#define AF_IRDA PF_IRDA
  1046. -#define AF_PPPOX PF_PPPOX
  1047. -#define AF_WANPIPE PF_WANPIPE
  1048. -#define AF_LLC PF_LLC
  1049. -#define AF_CAN PF_CAN
  1050. -#define AF_TIPC PF_TIPC
  1051. -#define AF_BLUETOOTH PF_BLUETOOTH
  1052. -#define AF_IUCV PF_IUCV
  1053. -#define AF_RXRPC PF_RXRPC
  1054. -#define AF_ISDN PF_ISDN
  1055. -#define AF_PHONET PF_PHONET
  1056. -#define AF_IEEE802154 PF_IEEE802154
  1057. -#define AF_CAIF PF_CAIF
  1058. -#define AF_ALG PF_ALG
  1059. -#define AF_MAX PF_MAX
  1060. -
  1061. -/* Socket level values. Others are defined in the appropriate headers.
  1062. -
  1063. - XXX These definitions also should go into the appropriate headers as
  1064. - far as they are available. */
  1065. -#define SOL_RAW 255
  1066. -#define SOL_DECNET 261
  1067. -#define SOL_X25 262
  1068. -#define SOL_PACKET 263
  1069. -#define SOL_ATM 264 /* ATM layer (cell level). */
  1070. -#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
  1071. -#define SOL_IRDA 266
  1072. -
  1073. -/* Maximum queue length specifiable by listen. */
  1074. -#define SOMAXCONN 128
  1075. -
  1076. -/* Get the definition of the macro to define the common sockaddr members. */
  1077. -#include <bits/sockaddr.h>
  1078. -
  1079. -/* Structure describing a generic socket address. */
  1080. -struct sockaddr
  1081. - {
  1082. - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
  1083. - char sa_data[14]; /* Address data. */
  1084. - };
  1085. -
  1086. -
  1087. -/* Structure large enough to hold any socket address (with the historical
  1088. - exception of AF_UNIX). We reserve 128 bytes. */
  1089. -#if ULONG_MAX > 0xffffffff
  1090. -# define __ss_aligntype __uint64_t
  1091. -#else
  1092. -# define __ss_aligntype __uint32_t
  1093. -#endif
  1094. -#define _SS_SIZE 128
  1095. -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
  1096. -
  1097. -struct sockaddr_storage
  1098. - {
  1099. - __SOCKADDR_COMMON (ss_); /* Address family, etc. */
  1100. - __ss_aligntype __ss_align; /* Force desired alignment. */
  1101. - char __ss_padding[_SS_PADSIZE];
  1102. - };
  1103. -
  1104. -
  1105. -/* Bits in the FLAGS argument to `send', `recv', et al. */
  1106. -enum
  1107. - {
  1108. - MSG_OOB = 0x01, /* Process out-of-band data. */
  1109. -#define MSG_OOB MSG_OOB
  1110. - MSG_PEEK = 0x02, /* Peek at incoming messages. */
  1111. -#define MSG_PEEK MSG_PEEK
  1112. - MSG_DONTROUTE = 0x04, /* Don't use local routing. */
  1113. -#define MSG_DONTROUTE MSG_DONTROUTE
  1114. -#ifdef __USE_GNU
  1115. - /* DECnet uses a different name. */
  1116. - MSG_TRYHARD = MSG_DONTROUTE,
  1117. -# define MSG_TRYHARD MSG_DONTROUTE
  1118. -#endif
  1119. - MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
  1120. -#define MSG_CTRUNC MSG_CTRUNC
  1121. - MSG_PROXY = 0x10, /* Supply or ask second address. */
  1122. -#define MSG_PROXY MSG_PROXY
  1123. - MSG_TRUNC = 0x20,
  1124. -#define MSG_TRUNC MSG_TRUNC
  1125. - MSG_DONTWAIT = 0x40, /* Nonblocking IO. */
  1126. -#define MSG_DONTWAIT MSG_DONTWAIT
  1127. - MSG_EOR = 0x80, /* End of record. */
  1128. -#define MSG_EOR MSG_EOR
  1129. - MSG_WAITALL = 0x100, /* Wait for a full request. */
  1130. -#define MSG_WAITALL MSG_WAITALL
  1131. - MSG_FIN = 0x200,
  1132. -#define MSG_FIN MSG_FIN
  1133. - MSG_SYN = 0x400,
  1134. -#define MSG_SYN MSG_SYN
  1135. - MSG_CONFIRM = 0x800, /* Confirm path validity. */
  1136. -#define MSG_CONFIRM MSG_CONFIRM
  1137. - MSG_RST = 0x1000,
  1138. -#define MSG_RST MSG_RST
  1139. - MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */
  1140. -#define MSG_ERRQUEUE MSG_ERRQUEUE
  1141. - MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
  1142. -#define MSG_NOSIGNAL MSG_NOSIGNAL
  1143. - MSG_MORE = 0x8000 /* Sender will send more. */
  1144. -#define MSG_MORE MSG_MORE
  1145. - };
  1146. -
  1147. -
  1148. -/* Structure describing messages sent by
  1149. - `sendmsg' and received by `recvmsg'. */
  1150. -/* Note: do not change these members to match glibc; these match the
  1151. - SuSv3 spec already (e.g. msg_iovlen/msg_controllen).
  1152. - http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */
  1153. -/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit
  1154. - platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */
  1155. -struct msghdr
  1156. - {
  1157. - void *msg_name; /* Address to send to/receive from. */
  1158. - socklen_t msg_namelen; /* Length of address data. */
  1159. -
  1160. - struct iovec *msg_iov; /* Vector of data to send/receive into. */
  1161. -#if __WORDSIZE == 32
  1162. - int msg_iovlen; /* Number of elements in the vector. */
  1163. -#else
  1164. - size_t msg_iovlen; /* Number of elements in the vector. */
  1165. -#endif
  1166. -
  1167. - void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
  1168. -#if __WORDSIZE == 32
  1169. - socklen_t msg_controllen; /* Ancillary data buffer length. */
  1170. -#else
  1171. - size_t msg_controllen; /* Ancillary data buffer length. */
  1172. -#endif
  1173. -
  1174. - int msg_flags; /* Flags on received message. */
  1175. - };
  1176. -
  1177. -/* Structure used for storage of ancillary data object information. */
  1178. -struct cmsghdr
  1179. - {
  1180. - size_t cmsg_len; /* Length of data in cmsg_data plus length
  1181. - of cmsghdr structure. */
  1182. - int cmsg_level; /* Originating protocol. */
  1183. - int cmsg_type; /* Protocol specific type. */
  1184. -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
  1185. - __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
  1186. -#endif
  1187. - };
  1188. -
  1189. -/* Ancillary data object manipulation macros. */
  1190. -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
  1191. -# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
  1192. -#else
  1193. -# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
  1194. -#endif
  1195. -#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
  1196. -#define CMSG_FIRSTHDR(mhdr) \
  1197. - ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
  1198. - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
  1199. -#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
  1200. - & (size_t) ~(sizeof (size_t) - 1))
  1201. -#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
  1202. - + CMSG_ALIGN (sizeof (struct cmsghdr)))
  1203. -#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
  1204. -
  1205. -extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
  1206. - struct cmsghdr *__cmsg) __THROW;
  1207. -libc_hidden_proto(__cmsg_nxthdr)
  1208. -#ifdef __USE_EXTERN_INLINES
  1209. -# ifndef _EXTERN_INLINE
  1210. -# define _EXTERN_INLINE extern __inline
  1211. -# endif
  1212. -_EXTERN_INLINE struct cmsghdr *
  1213. -__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
  1214. -{
  1215. - if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
  1216. - /* The kernel header does this so there may be a reason. */
  1217. - return 0;
  1218. -
  1219. - __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
  1220. - + CMSG_ALIGN (__cmsg->cmsg_len));
  1221. - if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
  1222. - + __mhdr->msg_controllen)
  1223. - || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
  1224. - > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
  1225. - /* No more entries. */
  1226. - return 0;
  1227. - return __cmsg;
  1228. -}
  1229. -#endif /* Use `extern inline'. */
  1230. -
  1231. -/* Socket level message types. This must match the definitions in
  1232. - <linux/socket.h>. */
  1233. -enum
  1234. - {
  1235. - SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
  1236. -#define SCM_RIGHTS SCM_RIGHTS
  1237. -#ifdef __USE_BSD
  1238. - , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
  1239. -# define SCM_CREDENTIALS SCM_CREDENTIALS
  1240. -#endif
  1241. - };
  1242. -
  1243. -/* User visible structure for SCM_CREDENTIALS message */
  1244. -
  1245. -struct ucred
  1246. -{
  1247. - pid_t pid; /* PID of sending process. */
  1248. - uid_t uid; /* UID of sending process. */
  1249. - gid_t gid; /* GID of sending process. */
  1250. -};
  1251. -
  1252. -/* Get socket manipulation related informations from kernel headers. */
  1253. -#ifndef __GLIBC__
  1254. -#define __GLIBC__ 2
  1255. -#include <asm/socket.h>
  1256. -#undef __GLIBC__
  1257. -#else
  1258. -#include <asm/socket.h>
  1259. -#endif
  1260. -
  1261. -
  1262. -/* Structure used to manipulate the SO_LINGER option. */
  1263. -struct linger
  1264. - {
  1265. - int l_onoff; /* Nonzero to linger on close. */
  1266. - int l_linger; /* Time to linger. */
  1267. - };
  1268. -
  1269. -/* Prefer socketcall over all these for sparc32,
  1270. - since it only has socketcall */
  1271. -#ifndef __arch64__
  1272. - #undef __NR_accept
  1273. - #undef __NR_bind
  1274. - #undef __NR_connect
  1275. - #undef __NR_getpeername
  1276. - #undef __NR_getsockname
  1277. - #undef __NR_getsockopt
  1278. - #undef __NR_listen
  1279. - #undef __NR_recv
  1280. - #undef __NR_recvfrom
  1281. - #undef __NR_recvmsg
  1282. - #undef __NR_send
  1283. - #undef __NR_sendmsg
  1284. - #undef __NR_sendto
  1285. - #undef __NR_setsockopt
  1286. - #undef __NR_shutdown
  1287. - #undef __NR_socket
  1288. - #undef __NR_socketpair
  1289. -#endif
  1290. -
  1291. -#endif /* bits/socket.h */
  1292. diff --git a/libc/sysdeps/linux/sparc/bits/socket_type.h b/libc/sysdeps/linux/sparc/bits/socket_type.h
  1293. new file mode 100644
  1294. index 0000000..494655f
  1295. --- /dev/null
  1296. +++ b/libc/sysdeps/linux/sparc/bits/socket_type.h
  1297. @@ -0,0 +1,54 @@
  1298. +/* System-specific socket constants and types. Linux version.
  1299. + Copyright (C) 1991,1992,1994-2001,2004,2006 Free Software Foundation, Inc.
  1300. + This file is part of the GNU C Library.
  1301. +
  1302. + The GNU C Library is free software; you can redistribute it and/or
  1303. + modify it under the terms of the GNU Lesser General Public
  1304. + License as published by the Free Software Foundation; either
  1305. + version 2.1 of the License, or (at your option) any later version.
  1306. +
  1307. + The GNU C Library is distributed in the hope that it will be useful,
  1308. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  1309. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1310. + Lesser General Public License for more details.
  1311. +
  1312. + You should have received a copy of the GNU Lesser General Public
  1313. + License along with the GNU C Library; if not, see
  1314. + <http://www.gnu.org/licenses/>. */
  1315. +
  1316. +#ifndef _SYS_SOCKET_H
  1317. +# error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
  1318. +#endif
  1319. +
  1320. +/* Types of sockets. */
  1321. +enum __socket_type
  1322. +{
  1323. + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
  1324. + byte streams. */
  1325. +#define SOCK_STREAM SOCK_STREAM
  1326. + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
  1327. + of fixed maximum length. */
  1328. +#define SOCK_DGRAM SOCK_DGRAM
  1329. + SOCK_RAW = 3, /* Raw protocol interface. */
  1330. +#define SOCK_RAW SOCK_RAW
  1331. + SOCK_RDM = 4, /* Reliably-delivered messages. */
  1332. +#define SOCK_RDM SOCK_RDM
  1333. + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  1334. + datagrams of fixed maximum length. */
  1335. +#define SOCK_SEQPACKET SOCK_SEQPACKET
  1336. + SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */
  1337. +#define SOCK_DCCP SOCK_DCCP
  1338. + SOCK_PACKET = 10, /* Linux specific way of getting packets
  1339. + at the dev level. For writing rarp and
  1340. + other similar things on the user level. */
  1341. +#define SOCK_PACKET SOCK_PACKET
  1342. +
  1343. + /* Flags to be ORed into the type parameter of socket and socketpair. */
  1344. +
  1345. + SOCK_CLOEXEC = 0x400000, /* Atomically set close-on-exec flag for the
  1346. + new descriptor(s). */
  1347. +#define SOCK_CLOEXEC SOCK_CLOEXEC
  1348. + SOCK_NONBLOCK = 0x004000 /* Atomically mark descriptor(s) as
  1349. + non-blocking. */
  1350. +#define SOCK_NONBLOCK SOCK_NONBLOCK
  1351. +};
  1352. --
  1353. 1.7.10.4