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/glibc/2.10.1: 6020_all_alpha-fix-gcc-4.1-warnings.patch 6021_all_alpha-add-dl-procinfo-support.patch 6022_alpha_alpha-add-fdatasync-support.patch 6023_all_alpha-add-getsystats-support.patch 6024_all_alpha-fix-includes.patch 6025_all_alpha-add-futex-defines.patch 6026_all_alpha-fix-rtld-fPIC.patch 6027_all_alpha-fix-memchr.patch 6028_all_alpha-fix-SOCK_NONBLOCK.patch README.history
Date: Fri, 30 Oct 2009 04:56:11
Message-Id: E1N3jWy-0000Fh-J9@stork.gentoo.org
1 vapier 09/10/30 04:56:08
2
3 Modified: README.history
4 Added: 6020_all_alpha-fix-gcc-4.1-warnings.patch
5 6021_all_alpha-add-dl-procinfo-support.patch
6 6022_alpha_alpha-add-fdatasync-support.patch
7 6023_all_alpha-add-getsystats-support.patch
8 6024_all_alpha-fix-includes.patch
9 6025_all_alpha-add-futex-defines.patch
10 6026_all_alpha-fix-rtld-fPIC.patch
11 6027_all_alpha-fix-memchr.patch
12 6028_all_alpha-fix-SOCK_NONBLOCK.patch
13 Log:
14 import alpha patches from various locations #289642 by Matt Turner
15
16 Revision Changes Path
17 1.4 src/patchsets/glibc/2.10.1/README.history
18
19 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/README.history?rev=1.4&view=markup
20 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/README.history?rev=1.4&content-type=text/plain
21 diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/README.history?r1=1.3&r2=1.4
22
23 Index: README.history
24 ===================================================================
25 RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/2.10.1/README.history,v
26 retrieving revision 1.3
27 retrieving revision 1.4
28 diff -u -r1.3 -r1.4
29 --- README.history 18 Sep 2009 15:11:30 -0000 1.3
30 +++ README.history 30 Oct 2009 04:56:07 -0000 1.4
31 @@ -1,3 +1,14 @@
32 +4 30.10.2009
33 + + 6020_all_alpha-fix-gcc-4.1-warnings.patch
34 + + 6021_all_alpha-add-dl-procinfo-support.patch
35 + + 6022_alpha_alpha-add-fdatasync-support.patch
36 + + 6023_all_alpha-add-getsystats-support.patch
37 + + 6024_all_alpha-fix-includes.patch
38 + + 6025_all_alpha-add-futex-defines.patch
39 + + 6026_all_alpha-fix-rtld-fPIC.patch
40 + + 6027_all_alpha-fix-memchr.patch
41 + + 6028_all_alpha-fix-SOCK_NONBLOCK.patch
42 +
43 3 18.09.2009
44 + 6705_all_binutils-2.20-compat.patch
45
46
47
48
49 1.1 src/patchsets/glibc/2.10.1/6020_all_alpha-fix-gcc-4.1-warnings.patch
50
51 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6020_all_alpha-fix-gcc-4.1-warnings.patch?rev=1.1&view=markup
52 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6020_all_alpha-fix-gcc-4.1-warnings.patch?rev=1.1&content-type=text/plain
53
54 Index: 6020_all_alpha-fix-gcc-4.1-warnings.patch
55 ===================================================================
56 2006-05-30 Falk Hueffner <falk@××××××.org>
57
58 * sysdeps/unix/sysv/linux/alpha/ioperm.c: force the architecture
59 to ev6 in assembly code.
60
61 {standard input}: Assembler messages:
62 {standard input}:341: Error: macro requires $at register while noat in effect
63 {standard input}:374: Error: macro requires $at register while noat in effect
64 {standard input}:438: Error: macro requires $at register while noat in effect
65 {standard input}:471: Error: macro requires $at register while noat in effect
66 make[3]: *** [/tmp/buildd/glibc-2.3.6/build-tree/alpha-libc/misc/ioperm.o] Error 1
67
68 Hrm. gcc puts .arch ev4 into the .s, and this overrides -mev6 for as.
69 I cannot really think of anything better than
70
71 ---
72 ports/sysdeps/unix/sysv/linux/alpha/ioperm.c | 8 ++++----
73 1 file changed, 4 insertions(+), 4 deletions(-)
74
75 --- ports/sysdeps/unix/sysv/linux/alpha/ioperm.c
76 +++ ports/sysdeps/unix/sysv/linux/alpha/ioperm.c
77 @@ -178,13 +178,13 @@
78 static inline void
79 stb_mb(unsigned char val, unsigned long addr)
80 {
81 - __asm__("stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
82 + __asm__(".arch ev6; stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
83 }
84
85 static inline void
86 stw_mb(unsigned short val, unsigned long addr)
87 {
88 - __asm__("stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
89 + __asm__(".arch ev6; stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
90 }
91
92 static inline void
93 @@ -356,7 +356,7 @@
94 unsigned long int addr = dense_port_to_cpu_addr (port);
95 unsigned char r;
96
97 - __asm__ ("ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
98 + __asm__ (".arch ev6; ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
99 return r;
100 }
101
102 @@ -366,7 +366,7 @@
103 unsigned long int addr = dense_port_to_cpu_addr (port);
104 unsigned short r;
105
106 - __asm__ ("ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
107 + __asm__ (".arch ev6; ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
108 return r;
109 }
110
111
112
113
114 1.1 src/patchsets/glibc/2.10.1/6021_all_alpha-add-dl-procinfo-support.patch
115
116 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6021_all_alpha-add-dl-procinfo-support.patch?rev=1.1&view=markup
117 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6021_all_alpha-add-dl-procinfo-support.patch?rev=1.1&content-type=text/plain
118
119 Index: 6021_all_alpha-add-dl-procinfo-support.patch
120 ===================================================================
121 ---
122 ports/sysdeps/alpha/dl-machine.h | 12 ++++++
123 ports/sysdeps/alpha/dl-procinfo.c | 64 +++++++++++++++++++++++++++++++++++
124 ports/sysdeps/alpha/dl-procinfo.h | 68 ++++++++++++++++++++++++++++++++++++++
125 3 files changed, 144 insertions(+)
126
127 --- /dev/null
128 +++ ports/sysdeps/alpha/dl-procinfo.h
129 @@ -0,0 +1,68 @@
130 +/* Alpha version of processor capability information handling macros.
131 + Copyright (C) 2007 Free Software Foundation, Inc.
132 + This file is part of the GNU C Library.
133 + Contributed by Aurelien Jarno <aurelien@×××××××.net>, 2007.
134 +
135 + The GNU C Library is free software; you can redistribute it and/or
136 + modify it under the terms of the GNU Lesser General Public
137 + License as published by the Free Software Foundation; either
138 + version 2.1 of the License, or (at your option) any later version.
139 +
140 + The GNU C Library is distributed in the hope that it will be useful,
141 + but WITHOUT ANY WARRANTY; without even the implied warranty of
142 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
143 + Lesser General Public License for more details.
144 +
145 + You should have received a copy of the GNU Lesser General Public
146 + License along with the GNU C Library; if not, write to the Free
147 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
148 + 02111-1307 USA. */
149 +
150 +#ifndef _DL_PROCINFO_H
151 +#define _DL_PROCINFO_H 1
152 +
153 +#include <ldsodefs.h>
154 +
155 +
156 +/* Mask to filter out platforms. */
157 +#define _DL_HWCAP_PLATFORM (-1ULL)
158 +
159 +#define _DL_PLATFORMS_COUNT 5
160 +
161 +static inline const char *
162 +__attribute__ ((unused))
163 +_dl_platform_string (int idx)
164 +{
165 + return GLRO(dl_alpha_platforms)[idx];
166 +};
167 +
168 +static inline int
169 +__attribute__ ((unused, always_inline))
170 +_dl_string_platform (const char *str)
171 +{
172 + int i;
173 +
174 + if (str != NULL)
175 + for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
176 + {
177 + if (strcmp (str, _dl_platform_string (i)) == 0)
178 + return i;
179 + }
180 + return -1;
181 +};
182 +
183 +/* We cannot provide a general printing function. */
184 +#define _dl_procinfo(word) -1
185 +
186 +/* There are no hardware capabilities defined. */
187 +#define _dl_hwcap_string(idx) ""
188 +
189 +/* By default there is no important hardware capability. */
190 +#define HWCAP_IMPORTANT (0)
191 +
192 +/* We don't have any hardware capabilities. */
193 +#define _DL_HWCAP_COUNT 0
194 +
195 +#define _dl_string_hwcap(str) (-1)
196 +
197 +#endif /* dl-procinfo.h */
198 --- /dev/null
199 +++ ports/sysdeps/alpha/dl-procinfo.c
200 @@ -0,0 +1,64 @@
201 +/* Data for Alpha version of processor capability information.
202 + Copyright (C) 2007 Free Software Foundation, Inc.
203 + This file is part of the GNU C Library.
204 + Contributed by Aurelien Jarno <aurelien@×××××××.net>, 2007.
205 +
206 + The GNU C Library is free software; you can redistribute it and/or
207 + modify it under the terms of the GNU Lesser General Public
208 + License as published by the Free Software Foundation; either
209 + version 2.1 of the License, or (at your option) any later version.
210 +
211 + The GNU C Library is distributed in the hope that it will be useful,
212 + but WITHOUT ANY WARRANTY; without even the implied warranty of
213 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
214 + Lesser General Public License for more details.
215 +
216 + You should have received a copy of the GNU Lesser General Public
217 + License along with the GNU C Library; if not, write to the Free
218 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
219 + 02111-1307 USA. */
220 +
221 +/* This information must be kept in sync with the _DL_PLATFORM_COUNT
222 + definitions in procinfo.h.
223 +
224 + If anything should be added here check whether the size of each string
225 + is still ok with the given array size.
226 +
227 + All the #ifdefs in the definitions are quite irritating but
228 + necessary if we want to avoid duplicating the information. There
229 + are three different modes:
230 +
231 + - PROCINFO_DECL is defined. This means we are only interested in
232 + declarations.
233 +
234 + - PROCINFO_DECL is not defined:
235 +
236 + + if SHARED is defined the file is included in an array
237 + initializer. The .element = { ... } syntax is needed.
238 +
239 + + if SHARED is not defined a normal array initialization is
240 + needed.
241 + */
242 +
243 +#ifndef PROCINFO_CLASS
244 +#define PROCINFO_CLASS
245 +#endif
246 +
247 +#if !defined PROCINFO_DECL && defined SHARED
248 + ._dl_alpha_platforms
249 +#else
250 +PROCINFO_CLASS const char _dl_alpha_platforms[5][5]
251 +#endif
252 +#ifndef PROCINFO_DECL
253 += {
254 + "ev4", "ev5", "ev56", "ev6", "ev67"
255 + }
256 +#endif
257 +#if !defined SHARED || defined PROCINFO_DECL
258 +;
259 +#else
260 +,
261 +#endif
262 +
263 +#undef PROCINFO_DECL
264 +#undef PROCINFO_CLASS
265 --- ports/sysdeps/alpha/dl-machine.h
266 +++ ports/sysdeps/alpha/dl-machine.h
267 @@ -249,6 +249,18 @@
268 /* The alpha never uses Elf64_Rel relocations. */
269 #define ELF_MACHINE_NO_REL 1
270
271 +/* We define an initialization functions. This is called very early in
272 + * _dl_sysdep_start. */
273 +#define DL_PLATFORM_INIT dl_platform_init ()
274 +
275 +static inline void __attribute__ ((unused))
276 +dl_platform_init (void)
277 +{
278 + if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
279 + /* Avoid an empty string which would disturb us. */
280 + GLRO(dl_platform) = NULL;
281 +}
282 +
283 /* Fix up the instructions of a PLT entry to invoke the function
284 rather than the dynamic linker. */
285 static inline Elf64_Addr
286
287
288
289 1.1 src/patchsets/glibc/2.10.1/6022_alpha_alpha-add-fdatasync-support.patch
290
291 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6022_alpha_alpha-add-fdatasync-support.patch?rev=1.1&view=markup
292 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6022_alpha_alpha-add-fdatasync-support.patch?rev=1.1&content-type=text/plain
293
294 Index: 6022_alpha_alpha-add-fdatasync-support.patch
295 ===================================================================
296 2009-07-25 Aurelien Jarno <aurelien@×××××××.net>
297
298 * sysdeps/unix/sysv/linux/kernel-features.h: define
299 __ASSUME_FDATASYNC.
300 * sysdeps/unix/sysv/linux/fdatasync.c: New file.
301 * sysdeps/unix/sysv/linux/Makefile: compile fdatasync.c with
302 -fexceptions.
303 * sysdeps/unix/sysv/linux/syscalls.list: Remove fdatasync.
304
305 ---
306 sysdeps/unix/sysv/linux/Makefile | 1
307 sysdeps/unix/sysv/linux/fdatasync.c | 69 ++++++++++++++++++++++++++++++
308 sysdeps/unix/sysv/linux/kernel-features.h | 6 ++
309 sysdeps/unix/sysv/linux/syscalls.list | 1
310 4 files changed, 76 insertions(+), 1 deletion(-)
311
312 --- a/sysdeps/unix/sysv/linux/kernel-features.h
313 +++ b/sysdeps/unix/sysv/linux/kernel-features.h
314 @@ -474,6 +474,12 @@
315 # define __ASSUME_FUTEX_LOCK_PI 1
316 #endif
317
318 +/* Support for fsyncdata syscall was added in 2.6.22 on alpha, but it
319 + was already present in 2.0 kernels on other architectures. */
320 +#if (!defined __alpha || __LINUX_KERNEL_VERSION >= 0x020616)
321 +# define __ASSUME_FDATASYNC 1
322 +#endif
323 +
324 /* Support for utimensat syscall was added in 2.6.22, on alpha and s390
325 only after 2.6.22-rc1. */
326 #if __LINUX_KERNEL_VERSION >= 0x020616 \
327 --- /dev/null
328 +++ b/sysdeps/unix/sysv/linux/fdatasync.c
329 @@ -0,0 +1,69 @@
330 +/* fdatasync -- synchronize at least the data part of a file with
331 + the underlying media. Linux version.
332 +
333 + Copyright (C) 2007 Free Software Foundation, Inc.
334 + This file is part of the GNU C Library.
335 +
336 + The GNU C Library is free software; you can redistribute it and/or
337 + modify it under the terms of the GNU Lesser General Public
338 + License as published by the Free Software Foundation; either
339 + version 2.1 of the License, or (at your option) any later version.
340 +
341 + The GNU C Library is distributed in the hope that it will be useful,
342 + but WITHOUT ANY WARRANTY; without even the implied warranty of
343 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
344 + Lesser General Public License for more details.
345 +
346 + You should have received a copy of the GNU Lesser General Public
347 + License along with the GNU C Library; if not, write to the Free
348 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
349 + 02111-1307 USA. */
350 +
351 +#include <errno.h>
352 +#include <unistd.h>
353 +
354 +#include <sysdep-cancel.h>
355 +#include <sys/syscall.h>
356 +#include <bp-checks.h>
357 +
358 +#include <kernel-features.h>
359 +
360 +#if defined __NR_fdatasync && !defined __ASSUME_FDATASYNC
361 +static int __have_no_fdatasync;
362 +#endif
363 +
364 +static int
365 +do_fdatasync (int fd)
366 +{
367 +#ifdef __ASSUME_FDATASYNC
368 + return INLINE_SYSCALL (fdatasync, 1, fd);
369 +#elif defined __NR_fdatasync
370 + if (!__builtin_expect (__have_no_fdatasync, 0))
371 + {
372 + int result = INLINE_SYSCALL (fdatasync, 1, fd);
373 + if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
374 + return result;
375 +
376 + __have_no_fdatasync = 1;
377 + }
378 +#endif
379 + return INLINE_SYSCALL (fsync, 1, fd);
380 +}
381 +
382 +int
383 +__fdatasync (int fd)
384 +{
385 + if (SINGLE_THREAD_P)
386 + return do_fdatasync (fd);
387 +
388 + int oldtype = LIBC_CANCEL_ASYNC ();
389 +
390 + int result = do_fdatasync (fd);
391 +
392 + LIBC_CANCEL_RESET (oldtype);
393 +
394 + return result;
395 +}
396 +
397 +weak_alias (__fdatasync, fdatasync)
398 +
399 --- a/sysdeps/unix/sysv/linux/syscalls.list
400 +++ b/sysdeps/unix/sysv/linux/syscalls.list
401 @@ -11,7 +11,6 @@
402 epoll_create1 EXTRA epoll_create1 i:i epoll_create1
403 epoll_ctl EXTRA epoll_ctl i:iiip epoll_ctl
404 epoll_wait EXTRA epoll_wait Ci:ipii epoll_wait
405 -fdatasync - fdatasync Ci:i fdatasync
406 flock - flock i:ii __flock flock
407 fork - fork i: __libc_fork __fork fork
408 get_kernel_syms EXTRA get_kernel_syms i:p get_kernel_syms
409 --- a/sysdeps/unix/sysv/linux/Makefile
410 +++ b/sysdeps/unix/sysv/linux/Makefile
411 @@ -17,6 +17,7 @@
412 eventfd eventfd_read eventfd_write
413
414
415 +CFLAGS-fdatasync.c = -fexceptions
416 CFLAGS-gethostid.c = -fexceptions
417
418 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
419
420
421
422 1.1 src/patchsets/glibc/2.10.1/6023_all_alpha-add-getsystats-support.patch
423
424 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6023_all_alpha-add-getsystats-support.patch?rev=1.1&view=markup
425 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6023_all_alpha-add-getsystats-support.patch?rev=1.1&content-type=text/plain
426
427 Index: 6023_all_alpha-add-getsystats-support.patch
428 ===================================================================
429 2009-05-16 Aurelien Jarno <aurelien@×××××××.net>
430
431 * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER):
432 Change parameters and use next_line.
433
434 ---
435 ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c | 5 +++--
436 1 file changed, 3 insertions(+), 2 deletions(-)
437
438 --- ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c
439 +++ ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c
440 @@ -20,15 +20,16 @@
441
442
443 /* We need to define a special parser for /proc/cpuinfo. */
444 -#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \
445 +#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT) \
446 do \
447 { \
448 /* Find the line that contains the information about the number of \
449 active cpus. We don't have to fear extremely long lines since \
450 the kernel will not generate them. 8192 bytes are really enough. \
451 If there is no "CPUs ..." line then we are on a UP system. */ \
452 + char *l; \
453 (RESULT) = 1; \
454 - while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \
455 + while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \
456 if ((sscanf (BUFFER, "cpus active : %d", &(RESULT)) == 1) \
457 || (sscanf (BUFFER, "CPUs probed %*d active %d", \
458 &(RESULT)) == 1)) \
459
460
461
462 1.1 src/patchsets/glibc/2.10.1/6024_all_alpha-fix-includes.patch
463
464 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6024_all_alpha-fix-includes.patch?rev=1.1&view=markup
465 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6024_all_alpha-fix-includes.patch?rev=1.1&content-type=text/plain
466
467 Index: 6024_all_alpha-fix-includes.patch
468 ===================================================================
469 2009-05-15 Aurelien Jarno <aurelien@×××××××.net>
470
471 * sysdeps/unix/sysv/linux/alpha/getdents64.c: Adjust include path.
472 * sysdeps/unix/sysv/linux/alpha/nptl/fork.c: Likewise.
473 * sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c: Likewise.
474 * sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c: Likewise.
475 * sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c: Likewise.
476 * sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c: Likewise.
477 * sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c: Likewise.
478 * sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c: Likewise.
479 * sysdeps/unix/sysv/linux/alpha/sysconf.c: Likewise.
480
481 ---
482 ports/sysdeps/unix/sysv/linux/alpha/getdents64.c | 2 +-
483 ports/sysdeps/unix/sysv/linux/alpha/nptl/fork.c | 2 +-
484 ports/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c | 2 +-
485 ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c | 2 +-
486 ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c | 2 +-
487 ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c | 2 +-
488 ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c | 2 +-
489 ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c | 2 +-
490 ports/sysdeps/unix/sysv/linux/alpha/sysconf.c | 2 +-
491 9 files changed, 9 insertions(+), 9 deletions(-)
492
493 --- ports/sysdeps/unix/sysv/linux/alpha/getdents64.c
494 +++ ports/sysdeps/unix/sysv/linux/alpha/getdents64.c
495 @@ -1 +1 @@
496 -#include "../getdents64.c"
497 +#include <sysdeps/unix/sysv/linux/getdents64.c>
498 --- ports/sysdeps/unix/sysv/linux/alpha/nptl/fork.c
499 +++ ports/sysdeps/unix/sysv/linux/alpha/nptl/fork.c
500 @@ -27,4 +27,4 @@
501 CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
502 NULL, NULL, &THREAD_SELF->tid, NULL)
503
504 -#include "../fork.c"
505 +#include <sysdeps/unix/sysv/linux/fork.c>
506 --- ports/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c
507 +++ ports/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c
508 @@ -2,4 +2,4 @@
509 the acquire/release semantics of atomic_exchange_and_add. And even if
510 we don't do this, we should be using atomic_full_barrier or otherwise. */
511 #define __lll_rel_instr "mb"
512 -#include "../sem_post.c"
513 +#include <nptl/sysdeps/unix/sysv/linux/sem_post.c>
514 --- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c
515 +++ ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c
516 @@ -1 +1 @@
517 -#include "../x86_64/timer_create.c"
518 +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c>
519 --- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c
520 +++ ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c
521 @@ -1 +1 @@
522 -#include "../x86_64/timer_delete.c"
523 +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_delete.c>
524 --- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c
525 +++ ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c
526 @@ -1 +1 @@
527 -#include "../x86_64/timer_getoverr.c"
528 +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c>
529 --- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c
530 +++ ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c
531 @@ -1 +1 @@
532 -#include "../x86_64/timer_gettime.c"
533 +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c>
534 --- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c
535 +++ ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c
536 @@ -1 +1 @@
537 -#include "../x86_64/timer_settime.c"
538 +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_settime.c>
539 --- ports/sysdeps/unix/sysv/linux/alpha/sysconf.c
540 +++ ports/sysdeps/unix/sysv/linux/alpha/sysconf.c
541 @@ -149,4 +149,4 @@
542 /* Now the generic Linux version. */
543 #undef __sysconf
544 #define __sysconf static linux_sysconf
545 -#include "../sysconf.c"
546 +#include <sysdeps/unix/sysv/linux/sysconf.c>
547
548
549
550 1.1 src/patchsets/glibc/2.10.1/6025_all_alpha-add-futex-defines.patch
551
552 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6025_all_alpha-add-futex-defines.patch?rev=1.1&view=markup
553 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6025_all_alpha-add-futex-defines.patch?rev=1.1&content-type=text/plain
554
555 Index: 6025_all_alpha-add-futex-defines.patch
556 ===================================================================
557 2009-05-19 Aurelien Jarno <aurelien@×××××××.net>
558
559 * sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h: Define
560 FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
561 FUTEX_BITSET_MATCH_ANY.
562
563 ---
564 ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h | 5 +++++
565 1 file changed, 5 insertions(+)
566
567 --- ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
568 +++ ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
569 @@ -37,7 +37,12 @@
570 #define FUTEX_LOCK_PI 6
571 #define FUTEX_UNLOCK_PI 7
572 #define FUTEX_TRYLOCK_PI 8
573 +#define FUTEX_WAIT_BITSET 9
574 +#define FUTEX_WAKE_BITSET 10
575 #define FUTEX_PRIVATE_FLAG 128
576 +#define FUTEX_CLOCK_REALTIME 256
577 +
578 +#define FUTEX_BITSET_MATCH_ANY 0xffffffff
579
580 /* Values for 'private' parameter of locking macros. Yes, the
581 definition seems to be backwards. But it is not. The bit will be
582
583
584
585 1.1 src/patchsets/glibc/2.10.1/6026_all_alpha-fix-rtld-fPIC.patch
586
587 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6026_all_alpha-fix-rtld-fPIC.patch?rev=1.1&view=markup
588 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6026_all_alpha-fix-rtld-fPIC.patch?rev=1.1&content-type=text/plain
589
590 Index: 6026_all_alpha-fix-rtld-fPIC.patch
591 ===================================================================
592 2009-05-26 Aurelien Jarno <aurelien@×××××××.net>
593
594 * sysdeps/alpha/Makefile (CFLAGS-rtld.c): add $(PIC-ccflag).
595
596 ---
597 ports/sysdeps/alpha/Makefile | 3 ++-
598 1 file changed, 2 insertions(+), 1 deletion(-)
599
600 --- ports/sysdeps/alpha/Makefile
601 +++ ports/sysdeps/alpha/Makefile
602 @@ -35,7 +35,8 @@
603
604 ifeq ($(subdir),elf)
605 # The ld.so startup code cannot use literals until it self-relocates.
606 -CFLAGS-rtld.c = -mbuild-constants
607 +# It uses more than 64k for the small data area.
608 +CFLAGS-rtld.c = -mbuild-constants $(PIC-ccflag)
609 endif
610
611 # Build everything with full IEEE math support, and with dynamic rounding;
612
613
614
615 1.1 src/patchsets/glibc/2.10.1/6027_all_alpha-fix-memchr.patch
616
617 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6027_all_alpha-fix-memchr.patch?rev=1.1&view=markup
618 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6027_all_alpha-fix-memchr.patch?rev=1.1&content-type=text/plain
619
620 Index: 6027_all_alpha-fix-memchr.patch
621 ===================================================================
622 2009-07-27 Aurelien Jarno <aurelien@×××××××.net>
623
624 * sysdeps/alpha/memchr.S: Use prefetch load.
625 * sysdeps/alpha/alphaev6/memchr.S: Likewise.
626
627 --- ports/sysdeps/alpha/alphaev6/memchr.S
628 +++ ports/sysdeps/alpha/alphaev6/memchr.S
629 @@ -127,7 +127,7 @@ $first_quad:
630 cmpbge $31, $1, $2 # E :
631 bne $2, $found_it # U :
632 # At least one byte left to process.
633 - ldq $1, 8($0) # L :
634 + ldq $31, 8($0) # L :
635 subq $5, 1, $18 # E : U L U L
636
637 addq $0, 8, $0 # E :
638 @@ -143,38 +143,38 @@ $first_quad:
639 and $4, 8, $4 # E : odd number of quads?
640 bne $4, $odd_quad_count # U :
641 # At least three quads remain to be accessed
642 - mov $1, $4 # E : L U L U : move prefetched value to correct reg
643 + nop # E : L U L U : move prefetched value to correct reg
644
645 .align 4
646 $unrolled_loop:
647 - ldq $1, 8($0) # L : prefetch $1
648 - xor $17, $4, $2 # E :
649 - cmpbge $31, $2, $2 # E :
650 - bne $2, $found_it # U : U L U L
651 + ldq $1, 0($0) # L : load quad
652 + xor $17, $1, $2 # E :
653 + ldq $31, 8($0) # L : prefetch next quad
654 + cmpbge $31, $2, $2 # E : U L U L
655
656 + bne $2, $found_it # U :
657 addq $0, 8, $0 # E :
658 nop # E :
659 nop # E :
660 - nop # E :
661
662 $odd_quad_count:
663 + ldq $1, 0($0) # L : load quad
664 xor $17, $1, $2 # E :
665 - ldq $4, 8($0) # L : prefetch $4
666 + ldq $31, 8($0) # L : prefetch $4
667 cmpbge $31, $2, $2 # E :
668 - addq $0, 8, $6 # E :
669
670 + addq $0, 8, $6 # E :
671 bne $2, $found_it # U :
672 cmpult $6, $18, $6 # E :
673 addq $0, 8, $0 # E :
674 - nop # E :
675
676 bne $6, $unrolled_loop # U :
677 - mov $4, $1 # E : move prefetched value into $1
678 nop # E :
679 nop # E :
680 -
681 -$final: subq $5, $0, $18 # E : $18 <- number of bytes left to do
682 nop # E :
683 +
684 +$final: ldq $1, 0($0) # L : load last quad
685 + subq $5, $0, $18 # E : $18 <- number of bytes left to do
686 nop # E :
687 bne $18, $last_quad # U :
688
689 --- ports/sysdeps/alpha/memchr.S
690 +++ ports/sysdeps/alpha/memchr.S
691 @@ -119,7 +119,7 @@ $first_quad:
692
693 # At least one byte left to process.
694
695 - ldq t0, 8(v0) # e0 :
696 + ldq zero, 8(v0) # e0 : prefetch next quad
697 subq t4, 1, a2 # .. e1 :
698 addq v0, 8, v0 #-e0 :
699
700 @@ -138,19 +138,19 @@ $first_quad:
701
702 # At least three quads remain to be accessed
703
704 - mov t0, t3 # e0 : move prefetched value to correct reg
705 -
706 .align 4
707 $unrolled_loop:
708 - ldq t0, 8(v0) #-e0 : prefetch t0
709 - xor a1, t3, t1 # .. e1 :
710 - cmpbge zero, t1, t1 # e0 :
711 - bne t1, $found_it # .. e1 :
712 + ldq t0, 0(v0) # e0 : load quad
713 + xor a1, t0, t1 # .. e1 :
714 + ldq zero, 8(v0) # e0 : prefetch next quad
715 + cmpbge zero, t1, t1 # .. e1:
716 + bne t1, $found_it # e0 :
717
718 - addq v0, 8, v0 #-e0 :
719 + addq v0, 8, v0 # e1 :
720 $odd_quad_count:
721 + ldq t0, 0(v0) # e0 : load quad
722 xor a1, t0, t1 # .. e1 :
723 - ldq t3, 8(v0) # e0 : prefetch t3
724 + ldq zero, 8(v0) # e0 : prefetch next quad
725 cmpbge zero, t1, t1 # .. e1 :
726 addq v0, 8, t5 #-e0 :
727 bne t1, $found_it # .. e1 :
728 @@ -159,8 +159,8 @@ $odd_quad_count:
729 addq v0, 8, v0 # .. e1 :
730 bne t5, $unrolled_loop #-e1 :
731
732 - mov t3, t0 # e0 : move prefetched value into t0
733 -$final: subq t4, v0, a2 # .. e1 : a2 <- number of bytes left to do
734 +$final: ldq t0, 0(v0) # e0 : load last quad
735 + subq t4, v0, a2 # .. e1 : a2 <- number of bytes left to do
736 bne a2, $last_quad # e1 :
737
738 $not_found:
739
740
741
742 1.1 src/patchsets/glibc/2.10.1/6028_all_alpha-fix-SOCK_NONBLOCK.patch
743
744 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6028_all_alpha-fix-SOCK_NONBLOCK.patch?rev=1.1&view=markup
745 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.10.1/6028_all_alpha-fix-SOCK_NONBLOCK.patch?rev=1.1&content-type=text/plain
746
747 Index: 6028_all_alpha-fix-SOCK_NONBLOCK.patch
748 ===================================================================
749 2009-08-16 Aurelien Jarno <aurelien@×××××××.net>
750
751 * ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h: New file based on
752 the generic version, with SOCK_NONBLOCK matching the kernel value.
753
754 --- /dev/null
755 +++ ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h
756 @@ -0,0 +1,407 @@
757 +/* System-specific socket constants and types. Linux version.
758 + Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
759 + Free Software Foundation, Inc.
760 + This file is part of the GNU C Library.
761 +
762 + The GNU C Library is free software; you can redistribute it and/or
763 + modify it under the terms of the GNU Lesser General Public
764 + License as published by the Free Software Foundation; either
765 + version 2.1 of the License, or (at your option) any later version.
766 +
767 + The GNU C Library is distributed in the hope that it will be useful,
768 + but WITHOUT ANY WARRANTY; without even the implied warranty of
769 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
770 + Lesser General Public License for more details.
771 +
772 + You should have received a copy of the GNU Lesser General Public
773 + License along with the GNU C Library; if not, write to the Free
774 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
775 + 02111-1307 USA. */
776 +
777 +#ifndef __BITS_SOCKET_H
778 +#define __BITS_SOCKET_H
779 +
780 +#ifndef _SYS_SOCKET_H
781 +# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
782 +#endif
783 +
784 +#define __need_size_t
785 +#include <stddef.h>
786 +
787 +#include <sys/types.h>
788 +
789 +/* Type for length arguments in socket calls. */
790 +#ifndef __socklen_t_defined
791 +typedef __socklen_t socklen_t;
792 +# define __socklen_t_defined
793 +#endif
794 +
795 +/* Types of sockets. */
796 +enum __socket_type
797 +{
798 + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
799 + byte streams. */
800 +#define SOCK_STREAM SOCK_STREAM
801 + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
802 + of fixed maximum length. */
803 +#define SOCK_DGRAM SOCK_DGRAM
804 + SOCK_RAW = 3, /* Raw protocol interface. */
805 +#define SOCK_RAW SOCK_RAW
806 + SOCK_RDM = 4, /* Reliably-delivered messages. */
807 +#define SOCK_RDM SOCK_RDM
808 + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
809 + datagrams of fixed maximum length. */
810 +#define SOCK_SEQPACKET SOCK_SEQPACKET
811 + SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */
812 +#define SOCK_DCCP SOCK_DCCP
813 + SOCK_PACKET = 10, /* Linux specific way of getting packets
814 + at the dev level. For writing rarp and
815 + other similar things on the user level. */
816 +#define SOCK_PACKET SOCK_PACKET
817 +
818 + /* Flags to be ORed into the type parameter of socket and socketpair and
819 + used for the flags parameter of paccept. */
820 +
821 + SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the
822 + new descriptor(s). */
823 +#define SOCK_CLOEXEC SOCK_CLOEXEC
824 +#undef SOCK_NONBLOCK
825 + SOCK_NONBLOCK = 0x40000000 /* Atomically mark descriptor(s) as
826 + non-blocking. */
827 +#define SOCK_NONBLOCK SOCK_NONBLOCK
828 +};
829 +
830 +/* Protocol families. */
831 +#define PF_UNSPEC 0 /* Unspecified. */
832 +#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
833 +#define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */
834 +#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
835 +#define PF_INET 2 /* IP protocol family. */
836 +#define PF_AX25 3 /* Amateur Radio AX.25. */
837 +#define PF_IPX 4 /* Novell Internet Protocol. */
838 +#define PF_APPLETALK 5 /* Appletalk DDP. */
839 +#define PF_NETROM 6 /* Amateur radio NetROM. */
840 +#define PF_BRIDGE 7 /* Multiprotocol bridge. */
841 +#define PF_ATMPVC 8 /* ATM PVCs. */
842 +#define PF_X25 9 /* Reserved for X.25 project. */
843 +#define PF_INET6 10 /* IP version 6. */
844 +#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
845 +#define PF_DECnet 12 /* Reserved for DECnet project. */
846 +#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
847 +#define PF_SECURITY 14 /* Security callback pseudo AF. */
848 +#define PF_KEY 15 /* PF_KEY key management API. */
849 +#define PF_NETLINK 16
850 +#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
851 +#define PF_PACKET 17 /* Packet family. */
852 +#define PF_ASH 18 /* Ash. */
853 +#define PF_ECONET 19 /* Acorn Econet. */
854 +#define PF_ATMSVC 20 /* ATM SVCs. */
855 +#define PF_RDS 21 /* RDS sockets. */
856 +#define PF_SNA 22 /* Linux SNA Project */
857 +#define PF_IRDA 23 /* IRDA sockets. */
858 +#define PF_PPPOX 24 /* PPPoX sockets. */
859 +#define PF_WANPIPE 25 /* Wanpipe API sockets. */
860 +#define PF_LLC 26 /* Linux LLC. */
861 +#define PF_CAN 29 /* Controller Area Network. */
862 +#define PF_TIPC 30 /* TIPC sockets. */
863 +#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
864 +#define PF_IUCV 32 /* IUCV sockets. */
865 +#define PF_RXRPC 33 /* RxRPC sockets. */
866 +#define PF_ISDN 34 /* mISDN sockets. */
867 +#define PF_PHONET 35 /* Phonet sockets. */
868 +#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
869 +#define PF_MAX 37 /* For now.. */
870 +
871 +/* Address families. */
872 +#define AF_UNSPEC PF_UNSPEC
873 +#define AF_LOCAL PF_LOCAL
874 +#define AF_UNIX PF_UNIX
875 +#define AF_FILE PF_FILE
876 +#define AF_INET PF_INET
877 +#define AF_AX25 PF_AX25
878 +#define AF_IPX PF_IPX
879 +#define AF_APPLETALK PF_APPLETALK
880 +#define AF_NETROM PF_NETROM
881 +#define AF_BRIDGE PF_BRIDGE
882 +#define AF_ATMPVC PF_ATMPVC
883 +#define AF_X25 PF_X25
884 +#define AF_INET6 PF_INET6
885 +#define AF_ROSE PF_ROSE
886 +#define AF_DECnet PF_DECnet
887 +#define AF_NETBEUI PF_NETBEUI
888 +#define AF_SECURITY PF_SECURITY
889 +#define AF_KEY PF_KEY
890 +#define AF_NETLINK PF_NETLINK
891 +#define AF_ROUTE PF_ROUTE
892 +#define AF_PACKET PF_PACKET
893 +#define AF_ASH PF_ASH
894 +#define AF_ECONET PF_ECONET
895 +#define AF_ATMSVC PF_ATMSVC
896 +#define AF_RDS PF_RDS
897 +#define AF_SNA PF_SNA
898 +#define AF_IRDA PF_IRDA
899 +#define AF_PPPOX PF_PPPOX
900 +#define AF_WANPIPE PF_WANPIPE
901 +#define AF_LLC PF_LLC
902 +#define AF_CAN PF_CAN
903 +#define AF_TIPC PF_TIPC
904 +#define AF_BLUETOOTH PF_BLUETOOTH
905 +#define AF_IUCV PF_IUCV
906 +#define AF_RXRPC PF_RXRPC
907 +#define AF_ISDN PF_ISDN
908 +#define AF_PHONET PF_PHONET
909 +#define AF_IEEE802154 PF_IEEE802154
910 +#define AF_MAX PF_MAX
911 +
912 +/* Socket level values. Others are defined in the appropriate headers.
913 +
914 + XXX These definitions also should go into the appropriate headers as
915 + far as they are available. */
916 +#define SOL_RAW 255
917 +#define SOL_DECNET 261
918 +#define SOL_X25 262
919 +#define SOL_PACKET 263
920 +#define SOL_ATM 264 /* ATM layer (cell level). */
921 +#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
922 +#define SOL_IRDA 266
923 +
924 +/* Maximum queue length specifiable by listen. */
925 +#define SOMAXCONN 128
926 +
927 +/* Get the definition of the macro to define the common sockaddr members. */
928 +#include <bits/sockaddr.h>
929 +
930 +/* Structure describing a generic socket address. */
931 +struct sockaddr
932 + {
933 + __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
934 + char sa_data[14]; /* Address data. */
935 + };
936 +
937 +
938 +/* Structure large enough to hold any socket address (with the historical
939 + exception of AF_UNIX). We reserve 128 bytes. */
940 +#define __ss_aligntype unsigned long int
941 +#define _SS_SIZE 128
942 +#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
943 +
944 +struct sockaddr_storage
945 + {
946 + __SOCKADDR_COMMON (ss_); /* Address family, etc. */
947 + __ss_aligntype __ss_align; /* Force desired alignment. */
948 + char __ss_padding[_SS_PADSIZE];
949 + };
950 +
951 +
952 +/* Bits in the FLAGS argument to `send', `recv', et al. */
953 +enum
954 + {
955 + MSG_OOB = 0x01, /* Process out-of-band data. */
956 +#define MSG_OOB MSG_OOB
957 + MSG_PEEK = 0x02, /* Peek at incoming messages. */
958 +#define MSG_PEEK MSG_PEEK
959 + MSG_DONTROUTE = 0x04, /* Don't use local routing. */
960 +#define MSG_DONTROUTE MSG_DONTROUTE
961 +#ifdef __USE_GNU
962 + /* DECnet uses a different name. */
963 + MSG_TRYHARD = MSG_DONTROUTE,
964 +# define MSG_TRYHARD MSG_DONTROUTE
965 +#endif
966 + MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
967 +#define MSG_CTRUNC MSG_CTRUNC
968 + MSG_PROXY = 0x10, /* Supply or ask second address. */
969 +#define MSG_PROXY MSG_PROXY
970 + MSG_TRUNC = 0x20,
971 +#define MSG_TRUNC MSG_TRUNC
972 + MSG_DONTWAIT = 0x40, /* Nonblocking IO. */
973 +#define MSG_DONTWAIT MSG_DONTWAIT
974 + MSG_EOR = 0x80, /* End of record. */
975 +#define MSG_EOR MSG_EOR
976 + MSG_WAITALL = 0x100, /* Wait for a full request. */
977 +#define MSG_WAITALL MSG_WAITALL
978 + MSG_FIN = 0x200,
979 +#define MSG_FIN MSG_FIN
980 + MSG_SYN = 0x400,
981 +#define MSG_SYN MSG_SYN
982 + MSG_CONFIRM = 0x800, /* Confirm path validity. */
983 +#define MSG_CONFIRM MSG_CONFIRM
984 + MSG_RST = 0x1000,
985 +#define MSG_RST MSG_RST
986 + MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */
987 +#define MSG_ERRQUEUE MSG_ERRQUEUE
988 + MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
989 +#define MSG_NOSIGNAL MSG_NOSIGNAL
990 + MSG_MORE = 0x8000, /* Sender will send more. */
991 +#define MSG_MORE MSG_MORE
992 +
993 + MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
994 + descriptor received through
995 + SCM_RIGHTS. */
996 +#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
997 + };
998 +
999 +
1000 +/* Structure describing messages sent by
1001 + `sendmsg' and received by `recvmsg'. */
1002 +struct msghdr
1003 + {
1004 + void *msg_name; /* Address to send to/receive from. */
1005 + socklen_t msg_namelen; /* Length of address data. */
1006 +
1007 + struct iovec *msg_iov; /* Vector of data to send/receive into. */
1008 + size_t msg_iovlen; /* Number of elements in the vector. */
1009 +
1010 + void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
1011 + size_t msg_controllen; /* Ancillary data buffer length.
1012 + !! The type should be socklen_t but the
1013 + definition of the kernel is incompatible
1014 + with this. */
1015 +
1016 + int msg_flags; /* Flags on received message. */
1017 + };
1018 +
1019 +/* Structure used for storage of ancillary data object information. */
1020 +struct cmsghdr
1021 + {
1022 + size_t cmsg_len; /* Length of data in cmsg_data plus length
1023 + of cmsghdr structure.
1024 + !! The type should be socklen_t but the
1025 + definition of the kernel is incompatible
1026 + with this. */
1027 + int cmsg_level; /* Originating protocol. */
1028 + int cmsg_type; /* Protocol specific type. */
1029 +#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
1030 + __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
1031 +#endif
1032 + };
1033 +
1034 +/* Ancillary data object manipulation macros. */
1035 +#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
1036 +# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
1037 +#else
1038 +# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
1039 +#endif
1040 +#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
1041 +#define CMSG_FIRSTHDR(mhdr) \
1042 + ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
1043 + ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
1044 +#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
1045 + & (size_t) ~(sizeof (size_t) - 1))
1046 +#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
1047 + + CMSG_ALIGN (sizeof (struct cmsghdr)))
1048 +#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
1049 +
1050 +extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
1051 + struct cmsghdr *__cmsg) __THROW;
1052 +#ifdef __USE_EXTERN_INLINES
1053 +# ifndef _EXTERN_INLINE
1054 +# define _EXTERN_INLINE __extern_inline
1055 +# endif
1056 +_EXTERN_INLINE struct cmsghdr *
1057 +__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
1058 +{
1059 + if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
1060 + /* The kernel header does this so there may be a reason. */
1061 + return 0;
1062 +
1063 + __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
1064 + + CMSG_ALIGN (__cmsg->cmsg_len));
1065 + if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
1066 + + __mhdr->msg_controllen)
1067 + || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
1068 + > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
1069 + /* No more entries. */
1070 + return 0;
1071 + return __cmsg;
1072 +}
1073 +#endif /* Use `extern inline'. */
1074 +
1075 +/* Socket level message types. This must match the definitions in
1076 + <linux/socket.h>. */
1077 +enum
1078 + {
1079 + SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
1080 +#define SCM_RIGHTS SCM_RIGHTS
1081 +#ifdef __USE_GNU
1082 + , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
1083 +# define SCM_CREDENTIALS SCM_CREDENTIALS
1084 +#endif
1085 + };
1086 +
1087 +#ifdef __USE_GNU
1088 +/* User visible structure for SCM_CREDENTIALS message */
1089 +struct ucred
1090 +{
1091 + pid_t pid; /* PID of sending process. */
1092 + uid_t uid; /* UID of sending process. */
1093 + gid_t gid; /* GID of sending process. */
1094 +};
1095 +#endif
1096 +
1097 +/* Ugly workaround for unclean kernel headers. */
1098 +#if !defined __USE_MISC && !defined __USE_GNU
1099 +# ifndef FIOGETOWN
1100 +# define __SYS_SOCKET_H_undef_FIOGETOWN
1101 +# endif
1102 +# ifndef FIOSETOWN
1103 +# define __SYS_SOCKET_H_undef_FIOSETOWN
1104 +# endif
1105 +# ifndef SIOCATMARK
1106 +# define __SYS_SOCKET_H_undef_SIOCATMARK
1107 +# endif
1108 +# ifndef SIOCGPGRP
1109 +# define __SYS_SOCKET_H_undef_SIOCGPGRP
1110 +# endif
1111 +# ifndef SIOCGSTAMP
1112 +# define __SYS_SOCKET_H_undef_SIOCGSTAMP
1113 +# endif
1114 +# ifndef SIOCGSTAMPNS
1115 +# define __SYS_SOCKET_H_undef_SIOCGSTAMPNS
1116 +# endif
1117 +# ifndef SIOCSPGRP
1118 +# define __SYS_SOCKET_H_undef_SIOCSPGRP
1119 +# endif
1120 +#endif
1121 +
1122 +/* Get socket manipulation related informations from kernel headers. */
1123 +#include <asm/socket.h>
1124 +
1125 +#if !defined __USE_MISC && !defined __USE_GNU
1126 +# ifdef __SYS_SOCKET_H_undef_FIOGETOWN
1127 +# undef __SYS_SOCKET_H_undef_FIOGETOWN
1128 +# undef FIOGETOWN
1129 +# endif
1130 +# ifdef __SYS_SOCKET_H_undef_FIOSETOWN
1131 +# undef __SYS_SOCKET_H_undef_FIOSETOWN
1132 +# undef FIOSETOWN
1133 +# endif
1134 +# ifdef __SYS_SOCKET_H_undef_SIOCATMARK
1135 +# undef __SYS_SOCKET_H_undef_SIOCATMARK
1136 +# undef SIOCATMARK
1137 +# endif
1138 +# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP
1139 +# undef __SYS_SOCKET_H_undef_SIOCGPGRP
1140 +# undef SIOCGPGRP
1141 +# endif
1142 +# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP
1143 +# undef __SYS_SOCKET_H_undef_SIOCGSTAMP
1144 +# undef SIOCGSTAMP
1145 +# endif
1146 +# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
1147 +# undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
1148 +# undef SIOCGSTAMPNS
1149 +# endif
1150 +# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP
1151 +# undef __SYS_SOCKET_H_undef_SIOCSPGRP
1152 +# undef SIOCSPGRP
1153 +# endif
1154 +#endif
1155 +
1156 +/* Structure used to manipulate the SO_LINGER option. */
1157 +struct linger
1158 + {
1159 + int l_onoff; /* Nonzero to linger on close. */
1160 + int l_linger; /* Time to linger. */
1161 + };
1162 +
1163 +#endif /* bits/socket.h */
1164 --
1165 1.6.1.3