From 8964681064db9f13ee4ec7f46c53f04d66a04b99 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 14 Nov 2009 08:28:40 -0800 Subject: Fix F_SETOWN_EX and F_GETOWN_EX definitions. --- ChangeLog | 11 +++++++++++ sysdeps/unix/sysv/linux/i386/bits/fcntl.h | 4 ++-- sysdeps/unix/sysv/linux/ia64/bits/fcntl.h | 4 ++-- sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h | 8 ++++---- sysdeps/unix/sysv/linux/s390/bits/fcntl.h | 4 ++-- sysdeps/unix/sysv/linux/sh/bits/fcntl.h | 8 ++++---- sysdeps/unix/sysv/linux/sparc/bits/fcntl.h | 4 ++-- sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h | 8 ++++---- 8 files changed, 31 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 743121f7ad..3b40ecbfe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-11-14 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Update F_SETOWN_EX and + F_GETOWN_EX definitions according to corrected kernel definitions. + * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise. + 2009-11-12 Ulrich Drepper * version.h: Bump for 2.12 development. diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h index 6a38dc03fe..a6db8a86b4 100644 --- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h @@ -92,8 +92,8 @@ #ifdef __USE_GNU # define F_SETSIG 10 /* Set number of signal to be sent. */ # define F_GETSIG 11 /* Get number of signal to be sent. */ -# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */ -# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h index 9a0245a6c4..51c5329ac2 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h @@ -88,8 +88,8 @@ #ifdef __USE_GNU # define F_SETSIG 10 /* Set number of signal to be sent. */ # define F_GETSIG 11 /* Get number of signal to be sent. */ -# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */ -# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h index 6c4b66b7ac..4bdaf7bd04 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h @@ -85,15 +85,15 @@ #define F_SETLKW64 14 /* Set record locking info (blocking). */ #if defined __USE_BSD || defined __USE_UNIX98 -# define F_SETOWN 8 /* Get owner (process receiving of SIGIO). */ -# define F_GETOWN 9 /* Set owner (process receiving of SIGIO). */ +# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */ +# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETSIG 10 /* Set number of signal to be sent. */ # define F_GETSIG 11 /* Get number of signal to be sent. */ -# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */ -# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h index d3dddbc368..0af0f93f1e 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h @@ -107,8 +107,8 @@ #ifdef __USE_GNU # define F_SETSIG 10 /* Set number of signal to be sent. */ # define F_GETSIG 11 /* Get number of signal to be sent. */ -# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */ -# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h index d7a21ea2e2..a6db8a86b4 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h @@ -85,15 +85,15 @@ #define F_SETLKW64 14 /* Set record locking info (blocking). */ #if defined __USE_BSD || defined __USE_UNIX98 -# define F_SETOWN 8 /* Get owner (process receiving of SIGIO). */ -# define F_GETOWN 9 /* Set owner (process receiving of SIGIO). */ +# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */ +# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETSIG 10 /* Set number of signal to be sent. */ # define F_GETSIG 11 /* Get number of signal to be sent. */ -# define F_SETOWN_EX 12 /* Get owner (thread receiving of SIGIO). */ -# define F_GETOWN_EX 13 /* Set owner (thread receiving of SIGIO). */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h index dfa848a377..ad4f48e673 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h @@ -99,8 +99,8 @@ #ifdef __USE_GNU # define F_SETSIG 10 /* Set number of signal to be sent. */ # define F_GETSIG 11 /* Get number of signal to be sent. */ -# define F_GETOWN_EX 12 /* Get owner (thread receiving SIGIO). */ -# define F_SETOWN_EX 13 /* Set owner (thread receiving SIGIO). */ +# define F_SETOWN_EX 15 /* Set owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Get owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h index c3eb859e7d..6e96885d55 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h @@ -99,15 +99,15 @@ #endif #if defined __USE_BSD || defined __USE_UNIX98 -# define F_SETOWN 8 /* Get owner (process receiving of SIGIO). */ -# define F_GETOWN 9 /* Set owner (process receiving of SIGIO). */ +# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */ +# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETSIG 10 /* Set number of signal to be sent. */ # define F_GETSIG 11 /* Get number of signal to be sent. */ -# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */ -# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU -- cgit v1.2.1 From 0079dd2382eba185d22410a1d3088dc7146bc00a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 14 Nov 2009 10:20:25 -0800 Subject: Add support for new Linux error ERFKILL. --- ChangeLog | 8 ++++++++ Versions.def | 1 + manual/errno.texi | 6 ++++++ sysdeps/gnu/errlist.c | 8 ++++++++ sysdeps/unix/sysv/linux/Versions | 4 ++++ sysdeps/unix/sysv/linux/bits/errno.h | 6 +++++- sysdeps/unix/sysv/linux/sparc/bits/errno.h | 6 +++++- 7 files changed, 37 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b40ecbfe1..2939a2a3a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2009-11-14 Ulrich Drepper + [BZ #10939] + * Versions.def: Define GLIBC_2.12 for libc. + * manual/errno.texi: Add ERFKILL entry. + * sysdeps/unix/sysv/linux/Versions: Add new errlist compat entries + for 2.12. + * sysdeps/unix/sysv/linux/bits/errno.h: Define ERFKILL is not done. + * sysdeps/unix/sysv/linux/sparc/bits/errno.h: Likewise. + * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Update F_SETOWN_EX and F_GETOWN_EX definitions according to corrected kernel definitions. * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise. diff --git a/Versions.def b/Versions.def index a8a9cd275e..70de1c14fc 100644 --- a/Versions.def +++ b/Versions.def @@ -28,6 +28,7 @@ libc { GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 + GLIBC_2.12 %ifdef USE_IN_LIBIO HURD_CTHREADS_0.3 %endif diff --git a/manual/errno.texi b/manual/errno.texi index fcba26750e..03a868e457 100644 --- a/manual/errno.texi +++ b/manual/errno.texi @@ -1265,6 +1265,12 @@ They are not yet documented.} @comment errno ???/??? @end deftypevr +@comment errno.h +@comment Linux: Operation not possible due to RF-kill +@deftypevr Macro int ERFKILL +@comment errno ???/??? +@end deftypevr + @node Error Messages, , Error Codes, Error Reporting @section Error Messages diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c index 56da01756d..28a295fc67 100644 --- a/sysdeps/gnu/errlist.c +++ b/sysdeps/gnu/errlist.c @@ -1455,6 +1455,14 @@ TRANS error; @pxref{Cancel AIO Operations}. */ # undef ERR_MAX # define ERR_MAX ENOTRECOVERABLE # endif +#endif +#ifdef ERFKILL +/* */ + [ERR_REMAP (ERFKILL)] = N_("Operation not possible due to RF-kill"), +# if ERFKILL > ERR_MAX +# undef ERR_MAX +# define ERR_MAX ERFKILL +# endif #endif }; diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 2b5f2fb03c..4c9129bed3 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -141,6 +141,10 @@ libc { GLIBC_2.10 { fallocate; } + GLIBC_2.12 { + #errlist-compat 134 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } GLIBC_PRIVATE { # functions used in other libraries __syscall_rt_sigqueueinfo; diff --git a/sysdeps/unix/sysv/linux/bits/errno.h b/sysdeps/unix/sysv/linux/bits/errno.h index 4de8cbba57..1f3d7af7e1 100644 --- a/sysdeps/unix/sysv/linux/bits/errno.h +++ b/sysdeps/unix/sysv/linux/bits/errno.h @@ -1,5 +1,5 @@ /* Error constants. Linux specific version. - Copyright (C) 1996, 1997, 1998, 1999, 2005 Free Software Foundation, Inc. + Copyright (C) 1996-1999, 2005, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,6 +38,10 @@ # define ENOTRECOVERABLE 131 # endif +# ifndef ERFKILL +# define ERFKILL 132 +# endif + # ifndef __ASSEMBLER__ /* Function to get address of global `errno' variable. */ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); diff --git a/sysdeps/unix/sysv/linux/sparc/bits/errno.h b/sysdeps/unix/sysv/linux/sparc/bits/errno.h index 02e200c088..2b9265a1dc 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/errno.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/errno.h @@ -1,5 +1,5 @@ /* Error constants. Linux/Sparc specific version. - Copyright (C) 1996,1997,1998,1999,2002,2005 Free Software Foundation, Inc. + Copyright (C) 1996-1999,2002,2005,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,6 +37,10 @@ # define ENOTRECOVERABLE 133 # endif +# ifndef ERFKILL +# define ERFKILL 134 +# endif + # ifndef __ASSEMBLER__ /* Function to get address of global `errno' variable. */ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); -- cgit v1.2.1 From 5ec794b4b537bc507010af28d2d93bb76d0972ac Mon Sep 17 00:00:00 2001 From: Mike Frsyinger Date: Sat, 14 Nov 2009 19:11:44 -0800 Subject: Add missing stdio.h include. --- ChangeLog | 4 ++++ posix/bug-regex29.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2939a2a3a0..dfd4a725da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-11-06 Mike Frsyinger + + * posix/bug-regex29.c: Include stdio.h. + 2009-11-14 Ulrich Drepper [BZ #10939] diff --git a/posix/bug-regex29.c b/posix/bug-regex29.c index bd796c6c2a..cfc9f99dbc 100644 --- a/posix/bug-regex29.c +++ b/posix/bug-regex29.c @@ -1,4 +1,5 @@ #include +#include static int do_test (void) -- cgit v1.2.1 From f9a7bd536e0b1693db32e1330bbd96108ca63c42 Mon Sep 17 00:00:00 2001 From: Mike Frsyinger Date: Sat, 14 Nov 2009 19:16:01 -0800 Subject: Fix building on x86 with older kernel headers. Fix building on x86 when older linux headers lack __NR_fallocate define. --- sysdeps/unix/sysv/linux/i386/fallocate.c | 6 ++++++ sysdeps/unix/sysv/linux/i386/fallocate64.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sysdeps/unix/sysv/linux/i386/fallocate.c b/sysdeps/unix/sysv/linux/i386/fallocate.c index 7a943e44c0..14e788386c 100644 --- a/sysdeps/unix/sysv/linux/i386/fallocate.c +++ b/sysdeps/unix/sysv/linux/i386/fallocate.c @@ -16,6 +16,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include @@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len) int fallocate (int fd, int mode, __off_t offset, __off_t len) { +#ifdef __NR_fallocate return __call_fallocate (fd, mode, offset, len); +#else + __set_errno (ENOSYS); + return -1; +#endif } diff --git a/sysdeps/unix/sysv/linux/i386/fallocate64.c b/sysdeps/unix/sysv/linux/i386/fallocate64.c index 4998f5e644..85f315c9b6 100644 --- a/sysdeps/unix/sysv/linux/i386/fallocate64.c +++ b/sysdeps/unix/sysv/linux/i386/fallocate64.c @@ -16,6 +16,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include @@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len) int fallocate64 (int fd, int mode, __off64_t offset, __off64_t len) { +#ifdef __NR_fallocate return __call_fallocate (fd, mode, offset, len); +#else + __set_errno (ENOSYS); + return -1; +#endif } -- cgit v1.2.1 From fabe43aba8fb46614eb2a74b2916bfbbf8fec10e Mon Sep 17 00:00:00 2001 From: Mike Frsyinger Date: Sat, 14 Nov 2009 19:16:49 -0800 Subject: Missing CL. --- ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index dfd4a725da..a3c626c2aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-09 Mike Frysinger + + * sysdeps/unix/sysv/linux/i386/fallocate.c: Include errno.h. + (fallocate): Return ENOSYS if __NR_fallocate is not defined. + * sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise. + 2009-11-06 Mike Frsyinger * posix/bug-regex29.c: Include stdio.h. -- cgit v1.2.1 From 65a1148bdd57d02fff9b0b5a2cc2627a5dfd6445 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 14 Nov 2009 19:20:19 -0800 Subject: Use a simple loop on data shorter than software pipeline. When data is shorter than software pipeline, recovery may fail. This patch avoids it by using a simple loop on data shorter than software pipeline. --- ChangeLog | 6 ++++++ sysdeps/ia64/memchr.S | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a3c626c2aa..c3918b74c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-09 H.J. Lu + + [BZ #10162] + * sysdeps/ia64/memchr.S: Use a simple loop on data shorter than + software pipeline. + 2009-11-09 Mike Frysinger * sysdeps/unix/sysv/linux/i386/fallocate.c: Include errno.h. diff --git a/sysdeps/ia64/memchr.S b/sysdeps/ia64/memchr.S index cd062b2dd5..e721e1714f 100644 --- a/sysdeps/ia64/memchr.S +++ b/sysdeps/ia64/memchr.S @@ -71,7 +71,8 @@ ENTRY(__memchr) cmp.ne p7, p0 = r0, r0 // clear p7 extr.u chr = in1, 0, 8 // chr = (unsigned char) in1 mov len = in2 - cmp.gtu p6, p0 = 16, in2 // use a simple loop for short + // use a simple loop on data shorter than software pipeline + cmp.gtu p6, p0 = ((MEMLAT + 1) * 8), in2 (p6) br.cond.spnt .srchfew ;; // searches sub loopcnt = 8, tmp // loopcnt = 8 - tmp cmp.eq p6, p0 = tmp, r0 -- cgit v1.2.1 From 2866eeb1b70c989591293d37ae292e71def16775 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Nov 2009 06:43:39 -0800 Subject: Add missing Linux MADV_* definitions. --- ChangeLog | 14 +++++++++++++- sysdeps/unix/sysv/linux/i386/bits/mman.h | 21 ++++++++++++--------- sysdeps/unix/sysv/linux/ia64/bits/mman.h | 22 +++++++++++++--------- sysdeps/unix/sysv/linux/powerpc/bits/mman.h | 22 +++++++++++++--------- sysdeps/unix/sysv/linux/s390/bits/mman.h | 21 ++++++++++++--------- sysdeps/unix/sysv/linux/sh/bits/mman.h | 22 +++++++++++++--------- sysdeps/unix/sysv/linux/sparc/bits/mman.h | 24 ++++++++++++++---------- sysdeps/unix/sysv/linux/x86_64/bits/mman.h | 21 ++++++++++++--------- 8 files changed, 102 insertions(+), 65 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3918b74c1..26153bdab3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-11-17 Ulrich Drepper + + [BZ #10972] + * sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Add new MADV_* + constants from recent kernels. + * sysdeps/unix/sysv/linux/i386/bits/mman.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise. + * sysdeps/unix/sysv/linux/s390/bits/mman.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/bits/mman.h: Likewise. + * sysdeps/unix/sysv/linux/sh/bits/mman.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/bits/mman.h: Likewise. + 2009-11-09 H.J. Lu [BZ #10162] @@ -10,7 +22,7 @@ (fallocate): Return ENOSYS if __NR_fallocate is not defined. * sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise. -2009-11-06 Mike Frsyinger +2009-11-06 Mike Frysinger * posix/bug-regex29.c: Include stdio.h. diff --git a/sysdeps/unix/sysv/linux/i386/bits/mman.h b/sysdeps/unix/sysv/linux/i386/bits/mman.h index 2b90c8d7d5..22aa401e02 100644 --- a/sysdeps/unix/sysv/linux/i386/bits/mman.h +++ b/sysdeps/unix/sysv/linux/i386/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/i386 version. - Copyright (C) 1997, 2000, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1997,2000,2003,2005,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -84,14 +84,17 @@ /* Advice to `madvise'. */ #ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/sysdeps/unix/sysv/linux/ia64/bits/mman.h b/sysdeps/unix/sysv/linux/ia64/bits/mman.h index a27a30fc0c..1b278c79ee 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/mman.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/mman.h @@ -1,5 +1,6 @@ /* Definitions for POSIX memory map interface. Linux/ia64 version. - Copyright (C) 1997,1998,2000,2003,2005,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1998,2000,2003,2005,2006,2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -84,14 +85,17 @@ /* Advice to `madvise'. */ #ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h index d5729a1f1c..e6580f8220 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h @@ -1,5 +1,6 @@ /* Definitions for POSIX memory map interface. Linux/PowerPC version. - Copyright (C) 1997,2000,2003,2005,2006,2008 Free Software Foundation, Inc. + Copyright (C) 1997,2000,2003,2005,2006,2008,2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -85,14 +86,17 @@ /* Advice to `madvise'. */ #ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/mman.h b/sysdeps/unix/sysv/linux/s390/bits/mman.h index d25531c282..daeafd48ff 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/mman.h +++ b/sysdeps/unix/sysv/linux/s390/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/s390 version. - Copyright (C) 2000,2001,2002,2003,2005,2006 Free Software Foundation, Inc. + Copyright (C) 2000-2003,2005,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -84,14 +84,17 @@ /* Advice to `madvise'. */ #ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/sysdeps/unix/sysv/linux/sh/bits/mman.h b/sysdeps/unix/sysv/linux/sh/bits/mman.h index 7a6b572a4e..aee0011255 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/mman.h +++ b/sysdeps/unix/sysv/linux/sh/bits/mman.h @@ -1,5 +1,6 @@ /* Definitions for POSIX memory map interface. Linux/SH version. - Copyright (C) 1997,1999,2000,2003,2005,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2000,2003,2005,2006,2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -83,14 +84,17 @@ /* Advice to `madvise'. */ #ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/bits/mman.h index be2b7eb280..71a3aa6a30 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/mman.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/mman.h @@ -1,5 +1,6 @@ /* Definitions for POSIX memory map interface. Linux/SPARC version. - Copyright (C) 1997,1999,2000,2003,2005,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2000,2003,2005,2006,2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -85,15 +86,18 @@ /* Advice to `madvise'. */ #ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_FREE 5 /* Content can be freed (Solaris). */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_FREE 5 /* Content can be freed (Solaris). */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h index 7810682536..3dcbf9c317 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/x86_64 version. - Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2005, 2006, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -85,14 +85,17 @@ /* Advice to `madvise'. */ #ifdef __USE_BSD -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ -- cgit v1.2.1 From 4fb9241e4edbe238de8ba251f4448e31e8b1baf4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Nov 2009 09:18:11 -0800 Subject: Fix _NC_LOCALE_NAME definition. --- ChangeLog | 6 ++++++ locale/Makefile | 6 +++--- locale/langinfo.h | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26153bdab3..8dfb46e98c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2009-11-17 Ulrich Drepper + [BZ #10968] + * locale/langinfo.h (_NL_LOCALE_NAME): Correct definition. + Patch by Bruno Haible . + * locale/tst-locname.c: New file. + * locale/Makefile (tests): Add tst-locname. + [BZ #10972] * sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Add new MADV_* constants from recent kernels. diff --git a/locale/Makefile b/locale/Makefile index d9ab1947e7..2d645daa2f 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991,1992,1995-2003,2005 Free Software Foundation, Inc. +# Copyright (C) 1991,1992,1995-2003,2005,2009 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ distribute = localeinfo.h categories.def iso-639.def iso-3166.def \ routines = setlocale findlocale loadlocale loadarchive \ localeconv nl_langinfo nl_langinfo_l mb_cur_max \ newlocale duplocale freelocale uselocale -tests = tst-C-locale +tests = tst-C-locale tst-locname categories = ctype messages monetary numeric time paper name \ address telephone measurement identification collate aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \ @@ -104,7 +104,7 @@ CFLAGS-charmap-dir.c = -Wno-write-strings # This makes sure -DNOT_IN_libc is passed for all these modules. cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \ - $(locale-modules) $(lib-modules)) + $(locale-modules) $(lib-modules)) lib := nonlib include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) diff --git a/locale/langinfo.h b/locale/langinfo.h index c940c743aa..0a53365071 100644 --- a/locale/langinfo.h +++ b/locale/langinfo.h @@ -568,7 +568,8 @@ enum /* This macro produces an item you can pass to `nl_langinfo' or `nl_langinfo_l' to get the name of the locale in use for CATEGORY. */ -#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), -1) +#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), \ + _NL_ITEM_INDEX (-1)) #ifdef __USE_GNU # define NL_LOCALE_NAME(category) _NL_LOCALE_NAME (category) #endif -- cgit v1.2.1 From 7443244740724babd575943ee33c45da326afbe7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Nov 2009 09:37:31 -0800 Subject: Handle LC_GLOBAL_LOCALE in duplocale. --- ChangeLog | 5 +++++ locale/Makefile | 2 +- locale/duplocale.c | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8dfb46e98c..b92fd42c9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-11-17 Ulrich Drepper + [BZ #10969] + * locale/duplocale.c (__duplocale): Handle LC_GLOBAL_LOCALE special. + * locale/tst-duplocale.c: New file. + * locale/Makefile (tests): Add tst-duplocale. + [BZ #10968] * locale/langinfo.h (_NL_LOCALE_NAME): Correct definition. Patch by Bruno Haible . diff --git a/locale/Makefile b/locale/Makefile index 2d645daa2f..2dbd8dc6a5 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -38,7 +38,7 @@ distribute = localeinfo.h categories.def iso-639.def iso-3166.def \ routines = setlocale findlocale loadlocale loadarchive \ localeconv nl_langinfo nl_langinfo_l mb_cur_max \ newlocale duplocale freelocale uselocale -tests = tst-C-locale tst-locname +tests = tst-C-locale tst-locname tst-duplocale categories = ctype messages monetary numeric time paper name \ address telephone measurement identification collate aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \ diff --git a/locale/duplocale.c b/locale/duplocale.c index 61782590d7..63513c539c 100644 --- a/locale/duplocale.c +++ b/locale/duplocale.c @@ -1,5 +1,5 @@ /* Duplicate handle for selection of locales. - Copyright (C) 1997,2000,2001,2002,2005,2008 Free Software Foundation, Inc. + Copyright (C) 1997,2000-2002,2005,2008,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -37,6 +37,10 @@ __duplocale (__locale_t dataset) if (dataset == _nl_C_locobj_ptr) return dataset; + /* Handle a special value. */ + if (dataset == LC_GLOBAL_LOCALE) + dataset = &_nl_global_locale; + __locale_t result; int cnt; size_t names_len = 0; -- cgit v1.2.1 From 815d8147a3418334ffa91e2384c6e159f0809d65 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 17 Nov 2009 16:23:24 -0800 Subject: Fix ranges with multibyte characters as endpoints. This is another bug in computing the fastmap. It was reported by a user of sed because it usually does not happen with !_LIBC. However, it is there in that case too. The bug is that whenever we have a range at the beginning of the regex, the regex must be tested on any possible multibyte character. The reason why _LIBC masks it, is that in general there is a collation symbol for each possible multibyte-character lead byte, so all the lead bytes are in general already part of the fastmap. The tests use cyrillic characters as an example. With _LIBC, they pass without the patch too, but you can make them fail by removing collation symbols handling. --- ChangeLog | 8 ++++ posix/Makefile | 3 +- posix/bug-regex30.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ posix/regcomp.c | 2 +- 4 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 posix/bug-regex30.c diff --git a/ChangeLog b/ChangeLog index b92fd42c9d..0a6ae196a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-11-17 Paolo Bonzini + + * posix/bug-regex30.c: New file. + * posix/Makefile: Add rules to build and run bug-regex30. + * posix/regcomp.c (re_compile_fastmap_iter): Add all multibyte + character lead bytes when there is a range in a COMPLEX_BRACKET. + Reported by Oleg Bylatov. + 2009-11-17 Ulrich Drepper [BZ #10969] diff --git a/posix/Makefile b/posix/Makefile index c9ce18b94e..2a467a8f7b 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -82,7 +82,7 @@ tests := tstgetopt testfnm runtests runptests \ bug-regex17 bug-regex18 bug-regex19 bug-regex20 \ bug-regex21 bug-regex22 bug-regex23 bug-regex24 \ bug-regex25 bug-regex26 bug-regex27 bug-regex28 \ - bug-regex29 \ + bug-regex29 bug-regex30 \ tst-nice tst-nanosleep tst-regex2 \ transbug tst-rxspencer tst-pcre tst-boost \ bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \ @@ -195,6 +195,7 @@ bug-regex22-ENV = LOCPATH=$(common-objpfx)localedata bug-regex23-ENV = LOCPATH=$(common-objpfx)localedata bug-regex25-ENV = LOCPATH=$(common-objpfx)localedata bug-regex26-ENV = LOCPATH=$(common-objpfx)localedata +bug-regex30-ENV = LOCPATH=$(common-objpfx)localedata tst-rxspencer-ARGS = --utf8 rxspencer/tests tst-rxspencer-ENV = LOCPATH=$(common-objpfx)localedata tst-pcre-ARGS = PCRE.tests diff --git a/posix/bug-regex30.c b/posix/bug-regex30.c new file mode 100644 index 0000000000..ef2bd76eba --- /dev/null +++ b/posix/bug-regex30.c @@ -0,0 +1,103 @@ +/* Russian regular expression tests. + Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Paolo Bonzini , 2009. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include +#include +#include +#include + +/* Tests supposed to match. */ +struct +{ + const char *pattern; + const char *string; + int flags, nmatch; + regmatch_t rm[5]; +} tests[] = { + /* U+0413 \xd0\x93 CYRILLIC CAPITAL LETTER GHE + U+0420 \xd0\xa0 CYRILLIC CAPITAL LETTER ER + U+0430 \xd0\xb0 CYRILLIC SMALL LETTER A + U+0433 \xd0\xb3 CYRILLIC SMALL LETTER GHE + U+0440 \xd1\x80 CYRILLIC SMALL LETTER ER + U+044F \xd1\x8f CYRILLIC SMALL LETTER YA */ + { "[\xd0\xb0-\xd1\x8f]", "\xd0\xb3", 0, 1, + { { 0, 2 } } }, + { "[\xd0\xb0-\xd1\x8f]", "\xd0\x93", REG_ICASE, 1, + { { 0, 2 } } }, + { "[\xd1\x80-\xd1\x8f]", "\xd0\xa0", REG_ICASE, 1, + { { 0, 2 } } }, +}; + + +static int +do_test (void) +{ + if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL) + { + puts ("setlocale failed"); + return 1; + } + + int ret = 0; + + for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) + { + regex_t re; + regmatch_t rm[5]; + int n = regcomp (&re, tests[i].pattern, tests[i].flags); + if (n != 0) + { + char buf[500]; + regerror (n, &re, buf, sizeof (buf)); + printf ("regcomp %zd failed: %s\n", i, buf); + ret = 1; + continue; + } + + if (regexec (&re, tests[i].string, tests[i].nmatch, rm, 0)) + { + printf ("regexec %zd failed\n", i); + ret = 1; + regfree (&re); + continue; + } + + for (n = 0; n < tests[i].nmatch; ++n) + if (rm[n].rm_so != tests[i].rm[n].rm_so + || rm[n].rm_eo != tests[i].rm[n].rm_eo) + { + if (tests[i].rm[n].rm_so == -1 && tests[i].rm[n].rm_eo == -1) + break; + printf ("regexec match failure rm[%d] %d..%d\n", + n, rm[n].rm_so, rm[n].rm_eo); + ret = 1; + break; + } + + regfree (&re); + } + + return ret; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/posix/regcomp.c b/posix/regcomp.c index 446fed5445..6966b5da3c 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -377,7 +377,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, applies to multibyte character sets; for single byte character sets, the SIMPLE_BRACKET again suffices. */ if (dfa->mb_cur_max > 1 - && (cset->nchar_classes || cset->non_match + && (cset->nchar_classes || cset->non_match || cset->nranges # ifdef _LIBC || cset->nequiv_classes # endif /* _LIBC */ -- cgit v1.2.1 From 3a00b16da491d5c869795251e1ad4f43b3ba1469 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Nov 2009 16:23:57 -0800 Subject: Add missing test files. --- locale/tst-duplocale.c | 14 ++++++++++++++ locale/tst-locname.c | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 locale/tst-duplocale.c create mode 100644 locale/tst-locname.c diff --git a/locale/tst-duplocale.c b/locale/tst-duplocale.c new file mode 100644 index 0000000000..53e5fbb8fe --- /dev/null +++ b/locale/tst-duplocale.c @@ -0,0 +1,14 @@ +#include +#include + +static int +do_test (void) +{ + locale_t d = duplocale (LC_GLOBAL_LOCALE); + if (d != (locale_t) 0) + freelocale (d); + return 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/locale/tst-locname.c b/locale/tst-locname.c new file mode 100644 index 0000000000..7eb71adfd8 --- /dev/null +++ b/locale/tst-locname.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +static int +do_test (void) +{ + const char *s = nl_langinfo (_NL_LOCALE_NAME (LC_CTYPE)); + if (s == NULL || strcmp (s, "C") != 0) + { + printf ("incorrect locale name returned: %s, expected \"C\"\n", s); + return 1; + } + + return 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" -- cgit v1.2.1 From 3933378fd3cbe49c1e0ca42844f959eb12f05f60 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Nov 2009 16:24:26 -0800 Subject: Whitespace fixes. --- posix/bug-regex30.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posix/bug-regex30.c b/posix/bug-regex30.c index ef2bd76eba..43df64d9d3 100644 --- a/posix/bug-regex30.c +++ b/posix/bug-regex30.c @@ -34,7 +34,7 @@ struct regmatch_t rm[5]; } tests[] = { /* U+0413 \xd0\x93 CYRILLIC CAPITAL LETTER GHE - U+0420 \xd0\xa0 CYRILLIC CAPITAL LETTER ER + U+0420 \xd0\xa0 CYRILLIC CAPITAL LETTER ER U+0430 \xd0\xb0 CYRILLIC SMALL LETTER A U+0433 \xd0\xb3 CYRILLIC SMALL LETTER GHE U+0440 \xd1\x80 CYRILLIC SMALL LETTER ER @@ -83,7 +83,7 @@ do_test (void) for (n = 0; n < tests[i].nmatch; ++n) if (rm[n].rm_so != tests[i].rm[n].rm_so - || rm[n].rm_eo != tests[i].rm[n].rm_eo) + || rm[n].rm_eo != tests[i].rm[n].rm_eo) { if (tests[i].rm[n].rm_so == -1 && tests[i].rm[n].rm_eo == -1) break; -- cgit v1.2.1 From f8c10bb45b7639ec7b6bb500a9e69b1e29d5e6f6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Nov 2009 17:59:33 -0800 Subject: Use cfi directives in x86 pthread_cond_{,timed}wait. --- nptl/ChangeLog | 7 + .../sysv/linux/i386/i486/pthread_cond_timedwait.S | 254 ++++++--------------- .../unix/sysv/linux/i386/i486/pthread_cond_wait.S | 223 +++++------------- 3 files changed, 140 insertions(+), 344 deletions(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 0aaaa3f7b9..ae345a3574 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,10 @@ +2009-11-17 Ulrich Drepper + + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use + cfi directives. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise. + Based on a patch by Dinakar Guniguntala . + 2009-11-03 Andreas Schwab [BZ #4457] diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S index 83f8db25bb..8f5088a460 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002-2004, 2006-2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -34,14 +34,29 @@ .align 16 __pthread_cond_timedwait: .LSTARTCODE: + cfi_startproc +#ifdef SHARED + cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect, + DW.ref.__gcc_personality_v0) + cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART) +#else + cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0) + cfi_lsda(DW_EH_PE_udata4, .LexceptSTART) +#endif + pushl %ebp -.Lpush_ebp: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%ebp, 0) pushl %edi -.Lpush_edi: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%edi, 0) pushl %esi -.Lpush_esi: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%esi, 0) pushl %ebx -.Lpush_ebx: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%ebx, 0) + cfi_remember_state movl 20(%esp), %ebx movl 28(%esp), %ebp @@ -82,7 +97,7 @@ __pthread_cond_timedwait: #define FRAME_SIZE 24 subl $FRAME_SIZE, %esp -.Lsubl: + cfi_adjust_cfa_offset(FRAME_SIZE) /* Get and store current wakeup_seq value. */ movl wakeup_seq(%ebx), %edi @@ -273,7 +288,7 @@ __pthread_cond_timedwait: 11: movl 24+FRAME_SIZE(%esp), %eax call __pthread_mutex_cond_lock addl $FRAME_SIZE, %esp -.Laddl: + cfi_adjust_cfa_offset(-FRAME_SIZE); /* We return the result of the mutex_lock operation if it failed. */ testl %eax, %eax @@ -286,19 +301,24 @@ __pthread_cond_timedwait: #endif 18: popl %ebx -.Lpop_ebx: + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) popl %esi -.Lpop_esi: + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) popl %edi -.Lpop_edi: + cfi_adjust_cfa_offset(-4) + cfi_restore(%edi) popl %ebp -.Lpop_ebp: + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebp) ret + cfi_restore_state + /* Initial locking failed. */ 1: -.LSbl1: #if cond_lock == 0 movl %ebx, %edx #else @@ -317,9 +337,17 @@ __pthread_cond_timedwait: call __lll_lock_wait jmp 2b - /* Unlock in loop requires wakeup. */ -3: -.LSbl2: + /* The initial unlocking of the mutex failed. */ +16: + LOCK +#if cond_lock == 0 + subl $1, (%ebx) +#else + subl $1, cond_lock(%ebx) +#endif + jne 18b + + movl %eax, %esi #if cond_lock == 0 movl %ebx, %eax #else @@ -336,14 +364,18 @@ __pthread_cond_timedwait: addl $LLL_PRIVATE, %ecx #endif call __lll_unlock_wake - jmp 4b - /* Locking in loop failed. */ -5: + movl %esi, %eax + jmp 18b + + cfi_adjust_cfa_offset(FRAME_SIZE) + + /* Unlock in loop requires wakeup. */ +3: #if cond_lock == 0 - movl %ebx, %edx + movl %ebx, %eax #else - leal cond_lock(%ebx), %edx + leal cond_lock(%ebx), %eax #endif #if (LLL_SHARED-LLL_PRIVATE) > 255 xorl %ecx, %ecx @@ -355,15 +387,15 @@ __pthread_cond_timedwait: #if LLL_PRIVATE != 0 addl $LLL_PRIVATE, %ecx #endif - call __lll_lock_wait - jmp 6b + call __lll_unlock_wake + jmp 4b - /* Unlock after loop requires wakeup. */ -10: + /* Locking in loop failed. */ +5: #if cond_lock == 0 - movl %ebx, %eax + movl %ebx, %edx #else - leal cond_lock(%ebx), %eax + leal cond_lock(%ebx), %edx #endif #if (LLL_SHARED-LLL_PRIVATE) > 255 xorl %ecx, %ecx @@ -375,21 +407,11 @@ __pthread_cond_timedwait: #if LLL_PRIVATE != 0 addl $LLL_PRIVATE, %ecx #endif - call __lll_unlock_wake - jmp 11b - - /* The initial unlocking of the mutex failed. */ -16: -.LSbl3: - LOCK -#if cond_lock == 0 - subl $1, (%ebx) -#else - subl $1, cond_lock(%ebx) -#endif - jne 18b + call __lll_lock_wait + jmp 6b - movl %eax, %esi + /* Unlock after loop requires wakeup. */ +10: #if cond_lock == 0 movl %ebx, %eax #else @@ -406,13 +428,10 @@ __pthread_cond_timedwait: addl $LLL_PRIVATE, %ecx #endif call __lll_unlock_wake - - movl %esi, %eax - jmp 18b + jmp 11b #if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS /* clock_gettime not available. */ -.LSbl4: 19: leal 4(%esp), %ebx xorl %ecx, %ecx movl $__NR_gettimeofday, %eax @@ -443,7 +462,6 @@ versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait, .type __condvar_tw_cleanup2, @function __condvar_tw_cleanup2: subl $cond_futex, %ebx -.LSbl5: .size __condvar_tw_cleanup2, .-__condvar_tw_cleanup2 .type __condvar_tw_cleanup, @function __condvar_tw_cleanup: @@ -583,14 +601,15 @@ __condvar_tw_cleanup: call _Unwind_Resume hlt .LENDCODE: + cfi_endproc .size __condvar_tw_cleanup, .-__condvar_tw_cleanup .section .gcc_except_table,"a",@progbits .LexceptSTART: - .byte 0xff # @LPStart format (omit) - .byte 0xff # @TType format (omit) - .byte 0x0b # call-site format + .byte DW_EH_PE_omit # @LPStart format (omit) + .byte DW_EH_PE_omit # @TType format (omit) + .byte DW_EH_PE_sdata4 # call-site format # DW_EH_PE_sdata4 .uleb128 .Lcstend-.Lcstbegin .Lcstbegin: @@ -613,144 +632,13 @@ __condvar_tw_cleanup: .Lcstend: - .section .eh_frame,"a",@progbits -.LSTARTFRAME: - .long L(ENDCIE)-L(STARTCIE) # Length of the CIE. -.LSTARTCIE: - .long 0 # CIE ID. - .byte 1 # Version number. -#ifdef SHARED - .string "zPLR" # NUL-terminated augmentation - # string. -#else - .string "zPL" # NUL-terminated augmentation - # string. -#endif - .uleb128 1 # Code alignment factor. - .sleb128 -4 # Data alignment factor. - .byte 8 # Return address register - # column. -#ifdef SHARED - .uleb128 7 # Augmentation value length. - .byte 0x9b # Personality: DW_EH_PE_pcrel - # + DW_EH_PE_sdata4 - # + DW_EH_PE_indirect - .long DW.ref.__gcc_personality_v0-. - .byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel - # + DW_EH_PE_sdata4. - .byte 0x1b # FDE Encoding: DW_EH_PE_pcrel - # + DW_EH_PE_sdata4. -#else - .uleb128 6 # Augmentation value length. - .byte 0x0 # Personality: absolute - .long __gcc_personality_v0 - .byte 0x0 # LSDA Encoding: absolute -#endif - .byte 0x0c # DW_CFA_def_cfa - .uleb128 4 - .uleb128 4 - .byte 0x88 # DW_CFA_offset, column 0x8 - .uleb128 1 - .align 4 -.LENDCIE: - - .long .LENDFDE-.LSTARTFDE # Length of the FDE. -.LSTARTFDE: - .long .LSTARTFDE-.LSTARTFRAME # CIE pointer. -#ifdef SHARED - .long .LSTARTCODE-. # PC-relative start address - # of the code -#else - .long .LSTARTCODE # Start address of the code. -#endif - .long .LENDCODE-.LSTARTCODE # Length of the code. - .uleb128 4 # Augmentation size -#ifdef SHARED - .long .LexceptSTART-. -#else - .long .LexceptSTART -#endif - .byte 0x40+.Lpush_ebp-.LSTARTCODE # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 8 - .byte 0x85 # DW_CFA_offset %ebp - .uleb128 2 - .byte 0x40+ .Lpush_edi-.Lpush_ebp # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 12 - .byte 0x87 # DW_CFA_offset %edi - .uleb128 3 - .byte 0x40+.Lpush_esi-.Lpush_edi # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 16 - .byte 0x86 # DW_CFA_offset %esi - .uleb128 4 - .byte 0x40+.Lpush_ebx-.Lpush_esi # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 20 - .byte 0x83 # DW_CFA_offset %ebx - .uleb128 5 - .byte 4 # DW_CFA_advance_loc4 - .4byte .Lsubl-.Lpush_ebx - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 20+FRAME_SIZE - .byte 4 # DW_CFA_advance_loc4 - .4byte .Laddl-.Lsubl - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 20 - .byte 0x40+.Lpop_ebx-.Laddl # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 16 - .byte 0xc3 # DW_CFA_restore %ebx - .byte 0x40+.Lpop_esi-.Lpop_ebx # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 12 - .byte 0xc6 # DW_CFA_restore %esi - .byte 0x40+.Lpop_edi-.Lpop_esi # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 8 - .byte 0xc7 # DW_CFA_restore %edi - .byte 0x40+.Lpop_ebp-.Lpop_edi # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 4 - .byte 0xc5 # DW_CFA_restore %ebp - .byte 0x40+.LSbl1-.Lpop_edi # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 20 - .byte 4 # DW_CFA_advance_loc4 - .4byte .LSbl2-.LSbl1 - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 20+FRAME_SIZE - .byte 0x85 # DW_CFA_offset %ebp - .uleb128 2 - .byte 0x87 # DW_CFA_offset %edi - .uleb128 3 - .byte 0x86 # DW_CFA_offset %esi - .uleb128 4 - .byte 0x83 # DW_CFA_offset %ebx - .uleb128 5 - .byte 4 # DW_CFA_advance_loc4 - .4byte .LSbl3-.LSbl2 - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 20 - .byte 4 # DW_CFA_advance_loc4 -#if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS - .4byte .LSbl4-.LSbl3 -#else - .4byte .LSbl5-.LSbl3 -#endif - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 20+FRAME_SIZE - .align 4 -.LENDFDE: - #ifdef SHARED .hidden DW.ref.__gcc_personality_v0 - .weak DW.ref.__gcc_personality_v0 + .weak DW.ref.__gcc_personality_v0 .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits - .align 4 - .type DW.ref.__gcc_personality_v0, @object - .size DW.ref.__gcc_personality_v0, 4 + .align 4 + .type DW.ref.__gcc_personality_v0, @object + .size DW.ref.__gcc_personality_v0, 4 DW.ref.__gcc_personality_v0: .long __gcc_personality_v0 #endif diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S index 5b301979b5..776b95e40c 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002-2004, 2006-2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -33,13 +33,26 @@ .align 16 __pthread_cond_wait: .LSTARTCODE: + cfi_startproc +#ifdef SHARED + cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect, + DW.ref.__gcc_personality_v0) + cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART) +#else + cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0) + cfi_lsda(DW_EH_PE_udata4, .LexceptSTART) +#endif pushl %edi -.Lpush_edi: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%edi, 0) pushl %esi -.Lpush_esi: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%esi, 0) pushl %ebx -.Lpush_ebx: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%ebx, 0) + cfi_remember_state xorl %esi, %esi movl 16(%esp), %ebx @@ -76,7 +89,7 @@ __pthread_cond_wait: #define FRAME_SIZE 16 subl $FRAME_SIZE, %esp -.Lsubl: + cfi_adjust_cfa_offset(FRAME_SIZE) /* Get and store current wakeup_seq value. */ movl wakeup_seq(%ebx), %edi @@ -202,21 +215,25 @@ __pthread_cond_wait: 11: movl 20+FRAME_SIZE(%esp), %eax call __pthread_mutex_cond_lock addl $FRAME_SIZE, %esp -.Laddl: + cfi_adjust_cfa_offset(-FRAME_SIZE); 14: popl %ebx -.Lpop_ebx: + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) popl %esi -.Lpop_esi: + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) popl %edi -.Lpop_edi: + cfi_adjust_cfa_offset(-4) + cfi_restore(%edi) /* We return the result of the mutex_lock operation. */ ret + cfi_restore_state + /* Initial locking failed. */ 1: -.LSbl1: #if cond_lock == 0 movl %ebx, %edx #else @@ -235,9 +252,17 @@ __pthread_cond_wait: call __lll_lock_wait jmp 2b - /* Unlock in loop requires waekup. */ -3: -.LSbl2: + /* The initial unlocking of the mutex failed. */ +12: + LOCK +#if cond_lock == 0 + subl $1, (%ebx) +#else + subl $1, cond_lock(%ebx) +#endif + jne 14b + + movl %eax, %esi #if cond_lock == 0 movl %ebx, %eax #else @@ -254,14 +279,18 @@ __pthread_cond_wait: addl $LLL_PRIVATE, %ecx #endif call __lll_unlock_wake - jmp 4b - /* Locking in loop failed. */ -5: + movl %esi, %eax + jmp 14b + + cfi_adjust_cfa_offset(FRAME_SIZE) + + /* Unlock in loop requires wakeup. */ +3: #if cond_lock == 0 - movl %ebx, %edx + movl %ebx, %eax #else - leal cond_lock(%ebx), %edx + leal cond_lock(%ebx), %eax #endif #if (LLL_SHARED-LLL_PRIVATE) > 255 xorl %ecx, %ecx @@ -273,15 +302,15 @@ __pthread_cond_wait: #if LLL_PRIVATE != 0 addl $LLL_PRIVATE, %ecx #endif - call __lll_lock_wait - jmp 6b + call __lll_unlock_wake + jmp 4b - /* Unlock after loop requires wakeup. */ -10: + /* Locking in loop failed. */ +5: #if cond_lock == 0 - movl %ebx, %eax + movl %ebx, %edx #else - leal cond_lock(%ebx), %eax + leal cond_lock(%ebx), %edx #endif #if (LLL_SHARED-LLL_PRIVATE) > 255 xorl %ecx, %ecx @@ -293,21 +322,11 @@ __pthread_cond_wait: #if LLL_PRIVATE != 0 addl $LLL_PRIVATE, %ecx #endif - call __lll_unlock_wake - jmp 11b - - /* The initial unlocking of the mutex failed. */ -12: -.LSbl3: - LOCK -#if cond_lock == 0 - subl $1, (%ebx) -#else - subl $1, cond_lock(%ebx) -#endif - jne 14b + call __lll_lock_wait + jmp 6b - movl %eax, %esi + /* Unlock after loop requires wakeup. */ +10: #if cond_lock == 0 movl %ebx, %eax #else @@ -324,9 +343,7 @@ __pthread_cond_wait: addl $LLL_PRIVATE, %ecx #endif call __lll_unlock_wake - - movl %esi, %eax - jmp 14b + jmp 11b .size __pthread_cond_wait, .-__pthread_cond_wait versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait, GLIBC_2_3_2) @@ -475,14 +492,15 @@ __condvar_w_cleanup: call _Unwind_Resume hlt .LENDCODE: + cfi_endproc .size __condvar_w_cleanup, .-__condvar_w_cleanup .section .gcc_except_table,"a",@progbits .LexceptSTART: - .byte 0xff # @LPStart format (omit) - .byte 0xff # @TType format (omit) - .byte 0x0b # call-site format + .byte DW_EH_PE_omit # @LPStart format (omit) + .byte DW_EH_PE_omit # @TType format (omit) + .byte DW_EH_PE_sdata4 # call-site format # DW_EH_PE_sdata4 .uleb128 .Lcstend-.Lcstbegin .Lcstbegin: @@ -504,123 +522,6 @@ __condvar_w_cleanup: .uleb128 0 .Lcstend: - .section .eh_frame,"a",@progbits -.LSTARTFRAME: - .long L(ENDCIE)-L(STARTCIE) # Length of the CIE. -.LSTARTCIE: - .long 0 # CIE ID. - .byte 1 # Version number. -#ifdef SHARED - .string "zPLR" # NUL-terminated augmentation - # string. -#else - .string "zPL" # NUL-terminated augmentation - # string. -#endif - .uleb128 1 # Code alignment factor. - .sleb128 -4 # Data alignment factor. - .byte 8 # Return address register - # column. -#ifdef SHARED - .uleb128 7 # Augmentation value length. - .byte 0x9b # Personality: DW_EH_PE_pcrel - # + DW_EH_PE_sdata4 - # + DW_EH_PE_indirect - .long DW.ref.__gcc_personality_v0-. - .byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel - # + DW_EH_PE_sdata4. - .byte 0x1b # FDE Encoding: DW_EH_PE_pcrel - # + DW_EH_PE_sdata4. -#else - .uleb128 6 # Augmentation value length. - .byte 0x0 # Personality: absolute - .long __gcc_personality_v0 - .byte 0x0 # LSDA Encoding: absolute -#endif - .byte 0x0c # DW_CFA_def_cfa - .uleb128 4 - .uleb128 4 - .byte 0x88 # DW_CFA_offset, column 0x8 - .uleb128 1 - .align 4 -.LENDCIE: - - .long .LENDFDE-.LSTARTFDE # Length of the FDE. -.LSTARTFDE: - .long .LSTARTFDE-.LSTARTFRAME # CIE pointer. -#ifdef SHARED - .long .LSTARTCODE-. # PC-relative start address - # of the code. -#else - .long .LSTARTCODE # Start address of the code. -#endif - .long .LENDCODE-.LSTARTCODE # Length of the code. - .uleb128 4 # Augmentation size -#ifdef SHARED - .long .LexceptSTART-. -#else - .long .LexceptSTART -#endif - .byte 0x40+.Lpush_edi-.LSTARTCODE # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 8 - .byte 0x87 # DW_CFA_offset %edi - .uleb128 2 - .byte 0x40+.Lpush_esi-.Lpush_edi # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 12 - .byte 0x86 # DW_CFA_offset %esi - .uleb128 3 - .byte 0x40+.Lpush_ebx-.Lpush_esi # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 16 - .byte 0x83 # DW_CFA_offset %ebx - .uleb128 4 - .byte 4 # DW_CFA_advance_loc4 - .4byte .Lsubl-.Lpush_ebx - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 16+FRAME_SIZE - .byte 4 # DW_CFA_advance_loc4 - .4byte .Laddl-.Lsubl - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 16 - .byte 0x40+ .Lpop_ebx-.Laddl # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 12 - .byte 0xc3 # DW_CFA_restore %ebx - .byte 0x40+.Lpop_esi-.Lpop_ebx # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 8 - .byte 0xc6 # DW_CFA_restore %esi - .byte 0x40+.Lpop_edi-.Lpop_esi # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 4 - .byte 0xc7 # DW_CFA_restore %edi - .byte 0x40+.LSbl1-.Lpop_edi # DW_CFA_advance_loc+N - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 16 - .byte 0x87 # DW_CFA_offset %edi - .uleb128 2 - .byte 0x86 # DW_CFA_offset %esi - .uleb128 3 - .byte 0x83 # DW_CFA_offset %ebx - .uleb128 4 - .byte 4 # DW_CFA_advance_loc4 - .4byte .LSbl2-.LSbl1 - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 16+FRAME_SIZE - .byte 4 # DW_CFA_advance_loc4 - .4byte .LSbl3-.LSbl2 - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 16 - .byte 4 # DW_CFA_advance_loc4 - .4byte .LSbl4-.LSbl3 - .byte 14 # DW_CFA_def_cfa_offset - .uleb128 16+FRAME_SIZE - .align 4 -.LENDFDE: - - #ifdef PIC .section .gnu.linkonce.t.__i686.get_pc_thunk.cx,"ax",@progbits .globl __i686.get_pc_thunk.cx -- cgit v1.2.1 From 8ad81b316bc158746aee18aa7d7df44d3eb61871 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 17 Nov 2009 18:04:51 -0800 Subject: Fix sync_file_range on ppc/ppc64. I've noticed that sync_file_range is a stub on ppc/ppc64. The kernel on these arches provides sync_file_range2 syscall with swapped parameters. The following completely untested patch ought to fix this. --- ChangeLog | 8 ++++ .../sysv/linux/powerpc/powerpc64/sync_file_range.c | 44 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/sync_file_range.c | 10 ++++- 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c diff --git a/ChangeLog b/ChangeLog index 0a6ae196a8..fd62431501 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-11-16 Jakub Jelinek + + * sysdeps/unix/sysv/linux/sync_file_range.c (sync_file_range): + Implement using sync_file_range2 syscall if __NR_sync_file_range2 + is defined. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c: New + file. + 2009-11-17 Paolo Bonzini * posix/bug-regex30.c: New file. diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c new file mode 100644 index 0000000000..1ca4ce66df --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c @@ -0,0 +1,44 @@ +/* Selective file content synch'ing. + Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +#include +#include + + +#if defined __NR_sync_file_range2 +int +sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) +{ + return INLINE_SYSCALL (sync_file_range2, 4, fd, flags, from, to); +} +#else +int +sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (sync_file_range) + +# include +#endif diff --git a/sysdeps/unix/sysv/linux/sync_file_range.c b/sysdeps/unix/sysv/linux/sync_file_range.c index 4e267a1602..41e08e0281 100644 --- a/sysdeps/unix/sysv/linux/sync_file_range.c +++ b/sysdeps/unix/sysv/linux/sync_file_range.c @@ -1,5 +1,5 @@ /* Selective file content synch'ing. - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -34,6 +34,14 @@ sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) __LONG_LONG_PAIR ((long) (to >> 32), (long) to), flags); } +#elif defined __NR_sync_file_range2 +int +sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) +{ + return INLINE_SYSCALL (sync_file_range2, 6, fd, flags, + __LONG_LONG_PAIR ((long) (from >> 32), (long) from), + __LONG_LONG_PAIR ((long) (to >> 32), (long) to)); +} #else int sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) -- cgit v1.2.1 From 424bea69fb3bcad456162da4a87ff6b558baaa8a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Nov 2009 18:10:56 -0800 Subject: Change misleading names of parameters of sync_file_range. --- ChangeLog | 11 +++++++++++ sysdeps/unix/sysv/linux/i386/bits/fcntl.h | 2 +- sysdeps/unix/sysv/linux/ia64/bits/fcntl.h | 2 +- sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h | 2 +- sysdeps/unix/sysv/linux/s390/bits/fcntl.h | 2 +- sysdeps/unix/sysv/linux/sh/bits/fcntl.h | 2 +- sysdeps/unix/sysv/linux/sparc/bits/fcntl.h | 2 +- sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h | 2 +- 8 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd62431501..03c0cab7a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-11-17 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Change misleading names + of parameters of sync_file_range. + * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise. + 2009-11-16 Jakub Jelinek * sysdeps/unix/sysv/linux/sync_file_range.c (sync_file_range): diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h index a6db8a86b4..ad2d51b4cb 100644 --- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h @@ -237,7 +237,7 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) /* Selective file content synch'ing. */ -extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h index 51c5329ac2..38da8a8f1d 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h @@ -231,7 +231,7 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) /* Selective file content synch'ing. */ -extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h index 4bdaf7bd04..638b687ac9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h @@ -237,7 +237,7 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) /* Selective file content synch'ing. */ -extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h index 0af0f93f1e..a962439456 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h @@ -257,7 +257,7 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) /* Selective file content synch'ing. */ -extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h index a6db8a86b4..ad2d51b4cb 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h @@ -237,7 +237,7 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) /* Selective file content synch'ing. */ -extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h index ad4f48e673..519b4f235d 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h @@ -256,7 +256,7 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) /* Selective file content synch'ing. */ -extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h index 6e96885d55..1f8385816b 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h @@ -251,7 +251,7 @@ extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) /* Selective file content synch'ing. */ -extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); -- cgit v1.2.1 From b5f2ab824cb53a1bf6cf434f5a960be40f3ba63a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Nov 2009 22:55:55 -0800 Subject: Minial unwind section size reduction. --- nptl/ChangeLog | 3 +++ .../sysv/linux/x86_64/pthread_cond_timedwait.S | 31 ++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index ae345a3574..4f04c97e8f 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,5 +1,8 @@ 2009-11-17 Ulrich Drepper + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally + reduce size of unwind info. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use cfi directives. * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise. diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S index 86bdac1b1b..be14fc897e 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S @@ -69,6 +69,7 @@ __pthread_cond_timedwait: #endif subq $FRAME_SIZE, %rsp cfi_adjust_cfa_offset(FRAME_SIZE) + cfi_remember_state cmpq $1000000000, 8(%rdx) movl $EINVAL, %eax @@ -77,19 +78,19 @@ __pthread_cond_timedwait: /* Stack frame: rsp + 48 - +--------------------------+ + +--------------------------+ rsp + 32 | timeout value | - +--------------------------+ + +--------------------------+ rsp + 24 | old wake_seq value | - +--------------------------+ + +--------------------------+ rsp + 16 | mutex pointer | - +--------------------------+ + +--------------------------+ rsp + 8 | condvar pointer | - +--------------------------+ + +--------------------------+ rsp + 4 | old broadcast_seq value | - +--------------------------+ + +--------------------------+ rsp + 0 | old cancellation mode | - +--------------------------+ + +--------------------------+ */ cmpq $-1, dep_mutex(%rdi) @@ -317,11 +318,7 @@ __pthread_cond_timedwait: retq - cfi_adjust_cfa_offset(4 * 8 + FRAME_SIZE) - cfi_rel_offset(%r12, FRAME_SIZE + 24) - cfi_rel_offset(%r13, FRAME_SIZE + 16) - cfi_rel_offset(%r14, FRAME_SIZE + 8) - cfi_rel_offset(%r15, FRAME_SIZE) + cfi_restore_state 64: callq __pthread_mutex_cond_lock_adjust movq %r14, %rax @@ -650,15 +647,15 @@ __condvar_cleanup2: rsp + 48 | %r14 | +--------------------------+ rsp + 24 | unused | - +--------------------------+ + +--------------------------+ rsp + 16 | mutex pointer | - +--------------------------+ + +--------------------------+ rsp + 8 | condvar pointer | - +--------------------------+ + +--------------------------+ rsp + 4 | old broadcast_seq value | - +--------------------------+ + +--------------------------+ rsp + 0 | old cancellation mode | - +--------------------------+ + +--------------------------+ */ movq %rax, 24(%rsp) -- cgit v1.2.1 From 62616842ec4bec156ae8d75a345f7a553cb3c277 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Nov 2009 22:55:55 -0800 Subject: Minimal unwind section size reduction. --- nptl/ChangeLog | 3 +++ .../sysv/linux/x86_64/pthread_cond_timedwait.S | 31 ++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index ae345a3574..4f04c97e8f 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,5 +1,8 @@ 2009-11-17 Ulrich Drepper + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally + reduce size of unwind info. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use cfi directives. * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise. diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S index 86bdac1b1b..be14fc897e 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S @@ -69,6 +69,7 @@ __pthread_cond_timedwait: #endif subq $FRAME_SIZE, %rsp cfi_adjust_cfa_offset(FRAME_SIZE) + cfi_remember_state cmpq $1000000000, 8(%rdx) movl $EINVAL, %eax @@ -77,19 +78,19 @@ __pthread_cond_timedwait: /* Stack frame: rsp + 48 - +--------------------------+ + +--------------------------+ rsp + 32 | timeout value | - +--------------------------+ + +--------------------------+ rsp + 24 | old wake_seq value | - +--------------------------+ + +--------------------------+ rsp + 16 | mutex pointer | - +--------------------------+ + +--------------------------+ rsp + 8 | condvar pointer | - +--------------------------+ + +--------------------------+ rsp + 4 | old broadcast_seq value | - +--------------------------+ + +--------------------------+ rsp + 0 | old cancellation mode | - +--------------------------+ + +--------------------------+ */ cmpq $-1, dep_mutex(%rdi) @@ -317,11 +318,7 @@ __pthread_cond_timedwait: retq - cfi_adjust_cfa_offset(4 * 8 + FRAME_SIZE) - cfi_rel_offset(%r12, FRAME_SIZE + 24) - cfi_rel_offset(%r13, FRAME_SIZE + 16) - cfi_rel_offset(%r14, FRAME_SIZE + 8) - cfi_rel_offset(%r15, FRAME_SIZE) + cfi_restore_state 64: callq __pthread_mutex_cond_lock_adjust movq %r14, %rax @@ -650,15 +647,15 @@ __condvar_cleanup2: rsp + 48 | %r14 | +--------------------------+ rsp + 24 | unused | - +--------------------------+ + +--------------------------+ rsp + 16 | mutex pointer | - +--------------------------+ + +--------------------------+ rsp + 8 | condvar pointer | - +--------------------------+ + +--------------------------+ rsp + 4 | old broadcast_seq value | - +--------------------------+ + +--------------------------+ rsp + 0 | old cancellation mode | - +--------------------------+ + +--------------------------+ */ movq %rax, 24(%rsp) -- cgit v1.2.1 From dd7106b3c68328f7d4b3794e989e86cb0b0d6461 Mon Sep 17 00:00:00 2001 From: Dinakar Guniguntala Date: Wed, 18 Nov 2009 06:33:23 -0800 Subject: Update cfi offsets for pthread_cond_broadcast and signal fir x86. --- nptl/ChangeLog | 7 ++++ .../sysv/linux/i386/i486/pthread_cond_broadcast.S | 41 ++++++---------------- .../sysv/linux/i386/i486/pthread_cond_signal.S | 13 ++++--- 3 files changed, 23 insertions(+), 38 deletions(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 4f04c97e8f..1991a4d5d5 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,10 @@ +2009-11-18 Dinakar Guniguntala + + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: + Remove redundant code. Fix cfi offsets. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: + Fix cfi offsets. + 2009-11-17 Ulrich Drepper * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S index f46b4b874a..1a55e522d3 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S @@ -35,16 +35,17 @@ __pthread_cond_broadcast: cfi_startproc pushl %ebx cfi_adjust_cfa_offset(4) + cfi_rel_offset(%ebx, 0) pushl %esi cfi_adjust_cfa_offset(4) + cfi_rel_offset(%esi, 0) pushl %edi cfi_adjust_cfa_offset(4) + cfi_rel_offset(%edi, 0) pushl %ebp cfi_adjust_cfa_offset(4) - cfi_offset(%ebx, -8) - cfi_offset(%esi, -12) - cfi_offset(%edi, -16) - cfi_offset(%ebp, -20) + cfi_rel_offset(%ebp, 0) + cfi_remember_state movl 20(%esp), %ebx @@ -120,7 +121,7 @@ __pthread_cond_broadcast: cmpl $0xfffff001, %eax jae 9f -10: xorl %eax, %eax +6: xorl %eax, %eax popl %ebp cfi_adjust_cfa_offset(-4) cfi_restore(%ebp) @@ -135,37 +136,15 @@ __pthread_cond_broadcast: cfi_restore(%ebx) ret - cfi_adjust_cfa_offset(16) - cfi_offset(%ebx, -8) - cfi_offset(%esi, -12) - cfi_offset(%edi, -16) - cfi_offset(%ebp, -20) + cfi_restore_state + .align 16 /* Unlock. */ 4: LOCK subl $1, cond_lock-cond_futex(%ebx) jne 5f + jmp 6b -6: xorl %eax, %eax - popl %ebp - cfi_adjust_cfa_offset(-4) - cfi_restore(%ebp) - popl %edi - cfi_adjust_cfa_offset(-4) - cfi_restore(%edi) - popl %esi - cfi_adjust_cfa_offset(-4) - cfi_restore(%esi) - popl %ebx - cfi_adjust_cfa_offset(-4) - cfi_restore(%ebx) - ret - - cfi_adjust_cfa_offset(16) - cfi_offset(%ebx, -8) - cfi_offset(%esi, -12) - cfi_offset(%edi, -16) - cfi_offset(%ebp, -20) /* Initial locking failed. */ 1: #if cond_lock == 0 @@ -232,7 +211,7 @@ __pthread_cond_broadcast: addl $FUTEX_WAKE, %ecx movl $SYS_futex, %eax ENTER_KERNEL - jmp 10b + jmp 6b cfi_endproc .size __pthread_cond_broadcast, .-__pthread_cond_broadcast versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast, diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S index 4909f49107..ad42fb7c75 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S @@ -36,10 +36,11 @@ __pthread_cond_signal: cfi_startproc pushl %ebx cfi_adjust_cfa_offset(4) + cfi_rel_offset(%ebx, 0) pushl %edi cfi_adjust_cfa_offset(4) - cfi_offset(%ebx, -8) - cfi_offset(%edi, -12) + cfi_rel_offset(%edi, 0) + cfi_remember_state movl 12(%esp), %edi @@ -75,10 +76,10 @@ __pthread_cond_signal: /* Wake up one thread. */ pushl %esi cfi_adjust_cfa_offset(4) + cfi_rel_offset(%esi, 0) pushl %ebp cfi_adjust_cfa_offset(4) - cfi_offset(%esi, -16) - cfi_offset(%ebp, -20) + cfi_rel_offset(%ebp, 0) #if FUTEX_PRIVATE_FLAG > 255 xorl %ecx, %ecx @@ -121,9 +122,7 @@ __pthread_cond_signal: cfi_restore(%ebx) ret - cfi_adjust_cfa_offset(8) - cfi_offset(%ebx, -8) - cfi_offset(%edi, -12) + cfi_restore_state 7: /* %ecx should be either FUTEX_WAKE_OP or FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG from the previous syscall. */ -- cgit v1.2.1 From dfedb126d66fa4e9962e80d89233e00b521bf8bb Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 18 Nov 2009 06:40:25 -0800 Subject: Minor optimizations and cleanups of x86 cond_broadcast. --- nptl/ChangeLog | 5 +++++ .../sysv/linux/i386/i486/pthread_cond_broadcast.S | 19 +++++++++---------- .../unix/sysv/linux/i386/i486/pthread_cond_signal.S | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 1991a4d5d5..a6acf8aafb 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,8 @@ +2009-11-18 Ulrich Drepper + + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor + optimizations and cleanups. + 2009-11-18 Dinakar Guniguntala * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S index 1a55e522d3..40fb04b31b 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002,2003,2004,2006,2007,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -138,13 +138,6 @@ __pthread_cond_broadcast: cfi_restore_state - .align 16 - /* Unlock. */ -4: LOCK - subl $1, cond_lock-cond_futex(%ebx) - jne 5f - jmp 6b - /* Initial locking failed. */ 1: #if cond_lock == 0 @@ -165,7 +158,13 @@ __pthread_cond_broadcast: call __lll_lock_wait jmp 2b - /* Unlock in loop requires waekup. */ + .align 16 + /* Unlock. */ +4: LOCK + subl $1, cond_lock-cond_futex(%ebx) + je 6b + + /* Unlock in loop requires wakeup. */ 5: leal cond_lock-cond_futex(%ebx), %eax #if (LLL_SHARED-LLL_PRIVATE) > 255 xorl %ecx, %ecx @@ -180,7 +179,7 @@ __pthread_cond_broadcast: call __lll_unlock_wake jmp 6b - /* Unlock in loop requires waekup. */ + /* Unlock in loop requires wakeup. */ 7: leal cond_lock-cond_futex(%ebx), %eax #if (LLL_SHARED-LLL_PRIVATE) > 255 xorl %ecx, %ecx diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S index ad42fb7c75..013fcc303f 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002,2003,2004,2005,2007,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. -- cgit v1.2.1 From c6e7f16c536a0a588e842c5eb52626b00bbe9133 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 19 Nov 2009 06:38:31 -0800 Subject: Follow kernel F_OWNER_{GID -> PGRP} change. But maintain compatiblity for 2.11. --- ChangeLog | 12 ++++++++++++ sysdeps/unix/sysv/linux/i386/bits/fcntl.h | 7 ++++--- sysdeps/unix/sysv/linux/ia64/bits/fcntl.h | 7 ++++--- sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h | 7 ++++--- sysdeps/unix/sysv/linux/s390/bits/fcntl.h | 7 ++++--- sysdeps/unix/sysv/linux/sh/bits/fcntl.h | 7 ++++--- sysdeps/unix/sysv/linux/sparc/bits/fcntl.h | 7 ++++--- sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h | 7 ++++--- 8 files changed, 40 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03c0cab7a2..bf57a52b4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-11-19 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Introduce new symbol + F_OWNER_PGRP and mark F_OWNER_GID obsolete. The kernel people made + this gratuitous change and we have to keep compatibility. + * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise. + 2009-11-17 Ulrich Drepper * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Change misleading names diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h index ad2d51b4cb..f57a461b67 100644 --- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h @@ -172,9 +172,10 @@ struct flock64 /* Owner types. */ enum __pid_type { - F_OWNER_TID = 0, /* Kernel thread. */ - F_OWNER_PID, /* Process. */ - F_OWNER_GID /* Process group. */ + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h index 38da8a8f1d..a98ca3a208 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h @@ -165,9 +165,10 @@ struct flock64 /* Owner types. */ enum __pid_type { - F_OWNER_TID = 0, /* Kernel thread. */ - F_OWNER_PID, /* Process. */ - F_OWNER_GID /* Process group. */ + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h index 638b687ac9..010483a945 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h @@ -172,9 +172,10 @@ struct flock64 /* Owner types. */ enum __pid_type { - F_OWNER_TID = 0, /* Kernel thread. */ - F_OWNER_PID, /* Process. */ - F_OWNER_GID /* Process group. */ + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h index a962439456..8815eca868 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h @@ -187,9 +187,10 @@ struct flock64 /* Owner types. */ enum __pid_type { - F_OWNER_TID = 0, /* Kernel thread. */ - F_OWNER_PID, /* Process. */ - F_OWNER_GID /* Process group. */ + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h index ad2d51b4cb..f57a461b67 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h @@ -172,9 +172,10 @@ struct flock64 /* Owner types. */ enum __pid_type { - F_OWNER_TID = 0, /* Kernel thread. */ - F_OWNER_PID, /* Process. */ - F_OWNER_GID /* Process group. */ + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h index 519b4f235d..08c5c999fb 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h @@ -191,9 +191,10 @@ struct flock64 /* Owner types. */ enum __pid_type { - F_OWNER_TID = 0, /* Kernel thread. */ - F_OWNER_PID, /* Process. */ - F_OWNER_GID /* Process group. */ + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h index 1f8385816b..f5dfd8b0b9 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h @@ -186,9 +186,10 @@ struct flock64 /* Owner types. */ enum __pid_type { - F_OWNER_TID = 0, /* Kernel thread. */ - F_OWNER_PID, /* Process. */ - F_OWNER_GID /* Process group. */ + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ -- cgit v1.2.1 From 03ebadd9eaa4663f58bd3fa6fe8283f255925632 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 19 Nov 2009 10:03:46 -0800 Subject: Avoid warnings in CPU_* macros when using const bitsets. --- ChangeLog | 6 ++++++ sysdeps/unix/sysv/linux/bits/sched.h | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf57a52b4f..9dda77ffb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2009-11-19 Ulrich Drepper + [BZ #10918] + * sysdeps/unix/sysv/linux/bits/sched.h (__CPU_ISSET_S): Use __const + in cast to not throw away const-ness of parameters. + (__CPU_EQUAL_S): Likewise. + (__CPU_OP_S): Likewise. + * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Introduce new symbol F_OWNER_PGRP and mark F_OWNER_GID obsolete. The kernel people made this gratuitous change and we have to keep compatibility. diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h index 95d05b4ab2..18269a99b9 100644 --- a/sysdeps/unix/sysv/linux/bits/sched.h +++ b/sysdeps/unix/sysv/linux/bits/sched.h @@ -1,6 +1,6 @@ /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. - Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008 + Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -154,7 +154,7 @@ typedef struct (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu < 8 * (setsize) \ - ? ((((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ + ? ((((__const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ & __CPUMASK (__cpu))) != 0 \ : 0; })) @@ -167,8 +167,8 @@ typedef struct # else # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__extension__ \ - ({ __cpu_mask *__arr1 = (cpusetp1)->__bits; \ - __cpu_mask *__arr2 = (cpusetp2)->__bits; \ + ({ __const __cpu_mask *__arr1 = (cpusetp1)->__bits; \ + __const __cpu_mask *__arr2 = (cpusetp2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ @@ -180,8 +180,8 @@ typedef struct # define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ (__extension__ \ ({ cpu_set_t *__dest = (destset); \ - __cpu_mask *__arr1 = (srcset1)->__bits; \ - __cpu_mask *__arr2 = (srcset2)->__bits; \ + __const __cpu_mask *__arr1 = (srcset1)->__bits; \ + __const __cpu_mask *__arr2 = (srcset2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ -- cgit v1.2.1 From df1934daa7788ca5f19d82efb02cdf9b9c495b1a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 19 Nov 2009 10:29:16 -0800 Subject: Fix getwc* and putwc* on non-wide streams. --- ChangeLog | 5 +++++ libio/libio.h | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9dda77ffb9..a60bfcc8e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-11-19 Ulrich Drepper + [BZ #10958] + * libio/libio.h (_IO_getwc_unlocked): Check for _wide_data being + initialized before using it. + (_IO_putwc_unlocked): Likewise. + [BZ #10918] * sysdeps/unix/sysv/linux/bits/sched.h (__CPU_ISSET_S): Use __const in cast to not throw away const-ness of parameters. diff --git a/libio/libio.h b/libio/libio.h index 643812f72b..3c9f2bd3e8 100644 --- a/libio/libio.h +++ b/libio/libio.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1995,1997-2006,2007 Free Software Foundation, Inc. +/* Copyright (C) 1991-1995,1997-2006,2007,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner . @@ -442,13 +442,15 @@ extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t); #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define _IO_getwc_unlocked(_fp) \ - (_IO_BE ((_fp)->_wide_data->_IO_read_ptr >= (_fp)->_wide_data->_IO_read_end,\ - 0) \ + (_IO_BE ((_fp)->_wide_data == NULL \ + || ((_fp)->_wide_data->_IO_read_ptr \ + >= (_fp)->_wide_data->_IO_read_end), 0) \ ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++) # define _IO_putwc_unlocked(_wch, _fp) \ - (_IO_BE ((_fp)->_wide_data->_IO_write_ptr \ - >= (_fp)->_wide_data->_IO_write_end, 0) \ - ? __woverflow (_fp, _wch) \ + (_IO_BE ((_fp)->_wide_data == NULL \ + || ((_fp)->_wide_data->_IO_write_ptr \ + >= (_fp)->_wide_data->_IO_write_end), 0) \ + ? __woverflow (_fp, _wch) \ : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch))) #endif -- cgit v1.2.1 From 66221417957963c1d2df8d79f43573e328df2275 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 20 Nov 2009 08:30:20 -0800 Subject: Properly recover from shorter read. --- ChangeLog | 6 ++++++ sysdeps/ia64/memchr.S | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a60bfcc8e6..c99965f6e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-18 H.J. Lu + + [BZ #10162] + * sysdeps/ia64/memchr.S: Don't use a simple loop on data shorter + than software pipeline. Properly recover from shorter read. + 2009-11-19 Ulrich Drepper [BZ #10958] diff --git a/sysdeps/ia64/memchr.S b/sysdeps/ia64/memchr.S index e721e1714f..cdd71ca5a5 100644 --- a/sysdeps/ia64/memchr.S +++ b/sysdeps/ia64/memchr.S @@ -71,8 +71,7 @@ ENTRY(__memchr) cmp.ne p7, p0 = r0, r0 // clear p7 extr.u chr = in1, 0, 8 // chr = (unsigned char) in1 mov len = in2 - // use a simple loop on data shorter than software pipeline - cmp.gtu p6, p0 = ((MEMLAT + 1) * 8), in2 + cmp.gtu p6, p0 = 16, in2 // use a simple loop for short (p6) br.cond.spnt .srchfew ;; // searches sub loopcnt = 8, tmp // loopcnt = 8 - tmp cmp.eq p6, p0 = tmp, r0 @@ -127,7 +126,16 @@ ENTRY(__memchr) br.ret.sptk.many b0 .recovery: - adds ret0 = -((MEMLAT + 1) * 8), ret0;; +#if MEMLAT != 6 +# error "MEMLAT must be 6!" +#endif +(p[MEMLAT-6]) add ret0 = -8, ret0;; +(p[MEMLAT-5]) add ret0 = -8, ret0;; +(p[MEMLAT-4]) add ret0 = -8, ret0;; +(p[MEMLAT-3]) add ret0 = -8, ret0;; +(p[MEMLAT-2]) add ret0 = -8, ret0;; +(p[MEMLAT-1]) add ret0 = -8, ret0;; +(p[MEMLAT]) add ret0 = -8, ret0;; (p[MEMLAT+1]) add ret0 = -8, ret0;; (p[MEMLAT+2]) add ret0 = -8, ret0;; .l4: -- cgit v1.2.1 From 89b432d7a5befb85048c97e881b2106e8df58e43 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 22 Nov 2009 10:23:12 -0800 Subject: Fix up a bit more for recent API changes. --- ChangeLog | 6 ++++++ sysdeps/unix/sysv/linux/sys/timex.h | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c99965f6e4..dd688b2698 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-22 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sys/timex.h (MOD_TAI, MOD_MICRO, MOD_NANO): + Define. + (STA_RONLY): Add STA_NANO, STA_MODE, and STA_CLK. + 2009-11-18 H.J. Lu [BZ #10162] diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h index 5f10c7fa4c..88b87f1089 100644 --- a/sysdeps/unix/sysv/linux/sys/timex.h +++ b/sysdeps/unix/sysv/linux/sys/timex.h @@ -85,6 +85,9 @@ struct timex #define MOD_TIMECONST ADJ_TIMECONST #define MOD_CLKB ADJ_TICK #define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */ +#define MOD_TAI ADJ_TAI +#define MOD_MICRO ADJ_MICRO +#define MOD_NANO ADJ_NANO /* Status codes (timex.status) */ @@ -108,8 +111,9 @@ struct timex #define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ #define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ +/* Read-only bits */ #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ - STA_PPSERROR | STA_CLOCKERR) /* read-only bits */ + STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) /* Clock states (time_state) */ #define TIME_OK 0 /* clock synchronized, no leap second */ -- cgit v1.2.1 From eb4157390cac6212921ef198353635e138dc0a00 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 22 Nov 2009 11:07:04 -0800 Subject: Update ntp_gettime for Linux. The ntp_gettime implementation of NTP exports the tai field the kernel now produces. This requires an ABI change since the ntptimeval structure changed. Upstream kept the same name, there is nothing to do. This patch changes the ntptimeval structure but keeps the old ntp_gettime definition. A new ntp_gettimex function which is transparently invoked through the old name is introduced. This has the advantage that even object files can remain compatible. This wouldn't be the case if symbol versioning would be used to overload the name ntp_gettime. --- ChangeLog | 7 ++++++ sysdeps/unix/sysv/linux/Makefile | 6 ++--- sysdeps/unix/sysv/linux/Versions | 2 ++ sysdeps/unix/sysv/linux/ntp_gettime.c | 9 ++++--- sysdeps/unix/sysv/linux/ntp_gettimex.c | 46 ++++++++++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/sys/timex.h | 16 +++++++++++- 6 files changed, 79 insertions(+), 7 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/ntp_gettimex.c diff --git a/ChangeLog b/ChangeLog index dd688b2698..4d3bd8043b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-11-22 Ulrich Drepper + * sysdeps/unix/sysv/linux/ntp_gettimex.c: New file. + * sysdeps/unix/sysv/linux/Makefile: Add rules to build ntp_gettimex. + * sysdeps/unix/sysv/linux/Versions: Export ntp_gettimex for GLIBC_2.12. + * sysdeps/unix/sysv/linux/sys/timex.h (ntptimeval): Add tai member and + some placeholders. Redirect ntp_gettime to ntp_gettimex. + * sysdeps/unix/sysv/linux/ntp_gettime.c: Adjust for header change. + * sysdeps/unix/sysv/linux/sys/timex.h (MOD_TAI, MOD_MICRO, MOD_NANO): Define. (STA_RONLY): Add STA_NANO, STA_MODE, and STA_CLK. diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index cee5d29255..91c123b2b3 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -84,8 +84,8 @@ endif $(inst_includedir)/bits/syscall.h: $(objpfx)syscall-list.h $(+force) $(make-target-directory) if test -r $@ && cmp -s $< $@; \ - then echo 'bits/syscall.h unchanged'; \ - else $(INSTALL_DATA) $< $@; fi + then echo 'bits/syscall.h unchanged'; \ + else $(INSTALL_DATA) $< $@; fi ifndef no_deps # Get the generated list of dependencies (probably /usr/include/asm/unistd.h). @@ -97,7 +97,7 @@ endif ifeq ($(subdir),time) sysdep_headers += sys/timex.h -sysdep_routines += ntp_gettime +sysdep_routines += ntp_gettime ntp_gettimex endif ifeq ($(subdir),socket) diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 4c9129bed3..50c70513ff 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -144,6 +144,8 @@ libc { GLIBC_2.12 { #errlist-compat 134 _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + + ntp_gettimex; } GLIBC_PRIVATE { # functions used in other libraries diff --git a/sysdeps/unix/sysv/linux/ntp_gettime.c b/sysdeps/unix/sysv/linux/ntp_gettime.c index f78f1682fa..8bae0d9f6f 100644 --- a/sysdeps/unix/sysv/linux/ntp_gettime.c +++ b/sysdeps/unix/sysv/linux/ntp_gettime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2002, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,8 +16,12 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define ntp_gettime ntp_gettime_redirect + #include +#undef ntp_gettime + #ifndef MOD_OFFSET # define modes mode #endif @@ -27,8 +31,7 @@ extern int INTUSE(__adjtimex) (struct timex *__ntx); int -ntp_gettime (ntv) - struct ntptimeval *ntv; +ntp_gettime (struct ntptimeval *ntv) { struct timex tntx; int result; diff --git a/sysdeps/unix/sysv/linux/ntp_gettimex.c b/sysdeps/unix/sysv/linux/ntp_gettimex.c new file mode 100644 index 0000000000..ed7851b6fd --- /dev/null +++ b/sysdeps/unix/sysv/linux/ntp_gettimex.c @@ -0,0 +1,46 @@ +/* Copyright (C) 1999, 2002, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +#ifndef MOD_OFFSET +# define modes mode +#endif + + +extern int INTUSE(__adjtimex) (struct timex *__ntx); + + +int +ntp_gettimex (struct ntptimeval *ntv) +{ + struct timex tntx; + int result; + + tntx.modes = 0; + result = INTUSE(__adjtimex) (&tntx); + ntv->time = tntx.time; + ntv->maxerror = tntx.maxerror; + ntv->esterror = tntx.esterror; + ntv->tai = tntx.tai; + ntv->__unused1 = 0; + ntv->__unused2 = 0; + ntv->__unused3 = 0; + ntv->__unused4 = 0; + return result; +} diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h index 88b87f1089..e10311f70f 100644 --- a/sysdeps/unix/sysv/linux/sys/timex.h +++ b/sysdeps/unix/sysv/linux/sys/timex.h @@ -24,11 +24,19 @@ /* These definitions from linux/timex.h as of 2.6.30. */ +#define NTP_API 4 /* NTP API version */ + struct ntptimeval { struct timeval time; /* current time (ro) */ long int maxerror; /* maximum error (us) (ro) */ long int esterror; /* estimated error (us) (ro) */ + long int tai; /* TAI offset (ro) */ + + long int __unused1; + long int __unused2; + long int __unused3; + long int __unused4; }; struct timex @@ -132,7 +140,13 @@ __BEGIN_DECLS extern int __adjtimex (struct timex *__ntx) __THROW; extern int adjtimex (struct timex *__ntx) __THROW; -extern int ntp_gettime (struct ntptimeval *__ntv) __THROW; +#if defined __GNUC__ && __GNUC__ >= 2 +extern int ntp_gettime (struct ntptimeval *__ntv) + __asm__ ("ntp_gettimex") __THROW; +#else +extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; +# define ntp_gettime ntp_gettimex +#endif extern int ntp_adjtime (struct timex *__tntx) __THROW; __END_DECLS -- cgit v1.2.1 From c5a8b997e2de005697a992d8db5c54995bd361a8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 22 Nov 2009 11:43:57 -0800 Subject: Reinitialize _create_xid state after fork. Programs forking and using RPC in the forks would use the same XIDs. --- ChangeLog | 2 ++ sunrpc/create_xid.c | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4d3bd8043b..9a733519ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-11-22 Ulrich Drepper + * sunrpc/create_xid.c (_create_xid): Reinitialize state after fork. + * sysdeps/unix/sysv/linux/ntp_gettimex.c: New file. * sysdeps/unix/sysv/linux/Makefile: Add rules to build ntp_gettimex. * sysdeps/unix/sysv/linux/Versions: Export ntp_gettimex for GLIBC_2.12. diff --git a/sunrpc/create_xid.c b/sunrpc/create_xid.c index 4e76918644..c247568cee 100644 --- a/sunrpc/create_xid.c +++ b/sunrpc/create_xid.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1998, 2000 Free Software Foundation, Inc. +/* Copyright (c) 1998, 2000, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk , 1998. @@ -27,7 +27,7 @@ __libc_lock_define_initialized (static, createxid_lock) -static int is_initialized; +static pid_t is_initialized; static struct drand48_data __rpc_lrand48_data; unsigned long @@ -37,13 +37,15 @@ _create_xid (void) __libc_lock_lock (createxid_lock); - if (!is_initialized) + pid_t pid = getpid (); + if (is_initialized != pid) { struct timeval now; __gettimeofday (&now, (struct timezone *) 0); - __srand48_r (now.tv_sec ^ now.tv_usec, &__rpc_lrand48_data); - is_initialized = 1; + __srand48_r (now.tv_sec ^ now.tv_usec ^ pid, + &__rpc_lrand48_data); + is_initialized = pid; } lrand48_r (&__rpc_lrand48_data, &res); -- cgit v1.2.1 From 6503cfe2de2105e83456fb04fdeb5d4e2323e9b4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 22 Nov 2009 16:54:45 -0800 Subject: Fix week information for nl_NL locale. --- localedata/ChangeLog | 4 ++++ localedata/locales/nl_NL | 52 ++++++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/localedata/ChangeLog b/localedata/ChangeLog index 4ddd35d681..fa5536c126 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,7 @@ +2009-11-22 Ulrich Drepper + + * locales/nl_NL: Define week, first_weekday, and first_workday. + 2009-10-30 Ulrich Drepper * locales/it_CH: Fix typos in last change. diff --git a/localedata/locales/nl_NL b/localedata/locales/nl_NL index 9719cec5f6..6f832927a3 100644 --- a/localedata/locales/nl_NL +++ b/localedata/locales/nl_NL @@ -88,33 +88,33 @@ END LC_NUMERIC LC_TIME abday "";"";"";/ - "";"";"";/ - "" + "";"";"";/ + "" day "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "" + "";/ + "";/ + "";/ + "";/ + "";/ + "" abmon "";"";/ - "";"";/ - "";"";/ - "";"";/ - "";"";/ - "";"" + "";"";/ + "";"";/ + "";"";/ + "";"";/ + "";"" mon "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "" + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "" d_t_fmt "" d_fmt "" t_fmt "" @@ -123,6 +123,10 @@ t_fmt_ampm "" date_fmt "/ / " + +week 7;19971130;4 +first_weekday 2 +first_workday 2 END LC_TIME LC_PAPER -- cgit v1.2.1 From 57a299fe4757e50e70fe8c96a357293e7fa0db53 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 22 Nov 2009 17:49:21 -0800 Subject: Use #include instead of duplication for i386 vs i686 dl-sysdep.h in NPTL. --- nptl/ChangeLog | 5 +++ nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h | 55 +++------------------------ 2 files changed, 10 insertions(+), 50 deletions(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index a6acf8aafb..2dd5dac2d5 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,8 @@ +2009-11-22 Roland McGrath + + * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h" + instead of recapitulating its contents. + 2009-11-18 Ulrich Drepper * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor diff --git a/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h b/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h index a3b2c77c32..5216114a70 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h @@ -1,5 +1,5 @@ -/* System-specific settings for dynamic linker code. IA-32 version. - Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc. +/* System-specific settings for dynamic linker code. i386 version. + Copyright (C) 2002,2003,2008,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,56 +18,11 @@ 02111-1307 USA. */ #ifndef _DL_SYSDEP_H -#define _DL_SYSDEP_H 1 +# include "i686/dl-sysdep.h" -/* This macro must be defined to either 0 or 1. - - If 1, then an errno global variable hidden in ld.so will work right with - all the errno-using libc code compiled for ld.so, and there is never a - need to share the errno location with libc. This is appropriate only if - all the libc functions that ld.so uses are called without PLT and always - get the versions linked into ld.so rather than the libc ones. */ - -#ifdef IS_IN_rtld -# define RTLD_PRIVATE_ERRNO 1 -#else -# define RTLD_PRIVATE_ERRNO 0 -#endif - -/* Traditionally system calls have been made using int $0x80. A - second method was introduced which, if possible, will use the - sysenter/syscall instructions. To signal the presence and where to - find the code the kernel passes an AT_SYSINFO value in the - auxiliary vector to the application. - sysenter/syscall is not useful on i386 through i586, but the dynamic +/* sysenter/syscall is not useful on i386 through i586, but the dynamic linker and dl code in libc.a has to be able to load i686 compiled libraries. */ -#define NEED_DL_SYSINFO 1 -#undef USE_DL_SYSINFO - -#if defined NEED_DL_SYSINFO && !defined __ASSEMBLER__ -extern void _dl_sysinfo_int80 (void) attribute_hidden; -# define DL_SYSINFO_DEFAULT (uintptr_t) _dl_sysinfo_int80 -# define DL_SYSINFO_IMPLEMENTATION \ - asm (".text\n\t" \ - ".type _dl_sysinfo_int80,@function\n\t" \ - ".hidden _dl_sysinfo_int80\n\t" \ - CFI_STARTPROC "\n" \ - "_dl_sysinfo_int80:\n\t" \ - "int $0x80;\n\t" \ - "ret;\n\t" \ - CFI_ENDPROC "\n" \ - ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80\n\t" \ - ".previous;"); -#endif - - -/* The _dl_discover_osversion function is so far only needed in sysconf - to check for kernels later than 2.6.23. */ -#if !defined __ASSEMBLER__ && __LINUX_KERNEL_VERSION < 0x020617 -/* Get version of the OS. */ -extern int _dl_discover_osversion (void) attribute_hidden; -# define HAVE_DL_DISCOVER_OSVERSION 1 -#endif +# undef USE_DL_SYSINFO #endif /* dl-sysdep.h */ -- cgit v1.2.1 From 351fe9477007a45df62eaafe7ae8adc5cd1d0e0e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 22 Nov 2009 19:07:52 -0800 Subject: Try harder to re-exec nscd in paranoia mode. --- ChangeLog | 2 ++ nscd/connections.c | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a733519ae..337af672f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-11-22 Ulrich Drepper + * nscd/connections.c (restart): Try harder to re-exec. + * sunrpc/create_xid.c (_create_xid): Reinitialize state after fork. * sysdeps/unix/sysv/linux/ntp_gettimex.c: New file. diff --git a/nscd/connections.c b/nscd/connections.c index ca73393f40..69f6533a32 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -1426,15 +1426,14 @@ cannot change to old working directory: %s; disabling paranoia mode"), #endif /* Try to exec the real nscd program so the process name (as reported in /proc/PID/status) will be 'nscd', but fall back to /proc/self/exe - if readlink fails */ + if readlink or the exec with the result of the readlink call fails. */ ssize_t n = readlink ("/proc/self/exe", pathbuf, sizeof (pathbuf) - 1); - if (n == -1) - execv ("/proc/self/exe", argv); - else + if (n != -1) { pathbuf[n] = '\0'; execv (pathbuf, argv); } + execv ("/proc/self/exe", argv); /* If we come here, we will never be able to re-exec. */ dbg_log (_("re-exec failed: %s; disabling paranoia mode"), -- cgit v1.2.1 From e3611aefb4961dbd51ba6ef673cd9ba4a9b33bc8 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 23 Nov 2009 07:10:27 -0800 Subject: Use struct timespec for timestamps in struct stat also if __USE_XOPEN2K8. POSIX.1-2008 made stat.st_[acm]tim mandatory. --- ChangeLog | 9 ++++++ sysdeps/unix/sysv/linux/bits/stat.h | 8 ++--- sysdeps/unix/sysv/linux/powerpc/bits/stat.h | 48 ++++++++++++++--------------- sysdeps/unix/sysv/linux/s390/bits/stat.h | 38 +++++++++++------------ sysdeps/unix/sysv/linux/sparc/bits/stat.h | 18 +++++------ sysdeps/unix/sysv/linux/x86_64/bits/stat.h | 32 +++++++++---------- 6 files changed, 81 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index 337af672f6..3d22169a7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-11-23 Andreas Schwab + + * sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Use struct timespec + for timestamps also if __USE_XOPEN2K8. + * sysdeps/unix/sysv/linux/sparc/bits/stat.h: Likewise. + * sysdeps/unix/sysv/linux/s390/bits/stat.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/bits/stat.h: Likewise. + * sysdeps/unix/sysv/linux/bits/stat.h: Likewise. + 2009-11-22 Ulrich Drepper * nscd/connections.c (restart): Try harder to re-exec. diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h index e6a5b6afbf..be5272333b 100644 --- a/sysdeps/unix/sysv/linux/bits/stat.h +++ b/sysdeps/unix/sysv/linux/bits/stat.h @@ -60,7 +60,7 @@ struct stat #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif -#ifdef __USE_MISC +#if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -106,7 +106,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -116,14 +116,14 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -#else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif __ino64_t st_ino; /* File serial number. */ }; #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h index b6c82c55bb..81879ca1fe 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h @@ -69,7 +69,7 @@ struct stat # else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ # endif -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -79,17 +79,17 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned long int __unused4; unsigned long int __unused5; }; @@ -109,7 +109,7 @@ struct stat64 __off64_t st_size; /* Size of file, in bytes. */ __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -119,17 +119,17 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned long int __unused4; unsigned long int __unused5; }; @@ -163,7 +163,7 @@ struct stat # else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ # endif -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -173,17 +173,17 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned long int __unused4; unsigned long int __unused5; unsigned long int __unused6; @@ -203,7 +203,7 @@ struct stat64 __off64_t st_size; /* Size of file, in bytes. */ __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -213,17 +213,17 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned long int __unused4; unsigned long int __unused5; unsigned long int __unused6; diff --git a/sysdeps/unix/sysv/linux/s390/bits/stat.h b/sysdeps/unix/sysv/linux/s390/bits/stat.h index c062498556..64be9a10fd 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/stat.h +++ b/sysdeps/unix/sysv/linux/s390/bits/stat.h @@ -56,7 +56,7 @@ struct stat int pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ -#ifdef __USE_MISC +#if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -109,7 +109,7 @@ struct stat # else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ # endif -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -119,17 +119,17 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif # ifndef __USE_FILE_OFFSET64 unsigned long int __unused4; unsigned long int __unused5; @@ -153,7 +153,7 @@ struct stat64 int pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -163,17 +163,17 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ long int __unused[3]; @@ -195,7 +195,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -205,17 +205,17 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif __ino64_t st_ino; /* File serial number. */ }; # endif diff --git a/sysdeps/unix/sysv/linux/sparc/bits/stat.h b/sysdeps/unix/sysv/linux/sparc/bits/stat.h index 7426e16806..175fdb8570 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/stat.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/stat.h @@ -60,7 +60,7 @@ struct stat #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif -#ifdef __USE_MISC +#if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -89,9 +89,9 @@ struct stat struct stat64 { __dev_t st_dev; /* Device. */ -#if __WORDSIZE == 64 +# if __WORDSIZE == 64 unsigned short int __pad1; -#endif +# endif __ino64_t st_ino; /* File serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ @@ -103,7 +103,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -113,17 +113,17 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned long int __unused4; unsigned long int __unused5; }; diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h index 51367b2fc1..9d12315e1a 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h @@ -78,7 +78,7 @@ struct stat #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif -#ifdef __USE_MISC +#if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -116,30 +116,30 @@ struct stat struct stat64 { __dev_t st_dev; /* Device. */ -#if __WORDSIZE == 64 +# if __WORDSIZE == 64 __ino64_t st_ino; /* File serial number. */ __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ -#else +# else unsigned int __pad1; __ino_t __st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ -#endif +# endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ -#if __WORDSIZE == 64 +# if __WORDSIZE == 64 int __pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ -#else +# else __dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; __off64_t st_size; /* Size of file, in bytes. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ -#ifdef __USE_MISC +# if defined __USE_MISC || defined __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -149,22 +149,22 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif -#if __WORDSIZE == 64 +# endif +# if __WORDSIZE == 64 long int __unused[3]; -#else +# else __ino64_t st_ino; /* File serial number. */ -#endif +# endif }; #endif -- cgit v1.2.1 From 49c7f27194d16976a6bb9c5b7be186662ec7a6e6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 23 Nov 2009 16:16:26 -0800 Subject: Define week, first_weekday, and first_workday for en_DK locale. --- localedata/ChangeLog | 4 ++++ localedata/locales/en_DK | 53 +++++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/localedata/ChangeLog b/localedata/ChangeLog index fa5536c126..077182b4c2 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,7 @@ +2009-11-23 Ulrich Drepper + + * locales/en_DK: Define week, first_weekday, and first_workday. + 2009-11-22 Ulrich Drepper * locales/nl_NL: Define week, first_weekday, and first_workday. diff --git a/localedata/locales/en_DK b/localedata/locales/en_DK index aa58763578..3ec5170558 100644 --- a/localedata/locales/en_DK +++ b/localedata/locales/en_DK @@ -85,34 +85,34 @@ END LC_NUMERIC LC_TIME abday "";"";/ - "";"";/ - "";"";/ - "" + "";"";/ + "";"";/ + "" day "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "" + "";/ + "";/ + "";/ + "";/ + "";/ + "" abmon "";"";/ - "";"";/ - "";"";/ - "";"";/ - "";"";/ - "";"" + "";"";/ + "";"";/ + "";"";/ + "";"";/ + "";"" mon "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "" + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "" % date formats following ISO 8601-1988 d_t_fmt "" d_fmt "" @@ -122,6 +122,9 @@ t_fmt_ampm "" date_fmt "/ / " +week 7;19971130;4 +first_weekday 2 +first_workday 2 END LC_TIME LC_MESSAGES -- cgit v1.2.1