Gentoo Archives: gentoo-commits

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