From sjmunroe@us.ibm.com Wed Dec 1 00:00:00 2004 From: sjmunroe@us.ibm.com (Steve Munroe) Date: Wed, 01 Dec 2004 00:00:00 -0000 Subject: Whats up with _POSIX_CPUTIME In-Reply-To: <200411302220.iAUMKbd6021050@magilla.sf.frob.com> Message-ID: Roland McGrath wrote on 11/30/2004 04:20:37 PM: > > powerpc/powerpc64 builds are failing because they are undefined. So far > > only i386, ia64, and x86_64 define these in posix_opt.h. > > Please elaborate. > posix/tst-sysconf.c assumes that _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME are defined for posix_options. Steven J. Munroe Linux on Power Toolchain Architect IBM Corporation, Linux Technology Center From roland@redhat.com Wed Dec 1 00:08:00 2004 From: roland@redhat.com (Roland McGrath) Date: Wed, 01 Dec 2004 00:08:00 -0000 Subject: [PATCH] Re: Whats up with _POSIX_CPUTIME In-Reply-To: Jakub Jelinek's message of Wednesday, 1 December 2004 00:35:02 +0100 <20041130233502.GK8259@sunsite.mff.cuni.cz> Message-ID: <200412010008.iB108XxS021308@magilla.sf.frob.com> > Like this? Yeah, but a tested version with the typo's removed. :-) From jakub@redhat.com Wed Dec 1 10:42:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 01 Dec 2004 10:42:00 -0000 Subject: [PATCH] Re: Whats up with _POSIX_CPUTIME In-Reply-To: <200412010008.iB108XxS021308@magilla.sf.frob.com> References: <20041130233502.GK8259@sunsite.mff.cuni.cz> <200412010008.iB108XxS021308@magilla.sf.frob.com> Message-ID: <20041201104155.GL8259@sunsite.mff.cuni.cz> On Tue, Nov 30, 2004 at 04:08:33PM -0800, Roland McGrath wrote: > > Like this? > > Yeah, but a tested version with the typo's removed. :-) Did you just mean the s/#if #defined/#if defined/ in posix/tst-regex2.c? That's the only thing I found during testing... 2004-12-01 Jakub Jelinek = 0 conditionals instead of defined _POSIX_CPUTIME. (main): If _POSIX_CPUTIME == 0, call sysconf to see if CPUTIME option is available. * posix/tst-regex.c2: Use defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 conditionals instead of defined _POSIX_CPUTIME. (do_test): If _POSIX_CPUTIME == 0, call sysconf to see if CPUTIME option is available. * sysdeps/posix/sysconf.c (__sysconf): If _POSIX_CPUTIME resp. _POSIX_THREAD_CPUTIME is defined to 0, return -1 for the corresponding _SC_ argument. nptl/ * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME, _POSIX_THREAD_CPUTIME): Define to 0. * sysdeps/pthread/timer_delete.c: Include instead of "posix-timer.h". * sysdeps/pthread/timer_gettime.c: Likewise. * sysdeps/pthread/timer_getoverr.c: Likewise. * sysdeps/pthread/timer_settime.c: Likewise. * sysdeps/pthread/timer_create.c: Likewise. Use defined __HAVE_{,THREAD_}CPUTIME instead of defined _POSIX_{,THREAD_}CPUTIME && _POSIX_{,THREAD_}CPUTIME >= 0 conditionals. * sysdeps/pthread/timer_routines.c: Likewise. * sysdeps/pthread/posix-timer.h: Likewise. * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/i386/posix-timer.h: New file. * sysdeps/unix/sysv/linux/ia64/posix-timer.h: New file. * sysdeps/unix/sysv/linux/x86_64/posix-timer.h: New file. linuxthreads/ * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME, _POSIX_THREAD_CPUTIME): Define to 0. * sysdeps/pthread/timer_delete.c: Include instead of "posix-timer.h". * sysdeps/pthread/timer_gettime.c: Likewise. * sysdeps/pthread/timer_getoverr.c: Likewise. * sysdeps/pthread/timer_settime.c: Likewise. * sysdeps/pthread/timer_create.c: Likewise. Use defined __HAVE_{,THREAD_}CPUTIME instead of defined _POSIX_{,THREAD_}CPUTIME && _POSIX_{,THREAD_}CPUTIME >= 0 conditionals. * sysdeps/pthread/timer_routines.c: Likewise. * sysdeps/pthread/posix-timer.h: Likewise. * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/i386/posix-timer.h: New file. * sysdeps/unix/sysv/linux/ia64/posix-timer.h: New file. * sysdeps/unix/sysv/linux/x86_64/posix-timer.h: New file. --- libc/posix/tst-regex.c.jj 2003-11-29 10:14:14.000000000 +0100 +++ libc/posix/tst-regex.c 2004-11-30 23:56:39.000000000 +0100 @@ -37,7 +37,7 @@ #include -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 static clockid_t cl; static int use_clock; #endif @@ -118,9 +118,14 @@ main (int argc, char *argv[]) if (inlen != 0) error (EXIT_FAILURE, errno, "cannot convert buffer"); -#ifdef _POSIX_CPUTIME - /* See whether we can use the CPU clock. */ - use_clock = clock_getcpuclockid (0, &cl) == 0; +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +# if _POSIX_CPUTIME == 0 + if (sysconf (_SC_CPUTIME) < 0) + use_clock = 0; + else +# endif + /* See whether we can use the CPU clock. */ + use_clock = clock_getcpuclockid (0, &cl) == 0; #endif #ifdef DEBUG @@ -202,7 +207,7 @@ static int run_test (const char *expr, const char *mem, size_t memlen, int icase, int expected) { -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 struct timespec start; struct timespec finish; #endif @@ -211,7 +216,7 @@ run_test (const char *expr, const char * size_t offset; int cnt; -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock && !timing) use_clock = clock_gettime (cl, &start) == 0; #endif @@ -260,7 +265,7 @@ run_test (const char *expr, const char * regfree (&re); -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock && !timing) { use_clock = clock_gettime (cl, &finish) == 0; @@ -345,7 +350,7 @@ static int run_test_backwards (const char *expr, const char *mem, size_t memlen, int icase, int expected) { -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 struct timespec start; struct timespec finish; #endif @@ -354,7 +359,7 @@ run_test_backwards (const char *expr, co size_t offset; int cnt; -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock && !timing) use_clock = clock_gettime (cl, &start) == 0; #endif @@ -406,7 +411,7 @@ run_test_backwards (const char *expr, co regfree (&re); -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock && !timing) { use_clock = clock_gettime (cl, &finish) == 0; --- libc/posix/tst-regex2.c.jj 2004-11-19 00:55:41.000000000 +0100 +++ libc/posix/tst-regex2.c 2004-12-01 10:50:35.811407309 +0100 @@ -8,7 +8,7 @@ #include #include -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 static clockid_t cl; static int use_clock; #endif @@ -16,9 +16,14 @@ static int use_clock; static int do_test (void) { -#ifdef _POSIX_CPUTIME - /* See whether we can use the CPU clock. */ - use_clock = clock_getcpuclockid (0, &cl) == 0; +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +# if _POSIX_CPUTIME == 0 + if (sysconf (_SC_CPUTIME) < 0) + use_clock = 0; + else +# endif + /* See whether we can use the CPU clock. */ + use_clock = clock_getcpuclockid (0, &cl) == 0; #endif static const char *pat[] = { @@ -112,7 +117,7 @@ do_test (void) rpbuf.no_sub = 1; } -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 struct timespec start, stop; if (use_clock) use_clock = clock_gettime (cl, &start) == 0; @@ -211,7 +216,7 @@ do_test (void) } } -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock) use_clock = clock_gettime (cl, &stop) == 0; if (use_clock) --- libc/sysdeps/posix/sysconf.c.jj 2004-11-28 17:36:05.000000000 +0100 +++ libc/sysdeps/posix/sysconf.c 2004-11-30 23:44:26.000000000 +0100 @@ -890,7 +890,7 @@ __sysconf (name) #endif case _SC_CPUTIME: -#ifdef _POSIX_CPUTIME +#if _POSIX_CPUTIME > 0 return _POSIX_CPUTIME; #else return -1; @@ -1055,7 +1055,7 @@ __sysconf (name) #endif case _SC_THREAD_CPUTIME: -#ifdef _POSIX_THREAD_CPUTIME +#if _POSIX_THREAD_CPUTIME > 0 return _POSIX_THREAD_CPUTIME; #else return -1; --- libc/nptl/sysdeps/unix/sysv/linux/i386/posix-timer.h.jj 2004-12-01 00:14:31.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/i386/posix-timer.h 2004-12-01 00:14:26.000000000 +0100 @@ -0,0 +1,3 @@ +#define __HAVE_CPUTIME 1 +#define __HAVE_THREAD_CPUTIME 1 +#include_next --- libc/nptl/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h 2004-12-01 00:03:11.000000000 +0100 @@ -1,178 +0,0 @@ -/* Define POSIX options for Linux. - Copyright (C) 1996-2001, 2002, 2003, 2004 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is supported. */ -#define _POSIX_THREAD_PROCESS_SHARED 200112L - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are available. */ -#define _POSIX_CLOCK_SELECTION 200112L - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection so far. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h 2004-12-01 00:02:49.000000000 +0100 @@ -104,6 +104,12 @@ /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200112L +/* CPU-time clocks support needs to be checked at runtime. */ +#define _POSIX_CPUTIME 0 + +/* Clock support in threads must be also checked at runtime. */ +#define _POSIX_THREAD_CPUTIME 0 + /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 --- libc/nptl/sysdeps/unix/sysv/linux/ia64/posix-timer.h.jj 2004-12-01 00:14:31.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/ia64/posix-timer.h 2004-12-01 00:14:26.000000000 +0100 @@ -0,0 +1,3 @@ +#define __HAVE_CPUTIME 1 +#define __HAVE_THREAD_CPUTIME 1 +#include_next --- libc/nptl/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h 2004-12-01 00:03:21.000000000 +0100 @@ -1,178 +0,0 @@ -/* Define POSIX options for Linux. - Copyright (C) 1996-2001, 2002, 2003, 2004 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is supported. */ -#define _POSIX_THREAD_PROCESS_SHARED 200112L - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are available. */ -#define _POSIX_CLOCK_SELECTION 200112L - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection so far. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/nptl/sysdeps/unix/sysv/linux/x86_64/posix-timer.h.jj 2004-12-01 00:14:31.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/posix-timer.h 2004-12-01 00:14:26.000000000 +0100 @@ -0,0 +1,3 @@ +#define __HAVE_CPUTIME 1 +#define __HAVE_THREAD_CPUTIME 1 +#include_next --- libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h 2004-12-01 00:03:30.000000000 +0100 @@ -1,178 +0,0 @@ -/* Define POSIX options for Linux. - Copyright (C) 1996-2001, 2002, 2003, 2004 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is supported. */ -#define _POSIX_THREAD_PROCESS_SHARED 200112L - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are available. */ -#define _POSIX_CLOCK_SELECTION 200112L - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection so far. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/nptl/sysdeps/pthread/timer_routines.c.jj 2004-10-05 09:04:47.000000000 +0200 +++ libc/nptl/sysdeps/pthread/timer_routines.c 2004-12-01 00:18:04.000000000 +0100 @@ -29,7 +29,7 @@ #include #include -#include "posix-timer.h" +#include #include @@ -53,10 +53,10 @@ int __timer_init_failed; /* Node for the thread used to deliver signals. */ struct thread_node __timer_signal_thread_rclk; -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +#ifdef __HAVE_CPUTIME struct thread_node __timer_signal_thread_pclk; #endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 +#ifdef __HAVE_THREAD_CPUTIME struct thread_node __timer_signal_thread_tclk; #endif @@ -191,10 +191,10 @@ init_module (void) list_append (&thread_free_list, &thread_array[i].links); thread_init (&__timer_signal_thread_rclk, 0, CLOCK_REALTIME); -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +#ifdef __HAVE_CPUTIME thread_init (&__timer_signal_thread_pclk, 0, CLOCK_PROCESS_CPUTIME_ID); #endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 +#ifdef __HAVE_THREAD_CPUTIME thread_init (&__timer_signal_thread_tclk, 0, CLOCK_THREAD_CPUTIME_ID); #endif } @@ -281,10 +281,10 @@ thread_cleanup (void *val) /* How did the signal thread get killed? */ assert (thread != &__timer_signal_thread_rclk); -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +#ifdef __HAVE_CPUTIME assert (thread != &__timer_signal_thread_pclk); #endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 +#ifdef __HAVE_THREAD_CPUTIME assert (thread != &__timer_signal_thread_tclk); #endif --- libc/nptl/sysdeps/pthread/timer_delete.c.jj 2002-11-26 23:50:32.000000000 +0100 +++ libc/nptl/sysdeps/pthread/timer_delete.c 2004-12-01 00:10:40.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kaz Kylheku . @@ -22,7 +22,7 @@ #include #include -#include "posix-timer.h" +#include /* Delete timer TIMERID. */ --- libc/nptl/sysdeps/pthread/posix-timer.h.jj 2004-10-05 09:04:47.000000000 +0200 +++ libc/nptl/sysdeps/pthread/posix-timer.h 2004-12-01 00:15:05.000000000 +0100 @@ -92,10 +92,10 @@ extern int __timer_init_failed; /* A distinct thread is used for each clock type. */ extern struct thread_node __timer_signal_thread_rclk; -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +#ifdef __HAVE_CPUTIME extern struct thread_node __timer_signal_thread_pclk; #endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 +#ifdef __HAVE_THREAD_CPUTIME extern struct thread_node __timer_signal_thread_tclk; #endif --- libc/nptl/sysdeps/pthread/timer_gettime.c.jj 2004-04-21 10:06:05.000000000 +0200 +++ libc/nptl/sysdeps/pthread/timer_gettime.c 2004-12-01 00:10:24.000000000 +0100 @@ -21,7 +21,7 @@ #include #include -#include "posix-timer.h" +#include /* Get current value of timer TIMERID and store it in VLAUE. */ --- libc/nptl/sysdeps/pthread/timer_getoverr.c.jj 2002-11-26 23:50:32.000000000 +0100 +++ libc/nptl/sysdeps/pthread/timer_getoverr.c 2004-12-01 00:10:47.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kaz Kylheku . @@ -21,7 +21,7 @@ #include #include -#include "posix-timer.h" +#include /* Get expiration overrun for timer TIMERID. */ --- libc/nptl/sysdeps/pthread/timer_create.c.jj 2004-10-05 19:45:02.000000000 +0200 +++ libc/nptl/sysdeps/pthread/timer_create.c 2004-12-01 00:15:58.000000000 +0100 @@ -23,7 +23,7 @@ #include #include -#include "posix-timer.h" +#include /* Create new per-process timer using CLOCK. */ @@ -38,10 +38,10 @@ timer_create (clock_id, evp, timerid) struct thread_node *thread = NULL; if (0 -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +#ifdef __HAVE_CPUTIME || clock_id == CLOCK_PROCESS_CPUTIME_ID #endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 +#ifdef __HAVE_THREAD_CPUTIME || clock_id == CLOCK_THREAD_CPUTIME_ID #endif ) @@ -100,12 +100,12 @@ timer_create (clock_id, evp, timerid) default: thread = &__timer_signal_thread_rclk; break; -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +#ifdef __HAVE_CPUTIME case CLOCK_PROCESS_CPUTIME_ID: thread = &__timer_signal_thread_pclk; break; #endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 +#ifdef __HAVE_THREAD_CPUTIME case CLOCK_THREAD_CPUTIME_ID: thread = &__timer_signal_thread_tclk; break; --- libc/nptl/sysdeps/pthread/timer_settime.c.jj 2002-11-26 23:50:33.000000000 +0100 +++ libc/nptl/sysdeps/pthread/timer_settime.c 2004-12-01 00:11:05.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kaz Kylheku . @@ -21,7 +21,7 @@ #include #include -#include "posix-timer.h" +#include /* Set timer TIMERID to VALUE, returning old value in OVLAUE. */ --- libc/linuxthreads/sysdeps/unix/sysv/linux/i386/posix-timer.h.jj 2004-12-01 00:14:31.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/i386/posix-timer.h 2004-12-01 00:14:26.000000000 +0100 @@ -0,0 +1,3 @@ +#define __HAVE_CPUTIME 1 +#define __HAVE_THREAD_CPUTIME 1 +#include_next --- libc/linuxthreads/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h.jj 2004-11-28 17:37:40.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h 2004-12-01 00:01:34.000000000 +0100 @@ -1,181 +0,0 @@ -/* Define POSIX options for Linux/ix86. - Copyright (C) 1996-2001, 2002, 2003, 2004 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* X/Open realtime thread support is available. */ -#define _XOPEN_REALTIME_THREADS 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores, but only the non-shared form for now. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is not supported. */ -#define _POSIX_THREAD_PROCESS_SHARED -1 - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are not available. */ -#define _POSIX_CLOCK_SELECTION -1 - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/linuxthreads/sysdeps/unix/sysv/linux/bits/posix_opt.h.jj 2004-11-28 17:37:40.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/bits/posix_opt.h 2004-12-01 00:01:25.000000000 +0100 @@ -1,4 +1,4 @@ -/* Define POSIX options for Linux. +/* Define POSIX options for Linux/ix86. Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -107,6 +107,12 @@ /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200112L +/* CPU-time clocks support needs to be checked at runtime. */ +#define _POSIX_CPUTIME 0 + +/* Clock support in threads must be also checked at runtime. */ +#define _POSIX_THREAD_CPUTIME 0 + /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 --- libc/linuxthreads/sysdeps/unix/sysv/linux/ia64/posix-timer.h.jj 2004-12-01 00:14:31.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/ia64/posix-timer.h 2004-12-01 00:14:26.000000000 +0100 @@ -0,0 +1,3 @@ +#define __HAVE_CPUTIME 1 +#define __HAVE_THREAD_CPUTIME 1 +#include_next --- libc/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h 2004-12-01 00:02:03.000000000 +0100 @@ -1,181 +0,0 @@ -/* Define POSIX options for Linux/ia64. - Copyright (C) 1996-2001, 2002, 2003, 2004 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* X/Open realtime thread support is available. */ -#define _XOPEN_REALTIME_THREADS 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores, but only the non-shared form for now. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is not supported. */ -#define _POSIX_THREAD_PROCESS_SHARED -1 - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are not available. */ -#define _POSIX_CLOCK_SELECTION -1 - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/posix-timer.h.jj 2004-12-01 00:14:31.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/posix-timer.h 2004-12-01 00:14:26.000000000 +0100 @@ -0,0 +1,3 @@ +#define __HAVE_CPUTIME 1 +#define __HAVE_THREAD_CPUTIME 1 +#include_next --- libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h 2004-12-01 00:02:14.000000000 +0100 @@ -1,181 +0,0 @@ -/* Define POSIX options for Linux/x86_64. - Copyright (C) 1996-2001, 2002, 2003, 2004 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* X/Open realtime thread support is available. */ -#define _XOPEN_REALTIME_THREADS 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores, but only the non-shared form for now. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is not supported. */ -#define _POSIX_THREAD_PROCESS_SHARED -1 - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are not available. */ -#define _POSIX_CLOCK_SELECTION -1 - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/linuxthreads/sysdeps/pthread/timer_routines.c.jj 2004-04-21 10:06:01.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/timer_routines.c 2004-12-01 00:20:08.000000000 +0100 @@ -29,7 +29,7 @@ #include #include -#include "posix-timer.h" +#include /* Number of threads used. */ @@ -52,10 +52,10 @@ int __timer_init_failed; /* Node for the thread used to deliver signals. */ struct thread_node __timer_signal_thread_rclk; -#ifdef _POSIX_CPUTIME +#ifdef __HAVE_CPUTIME struct thread_node __timer_signal_thread_pclk; #endif -#ifdef _POSIX_THREAD_CPUTIME +#ifdef __HAVE_THREAD_CPUTIME struct thread_node __timer_signal_thread_tclk; #endif @@ -190,10 +190,10 @@ init_module (void) list_append (&thread_free_list, &thread_array[i].links); thread_init (&__timer_signal_thread_rclk, 0, CLOCK_REALTIME); -#ifdef _POSIX_CPUTIME +#ifdef __HAVE_CPUTIME thread_init (&__timer_signal_thread_pclk, 0, CLOCK_PROCESS_CPUTIME_ID); #endif -#ifdef _POSIX_THREAD_CPUTIME +#ifdef __HAVE_THREAD_CPUTIME thread_init (&__timer_signal_thread_tclk, 0, CLOCK_THREAD_CPUTIME_ID); #endif } @@ -280,10 +280,10 @@ thread_cleanup (void *val) /* How did the signal thread get killed? */ assert (thread != &__timer_signal_thread_rclk); -#ifdef _POSIX_CPUTIME +#ifdef __HAVE_CPUTIME assert (thread != &__timer_signal_thread_pclk); #endif -#ifdef _POSIX_THREAD_CPUTIME +#ifdef __HAVE_THREAD_CPUTIME assert (thread != &__timer_signal_thread_tclk); #endif --- libc/linuxthreads/sysdeps/pthread/timer_delete.c.jj 2002-08-27 00:39:43.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/timer_delete.c 2004-12-01 00:19:27.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kaz Kylheku . @@ -22,7 +22,7 @@ #include #include -#include "posix-timer.h" +#include /* Delete timer TIMERID. */ --- libc/linuxthreads/sysdeps/pthread/posix-timer.h.jj 2002-08-27 00:39:43.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/posix-timer.h 2004-12-01 00:21:06.000000000 +0100 @@ -1,5 +1,5 @@ /* Definitions for POSIX timer implementation on top of LinuxThreads. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kaz Kylheku . @@ -85,10 +85,10 @@ extern int __timer_init_failed; /* A distinct thread is used for each clock type. */ extern struct thread_node __timer_signal_thread_rclk; -#ifdef _POSIX_CPUTIME +#ifdef __HAVE_CPUTIME extern struct thread_node __timer_signal_thread_pclk; #endif -#ifdef _POSIX_THREAD_CPUTIME +#ifdef __HAVE_THREAD_CPUTIME extern struct thread_node __timer_signal_thread_tclk; #endif --- libc/linuxthreads/sysdeps/pthread/timer_gettime.c.jj 2004-04-21 10:06:01.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/timer_gettime.c 2004-12-01 00:18:33.000000000 +0100 @@ -21,7 +21,7 @@ #include #include -#include "posix-timer.h" +#include /* Get current value of timer TIMERID and store it in VLAUE. */ --- libc/linuxthreads/sysdeps/pthread/timer_getoverr.c.jj 2002-08-27 00:39:43.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/timer_getoverr.c 2004-12-01 00:19:33.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kaz Kylheku . @@ -21,7 +21,7 @@ #include #include -#include "posix-timer.h" +#include /* Get expiration overrun for timer TIMERID. */ --- libc/linuxthreads/sysdeps/pthread/timer_create.c.jj 2004-04-21 10:06:01.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/timer_create.c 2004-12-01 00:19:02.000000000 +0100 @@ -23,7 +23,7 @@ #include #include -#include "posix-timer.h" +#include /* Create new per-process timer using CLOCK. */ @@ -38,10 +38,10 @@ timer_create (clock_id, evp, timerid) struct thread_node *thread = NULL; if (0 -#ifdef _POSIX_CPUTIME +#ifdef __HAVE_CPUTIME || clock_id == CLOCK_PROCESS_CPUTIME_ID #endif -#ifdef _POSIX_THREAD_CPUTIME +#ifdef __HAVE_THREAD_CPUTIME || clock_id == CLOCK_THREAD_CPUTIME_ID #endif ) @@ -100,12 +100,12 @@ timer_create (clock_id, evp, timerid) default: thread = &__timer_signal_thread_rclk; break; -#ifdef _POSIX_CPUTIME +#ifdef __HAVE_CPUTIME case CLOCK_PROCESS_CPUTIME_ID: thread = &__timer_signal_thread_pclk; break; #endif -#ifdef _POSIX_THREAD_CPUTIME +#ifdef __HAVE_THREAD_CPUTIME case CLOCK_THREAD_CPUTIME_ID: thread = &__timer_signal_thread_tclk; break; --- libc/linuxthreads/sysdeps/pthread/timer_settime.c.jj 2002-08-27 00:39:43.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/timer_settime.c 2004-12-01 00:20:15.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kaz Kylheku . @@ -21,7 +21,7 @@ #include #include -#include "posix-timer.h" +#include /* Set timer TIMERID to VALUE, returning old value in OVLAUE. */ --- libc/linuxthreads/tst-clock1.c.jj 2004-07-09 01:44:50.000000000 +0200 +++ libc/linuxthreads/tst-clock1.c 2004-11-30 23:59:30.000000000 +0100 @@ -25,7 +25,7 @@ #include -#if _POSIX_THREAD_CPUTIME +#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 static pthread_barrier_t b2; static pthread_barrier_t bN; @@ -55,9 +55,17 @@ tf (void *arg) int do_test (void) { -#if _POSIX_THREAD_CPUTIME +#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 # define N 10 +# if _POSIX_THREAD_CPUTIME == 0 + if (sysconf (_SC_THREAD_CPUTIME) < 0) + { + puts ("_POSIX_THREAD_CPUTIME option not available"); + return 0; + } +# endif + if (pthread_barrier_init (&b2, NULL, 2) != 0 || pthread_barrier_init (&bN, NULL, N + 1) != 0) { Jakub From jakub@redhat.com Wed Dec 1 10:48:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 01 Dec 2004 10:48:00 -0000 Subject: [PATCH] Remove nonnull from realpath Message-ID: <20041201104759.GM8259@sunsite.mff.cuni.cz> Hi! http://www.opengroup.org/onlinepubs/009695399/functions/realpath.html says that realpath (NULL, something) should NULL and set errno to EINVAL. Therefore calling this function with NULL argument is not undefined behaviour and nonnull attribute is not appropriate. test-canon.c: In function `do_test': test-canon.c:128: warning: null argument where non-null required (arg 1) 2004-12-01 Jakub Jelinek * stdlib/stdlib.h (realpath): Remove nonnull attribute. --- libc/stdlib/stdlib.h.jj 2004-11-26 10:16:32.000000000 +0100 +++ libc/stdlib/stdlib.h 2004-12-01 11:44:12.721671011 +0100 @@ -747,7 +747,7 @@ extern char *canonicalize_file_name (__c ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, returns the name in RESOLVED. */ extern char *realpath (__const char *__restrict __name, - char *__restrict __resolved) __THROW __nonnull ((1)); + char *__restrict __resolved) __THROW; #endif Jakub From ralf@linux-mips.org Wed Dec 1 11:48:00 2004 From: ralf@linux-mips.org (Ralf Baechle) Date: Wed, 01 Dec 2004 11:48:00 -0000 Subject: [RFC] Splitting kernel headers and deprecating __KERNEL__ In-Reply-To: <1101721336.21273.6138.camel@baythorne.infradead.org> References: <19865.1101395592@redhat.com> <20041125165433.GA2849@parcelfarce.linux.theplanet.co.uk> <1101406661.8191.9390.camel@hades.cambridge.redhat.com> <20041127032403.GB10536@kroah.com> <16810.24893.747522.656073@cargo.ozlabs.ibm.com> <1101721336.21273.6138.camel@baythorne.infradead.org> Message-ID: <20041201114622.GB4876@linux-mips.org> On Mon, Nov 29, 2004 at 09:42:16AM +0000, David Woodhouse wrote: > I've lost track of the number of times things have broken because of > incorrect use of kernel headers from userspace. That's what we're trying > to fix -- by putting only the bits which are _supposed_ to be visible > into files which userspace sees, where we know they define part of the > userspace API and hence we can be extremely careful when editing them. > > I don't think it makes sense at this point for us to bury our collective > heads in the sand and pretend there isn't a problem here that's worth > fixing. > > I agree that it should be obviously correct though -- and that's why > we're trying to end up with a structure that in the first pass would > give us in userspace essentially what we already have in the various > glibc-kernheaders packages, but without the constant and unnecessary > need for some poor sod to keep those up to date by hand. The concept of copying kernel headers into applications is even worse when arch portability is affected. I stopped counting how often I had to fix that kind of crap - and the state of kernel headers and userspace kernel header packages is really provoking that kind of mess. Ralf From aoliva@redhat.com Wed Dec 1 19:41:00 2004 From: aoliva@redhat.com (Alexandre Oliva) Date: Wed, 01 Dec 2004 19:41:00 -0000 Subject: [RFC] Splitting kernel headers and deprecating __KERNEL__ In-Reply-To: References: <19865.1101395592@redhat.com> <20041125165433.GA2849@parcelfarce.linux.theplanet.co.uk> <1101406661.8191.9390.camel@hades.cambridge.redhat.com> <20041127032403.GB10536@kroah.com> <16810.24893.747522.656073@cargo.ozlabs.ibm.com> Message-ID: On Nov 30, 2004, Linus Torvalds wrote: > On Tue, 30 Nov 2004, Alexandre Oliva wrote: >> On Nov 30, 2004, Linus Torvalds wrote: >> > If you want to use a legal analogy, the ABI is not a contract, it's a >> > public _license_. >> I didn't mean to use a legal analogy. I meant contract in the >> software engineering sense. Sorry if that wasn't clear. > Then your definition of a "contract" is flawed or your world-view has > nothing to do with reality. It's not my definition, it's a definition used in software engineering. Sure, if you ask a legal mind, you'll get a different answer. If you ask a bridge player, you'll get yet another definition. That's why we have jargons in which common-use words have their meanings narrowed to the specifics of certain fields. And that's why it's so hard for specialists in different fields to talk to each other at times when there's disagreement about the precise meaning of certain words. > An ABI is not a contract. Not a legal contract, for sure. An ABI is a definition of an interface, including operations with pre- and post-conditions, data structures with their invariants, constants, file formats, etc. Most of that is covered by the software engineering term `contract'. Sure enough, the headers we're talking about describe only a very small portion on that; pretty much only data structures and constants. It certainly doesn't *specify* the entire ABI, it only highlights portions of it. Anyhow, all of this is beyond the point. I see you've decreed that people can introduce `user' directories in the kernel now. Would you please reconsider and choose a dir name that would enable the same ABI headers to be used by kernel and userland, without adding a directory to /usr/include that has no indication that it comes from the kernel? Thanks, -- Alexandre Oliva http://www.ic.unicamp.br/~oliva/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org} From roland@redhat.com Wed Dec 1 19:54:00 2004 From: roland@redhat.com (Roland McGrath) Date: Wed, 01 Dec 2004 19:54:00 -0000 Subject: [PATCH] Remove nonnull from realpath In-Reply-To: Jakub Jelinek's message of Wednesday, 1 December 2004 11:47:59 +0100 <20041201104759.GM8259@sunsite.mff.cuni.cz> Message-ID: <200412011954.iB1Jsnc6004752@magilla.sf.frob.com> > 2004-12-01 Jakub Jelinek > > * stdlib/stdlib.h (realpath): Remove nonnull attribute. Applied. Thanks, Roland From roland@redhat.com Wed Dec 1 19:56:00 2004 From: roland@redhat.com (Roland McGrath) Date: Wed, 01 Dec 2004 19:56:00 -0000 Subject: [PATCH] Fix 2 issues found by valgrind In-Reply-To: Jakub Jelinek's message of Monday, 29 November 2004 18:58:41 +0100 <20041129175841.GI8259@sunsite.mff.cuni.cz> Message-ID: <200412011956.iB1Juj8e004792@magilla.sf.frob.com> I applied those fixes. Can you make publically visible somewhere the error reports you are looking into? If you have already classified some as false-positive, that is helpful for all to see as well. Thanks, Roland From roland@redhat.com Wed Dec 1 20:00:00 2004 From: roland@redhat.com (Roland McGrath) Date: Wed, 01 Dec 2004 20:00:00 -0000 Subject: [PATCH] Re: Whats up with _POSIX_CPUTIME In-Reply-To: Jakub Jelinek's message of Wednesday, 1 December 2004 11:41:55 +0100 <20041201104155.GL8259@sunsite.mff.cuni.cz> Message-ID: <200412012000.iB1K06bt004818@magilla.sf.frob.com> > Did you just mean the s/#if #defined/#if defined/ in posix/tst-regex2.c? > That's the only thing I found during testing... That's the only thing I noticed, but it indicated the patch wasn't tested. I don't like the __HAVE_CPUTIME stuff. Already on ia64 it is a runtime determination if the clocks are available. From jakub@redhat.com Wed Dec 1 20:20:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 01 Dec 2004 20:20:00 -0000 Subject: [PATCH] Re: Whats up with _POSIX_CPUTIME In-Reply-To: <200412012000.iB1K06bt004818@magilla.sf.frob.com> References: <20041201104155.GL8259@sunsite.mff.cuni.cz> <200412012000.iB1K06bt004818@magilla.sf.frob.com> Message-ID: <20041201202017.GN8259@sunsite.mff.cuni.cz> On Wed, Dec 01, 2004 at 12:00:06PM -0800, Roland McGrath wrote: > > Did you just mean the s/#if #defined/#if defined/ in posix/tst-regex2.c? > > That's the only thing I found during testing... > > That's the only thing I noticed, but it indicated the patch wasn't tested. > > I don't like the __HAVE_CPUTIME stuff. Already on ia64 it is a runtime > determination if the clocks are available. So should I redo that just to call __sysconf (_SC_{THREAD_,}CPUTIME)? Jakub From roland@redhat.com Wed Dec 1 20:22:00 2004 From: roland@redhat.com (Roland McGrath) Date: Wed, 01 Dec 2004 20:22:00 -0000 Subject: [PATCH] Re: Whats up with _POSIX_CPUTIME In-Reply-To: Jakub Jelinek's message of Wednesday, 1 December 2004 21:20:17 +0100 <20041201202017.GN8259@sunsite.mff.cuni.cz> Message-ID: <200412012022.iB1KMXkf012280@magilla.sf.frob.com> > On Wed, Dec 01, 2004 at 12:00:06PM -0800, Roland McGrath wrote: > > > Did you just mean the s/#if #defined/#if defined/ in posix/tst-regex2.c? > > > That's the only thing I found during testing... > > > > That's the only thing I noticed, but it indicated the patch wasn't tested. > > > > I don't like the __HAVE_CPUTIME stuff. Already on ia64 it is a runtime > > determination if the clocks are available. > > So should I redo that just to call __sysconf (_SC_{THREAD_,}CPUTIME)? I think so, yes. Or anyway, cope with runtime failures somehow. I'd have to look into the code closer to see if there is an obvious cheaper way to catch it. From jakub@redhat.com Wed Dec 1 21:11:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 01 Dec 2004 21:11:00 -0000 Subject: [PATCH] Re: Whats up with _POSIX_CPUTIME (take 2) In-Reply-To: <200412012022.iB1KMXkf012280@magilla.sf.frob.com> References: <20041201202017.GN8259@sunsite.mff.cuni.cz> <200412012022.iB1KMXkf012280@magilla.sf.frob.com> Message-ID: <20041201211137.GO8259@sunsite.mff.cuni.cz> On Wed, Dec 01, 2004 at 12:22:33PM -0800, Roland McGrath wrote: > > On Wed, Dec 01, 2004 at 12:00:06PM -0800, Roland McGrath wrote: > > > > Did you just mean the s/#if #defined/#if defined/ in posix/tst-regex2.c? > > > > That's the only thing I found during testing... > > > > > > That's the only thing I noticed, but it indicated the patch wasn't tested. > > > > > > I don't like the __HAVE_CPUTIME stuff. Already on ia64 it is a runtime > > > determination if the clocks are available. > > > > So should I redo that just to call __sysconf (_SC_{THREAD_,}CPUTIME)? > > I think so, yes. Or anyway, cope with runtime failures somehow. I'd have > to look into the code closer to see if there is an obvious cheaper way to > catch it. Well, upon closer inspection timer_create (the userland one) returns ENOTSUP whenever it sees CPU timer clocks (which is something that should be done whenever those CPU timer constants are in the headers, so defined _POSIX_*CPUTIME && _POSIX_*CPUTIME >= 0 is the right check here), but then later on has code to somehow handle it (but it can't work correctly, as the clocks are done in different thread). So here is another patch, mostly deleting one: 18 files changed, 54 insertions(+), 1185 deletions(-) 2004-12-01 Jakub Jelinek = 0 conditionals instead of defined _POSIX_CPUTIME. (main): If _POSIX_CPUTIME == 0, call sysconf to see if CPUTIME option is available. * posix/tst-regex.c2: Use defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 conditionals instead of defined _POSIX_CPUTIME. (do_test): If _POSIX_CPUTIME == 0, call sysconf to see if CPUTIME option is available. * sysdeps/posix/sysconf.c (__sysconf): If _POSIX_CPUTIME resp. _POSIX_THREAD_CPUTIME is defined to 0, return -1 for the corresponding _SC_ argument. nptl/ * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME, _POSIX_THREAD_CPUTIME): Define to 0. * sysdeps/pthread/timer_create.c (timer_create): Remove unused code handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID. * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk, __timer_signal_thread_tclk): Remove. (init_module): Remove their initialization. (thread_cleanup): Remove their cleanup assertions. * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk, __timer_signal_thread_tclk): Remove. * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed. linuxthreads/ * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME, _POSIX_THREAD_CPUTIME): Define to 0. * sysdeps/pthread/timer_create.c (timer_create): Remove unused code handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID. * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk, __timer_signal_thread_tclk): Remove. (init_module): Remove their initialization. (thread_cleanup): Remove their cleanup assertions. * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk, __timer_signal_thread_tclk): Remove. * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed. --- libc/posix/tst-regex.c.jj 2003-11-29 10:14:14.000000000 +0100 +++ libc/posix/tst-regex.c 2004-11-30 23:56:39.000000000 +0100 @@ -37,7 +37,7 @@ #include -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 static clockid_t cl; static int use_clock; #endif @@ -118,9 +118,14 @@ main (int argc, char *argv[]) if (inlen != 0) error (EXIT_FAILURE, errno, "cannot convert buffer"); -#ifdef _POSIX_CPUTIME - /* See whether we can use the CPU clock. */ - use_clock = clock_getcpuclockid (0, &cl) == 0; +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +# if _POSIX_CPUTIME == 0 + if (sysconf (_SC_CPUTIME) < 0) + use_clock = 0; + else +# endif + /* See whether we can use the CPU clock. */ + use_clock = clock_getcpuclockid (0, &cl) == 0; #endif #ifdef DEBUG @@ -202,7 +207,7 @@ static int run_test (const char *expr, const char *mem, size_t memlen, int icase, int expected) { -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 struct timespec start; struct timespec finish; #endif @@ -211,7 +216,7 @@ run_test (const char *expr, const char * size_t offset; int cnt; -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock && !timing) use_clock = clock_gettime (cl, &start) == 0; #endif @@ -260,7 +265,7 @@ run_test (const char *expr, const char * regfree (&re); -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock && !timing) { use_clock = clock_gettime (cl, &finish) == 0; @@ -345,7 +350,7 @@ static int run_test_backwards (const char *expr, const char *mem, size_t memlen, int icase, int expected) { -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 struct timespec start; struct timespec finish; #endif @@ -354,7 +359,7 @@ run_test_backwards (const char *expr, co size_t offset; int cnt; -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock && !timing) use_clock = clock_gettime (cl, &start) == 0; #endif @@ -406,7 +411,7 @@ run_test_backwards (const char *expr, co regfree (&re); -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock && !timing) { use_clock = clock_gettime (cl, &finish) == 0; --- libc/posix/tst-regex2.c.jj 2004-11-19 00:55:41.000000000 +0100 +++ libc/posix/tst-regex2.c 2004-12-01 10:50:35.000000000 +0100 @@ -8,7 +8,7 @@ #include #include -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 static clockid_t cl; static int use_clock; #endif @@ -16,9 +16,14 @@ static int use_clock; static int do_test (void) { -#ifdef _POSIX_CPUTIME - /* See whether we can use the CPU clock. */ - use_clock = clock_getcpuclockid (0, &cl) == 0; +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 +# if _POSIX_CPUTIME == 0 + if (sysconf (_SC_CPUTIME) < 0) + use_clock = 0; + else +# endif + /* See whether we can use the CPU clock. */ + use_clock = clock_getcpuclockid (0, &cl) == 0; #endif static const char *pat[] = { @@ -112,7 +117,7 @@ do_test (void) rpbuf.no_sub = 1; } -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 struct timespec start, stop; if (use_clock) use_clock = clock_gettime (cl, &start) == 0; @@ -211,7 +216,7 @@ do_test (void) } } -#ifdef _POSIX_CPUTIME +#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 if (use_clock) use_clock = clock_gettime (cl, &stop) == 0; if (use_clock) --- libc/sysdeps/posix/sysconf.c.jj 2004-11-28 17:36:05.000000000 +0100 +++ libc/sysdeps/posix/sysconf.c 2004-11-30 23:44:26.000000000 +0100 @@ -890,7 +890,7 @@ __sysconf (name) #endif case _SC_CPUTIME: -#ifdef _POSIX_CPUTIME +#if _POSIX_CPUTIME > 0 return _POSIX_CPUTIME; #else return -1; @@ -1055,7 +1055,7 @@ __sysconf (name) #endif case _SC_THREAD_CPUTIME: -#ifdef _POSIX_THREAD_CPUTIME +#if _POSIX_THREAD_CPUTIME > 0 return _POSIX_THREAD_CPUTIME; #else return -1; --- libc/nptl/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h 2004-12-01 00:03:11.000000000 +0100 @@ -1,178 +0,0 @@ -/* Define POSIX options for Linux. - Copyright (C) 1996-2001, 2002, 2003, 2004 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is supported. */ -#define _POSIX_THREAD_PROCESS_SHARED 200112L - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are available. */ -#define _POSIX_CLOCK_SELECTION 200112L - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection so far. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h 2004-12-01 00:02:49.000000000 +0100 @@ -104,6 +104,12 @@ /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200112L +/* CPU-time clocks support needs to be checked at runtime. */ +#define _POSIX_CPUTIME 0 + +/* Clock support in threads must be also checked at runtime. */ +#define _POSIX_THREAD_CPUTIME 0 + /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 --- libc/nptl/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h 2004-12-01 00:03:21.000000000 +0100 @@ -1,178 +0,0 @@ -/* Define POSIX options for Linux. - Copyright (C) 1996-2001, 2002, 2003, 2004 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is supported. */ -#define _POSIX_THREAD_PROCESS_SHARED 200112L - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are available. */ -#define _POSIX_CLOCK_SELECTION 200112L - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection so far. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h 2004-12-01 21:53:38.381596773 +0100 @@ -1,178 +0,0 @@ -/* Define POSIX options for Linux. - Copyright (C) 1996-2001, 2002, 2003, 2004 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is supported. */ -#define _POSIX_THREAD_PROCESS_SHARED 200112L - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are available. */ -#define _POSIX_CLOCK_SELECTION 200112L - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection so far. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/nptl/sysdeps/pthread/timer_routines.c.jj 2004-10-05 09:04:47.000000000 +0200 +++ libc/nptl/sysdeps/pthread/timer_routines.c 2004-12-01 21:42:29.527373273 +0100 @@ -53,12 +53,6 @@ int __timer_init_failed; /* Node for the thread used to deliver signals. */ struct thread_node __timer_signal_thread_rclk; -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 -struct thread_node __timer_signal_thread_pclk; -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 -struct thread_node __timer_signal_thread_tclk; -#endif /* Lists to keep free and used timers and threads. */ struct list_links timer_free_list; @@ -191,12 +185,6 @@ init_module (void) list_append (&thread_free_list, &thread_array[i].links); thread_init (&__timer_signal_thread_rclk, 0, CLOCK_REALTIME); -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 - thread_init (&__timer_signal_thread_pclk, 0, CLOCK_PROCESS_CPUTIME_ID); -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 - thread_init (&__timer_signal_thread_tclk, 0, CLOCK_THREAD_CPUTIME_ID); -#endif } @@ -281,12 +269,6 @@ thread_cleanup (void *val) /* How did the signal thread get killed? */ assert (thread != &__timer_signal_thread_rclk); -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 - assert (thread != &__timer_signal_thread_pclk); -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 - assert (thread != &__timer_signal_thread_tclk); -#endif pthread_mutex_lock (&__timer_mutex); --- libc/nptl/sysdeps/pthread/posix-timer.h.jj 2004-10-05 09:04:47.000000000 +0200 +++ libc/nptl/sysdeps/pthread/posix-timer.h 2004-12-01 21:43:23.559672235 +0100 @@ -88,16 +88,8 @@ extern pthread_once_t __timer_init_once_ /* Nonzero if initialization of timer implementation failed. */ extern int __timer_init_failed; -/* Nodes for the threads used to deliver signals. */ -/* A distinct thread is used for each clock type. */ - +/* Node for the thread used to deliver signals. */ extern struct thread_node __timer_signal_thread_rclk; -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 -extern struct thread_node __timer_signal_thread_pclk; -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 -extern struct thread_node __timer_signal_thread_tclk; -#endif /* Return pointer to timer structure corresponding to ID. */ --- libc/nptl/sysdeps/pthread/timer_create.c.jj 2004-10-05 19:45:02.000000000 +0200 +++ libc/nptl/sysdeps/pthread/timer_create.c 2004-12-01 21:41:39.317391709 +0100 @@ -94,24 +94,7 @@ timer_create (clock_id, evp, timerid) case SIGEV_SIGNAL: /* We have a global thread for delivering timed signals. If it is not running, try to start it up. */ - switch (clock_id) - { - case CLOCK_REALTIME: - default: - thread = &__timer_signal_thread_rclk; - break; -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 - case CLOCK_PROCESS_CPUTIME_ID: - thread = &__timer_signal_thread_pclk; - break; -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 - case CLOCK_THREAD_CPUTIME_ID: - thread = &__timer_signal_thread_tclk; - break; -#endif - } - + thread = &__timer_signal_thread_rclk; if (! thread->exists) { if (__builtin_expect (__timer_thread_start (thread), --- libc/linuxthreads/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h.jj 2004-11-28 17:37:40.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h 2004-12-01 00:01:34.000000000 +0100 @@ -1,181 +0,0 @@ -/* Define POSIX options for Linux/ix86. - Copyright (C) 1996-2001, 2002, 2003, 2004 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* X/Open realtime thread support is available. */ -#define _XOPEN_REALTIME_THREADS 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores, but only the non-shared form for now. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is not supported. */ -#define _POSIX_THREAD_PROCESS_SHARED -1 - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are not available. */ -#define _POSIX_CLOCK_SELECTION -1 - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/linuxthreads/sysdeps/unix/sysv/linux/bits/posix_opt.h.jj 2004-11-28 17:37:40.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/bits/posix_opt.h 2004-12-01 21:52:26.804404860 +0100 @@ -107,6 +107,12 @@ /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200112L +/* CPU-time clocks support needs to be checked at runtime. */ +#define _POSIX_CPUTIME 0 + +/* Clock support in threads must be also checked at runtime. */ +#define _POSIX_THREAD_CPUTIME 0 + /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 --- libc/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h 2004-12-01 00:02:03.000000000 +0100 @@ -1,181 +0,0 @@ -/* Define POSIX options for Linux/ia64. - Copyright (C) 1996-2001, 2002, 2003, 2004 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* X/Open realtime thread support is available. */ -#define _XOPEN_REALTIME_THREADS 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores, but only the non-shared form for now. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is not supported. */ -#define _POSIX_THREAD_PROCESS_SHARED -1 - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are not available. */ -#define _POSIX_CLOCK_SELECTION -1 - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h.jj 2004-11-28 17:37:41.000000000 +0100 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h 2004-12-01 00:02:14.000000000 +0100 @@ -1,181 +0,0 @@ -/* Define POSIX options for Linux/x86_64. - Copyright (C) 1996-2001, 2002, 2003, 2004 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 - -/* Job control is supported. */ -#define _POSIX_JOB_CONTROL 1 - -/* Processes have a saved set-user-ID and a saved set-group-ID. */ -#define _POSIX_SAVED_IDS 1 - -/* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L - -/* The fsync function is present. */ -#define _POSIX_FSYNC 200112L - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `c_cc' member of 'struct termios' structure can be disabled by - using the value _POSIX_VDISABLE. */ -#define _POSIX_VDISABLE '\0' - -/* Filenames are not silently truncated. */ -#define _POSIX_NO_TRUNC 1 - -/* X/Open realtime support is available. */ -#define _XOPEN_REALTIME 1 - -/* X/Open realtime thread support is available. */ -#define _XOPEN_REALTIME_THREADS 1 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -/* Tell we have POSIX threads. */ -#define _POSIX_THREADS 200112L - -/* We have the reentrant functions described in POSIX. */ -#define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -/* We provide priority scheduling for threads. */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L - -/* We support user-defined stack sizes. */ -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - -/* We support user-defined stacks. */ -#define _POSIX_THREAD_ATTR_STACKADDR 200112L - -/* We support POSIX.1b semaphores, but only the non-shared form for now. */ -#define _POSIX_SEMAPHORES 200112L - -/* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L - -/* We support asynchronous I/O. */ -#define _POSIX_ASYNCHRONOUS_IO 200112L -#define _POSIX_ASYNC_IO 1 -/* Alternative name for Unix98. */ -#define _LFS_ASYNCHRONOUS_IO 1 -/* Support for prioritization is also available. */ -#define _POSIX_PRIORITIZED_IO 200112L - -/* The LFS support in asynchronous I/O is also available. */ -#define _LFS64_ASYNCHRONOUS_IO 1 - -/* The rest of the LFS is also available. */ -#define _LFS_LARGEFILE 1 -#define _LFS64_LARGEFILE 1 -#define _LFS64_STDIO 1 - -/* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L - -/* CPU-time clocks supported. */ -#define _POSIX_CPUTIME 0 - -/* We support the clock also in threads. */ -#define _POSIX_THREAD_CPUTIME 0 - -/* GNU libc provides regular expression handling. */ -#define _POSIX_REGEXP 1 - -/* Reader/Writer locks are available. */ -#define _POSIX_READER_WRITER_LOCKS 200112L - -/* We have a POSIX shell. */ -#define _POSIX_SHELL 1 - -/* We support the Timeouts option. */ -#define _POSIX_TIMEOUTS 200112L - -/* We support spinlocks. */ -#define _POSIX_SPIN_LOCKS 200112L - -/* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L - -/* We have POSIX timers. */ -#define _POSIX_TIMERS 200112L - -/* The barrier functions are available. */ -#define _POSIX_BARRIERS 200112L - -/* POSIX message queues are available. */ -#define _POSIX_MESSAGE_PASSING 200112L - -/* Thread process-shared synchronization is not supported. */ -#define _POSIX_THREAD_PROCESS_SHARED -1 - -/* The monotonic clock might be available. */ -#define _POSIX_MONOTONIC_CLOCK 0 - -/* The clock selection interfaces are not available. */ -#define _POSIX_CLOCK_SELECTION -1 - -/* Advisory information interfaces are available. */ -#define _POSIX_ADVISORY_INFO 200112L - -/* IPv6 support is available. */ -#define _POSIX_IPV6 200112L - -/* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L - -/* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L - -/* Neither process nor thread sporadic server interfaces is available. */ -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_THREAD_SPORADIC_SERVER -1 - -/* trace.h is not available. */ -#define _POSIX_TRACE -1 -#define _POSIX_TRACE_EVENT_FILTER -1 -#define _POSIX_TRACE_INHERIT -1 -#define _POSIX_TRACE_LOG -1 - -/* Typed memory objects are not available. */ -#define _POSIX_TYPED_MEMORY_OBJECTS -1 - -/* No support for priority inheritance or protection. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - -#endif /* posix_opt.h */ --- libc/linuxthreads/sysdeps/pthread/timer_routines.c.jj 2004-04-21 10:06:01.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/timer_routines.c 2004-12-01 21:53:01.994107891 +0100 @@ -52,12 +52,6 @@ int __timer_init_failed; /* Node for the thread used to deliver signals. */ struct thread_node __timer_signal_thread_rclk; -#ifdef _POSIX_CPUTIME -struct thread_node __timer_signal_thread_pclk; -#endif -#ifdef _POSIX_THREAD_CPUTIME -struct thread_node __timer_signal_thread_tclk; -#endif /* Lists to keep free and used timers and threads. */ struct list_links timer_free_list; @@ -190,12 +184,6 @@ init_module (void) list_append (&thread_free_list, &thread_array[i].links); thread_init (&__timer_signal_thread_rclk, 0, CLOCK_REALTIME); -#ifdef _POSIX_CPUTIME - thread_init (&__timer_signal_thread_pclk, 0, CLOCK_PROCESS_CPUTIME_ID); -#endif -#ifdef _POSIX_THREAD_CPUTIME - thread_init (&__timer_signal_thread_tclk, 0, CLOCK_THREAD_CPUTIME_ID); -#endif } @@ -280,12 +268,6 @@ thread_cleanup (void *val) /* How did the signal thread get killed? */ assert (thread != &__timer_signal_thread_rclk); -#ifdef _POSIX_CPUTIME - assert (thread != &__timer_signal_thread_pclk); -#endif -#ifdef _POSIX_THREAD_CPUTIME - assert (thread != &__timer_signal_thread_tclk); -#endif pthread_mutex_lock (&__timer_mutex); --- libc/linuxthreads/sysdeps/pthread/posix-timer.h.jj 2002-08-27 00:39:43.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/posix-timer.h 2004-12-01 21:46:25.773022947 +0100 @@ -1,5 +1,5 @@ /* Definitions for POSIX timer implementation on top of LinuxThreads. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kaz Kylheku . @@ -85,12 +85,6 @@ extern int __timer_init_failed; /* A distinct thread is used for each clock type. */ extern struct thread_node __timer_signal_thread_rclk; -#ifdef _POSIX_CPUTIME -extern struct thread_node __timer_signal_thread_pclk; -#endif -#ifdef _POSIX_THREAD_CPUTIME -extern struct thread_node __timer_signal_thread_tclk; -#endif /* Return pointer to timer structure corresponding to ID. */ --- libc/linuxthreads/sysdeps/pthread/timer_create.c.jj 2004-04-21 10:06:01.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/timer_create.c 2004-12-01 21:45:19.678856310 +0100 @@ -94,24 +94,7 @@ timer_create (clock_id, evp, timerid) case SIGEV_SIGNAL: /* We have a global thread for delivering timed signals. If it is not running, try to start it up. */ - switch (clock_id) - { - case CLOCK_REALTIME: - default: - thread = &__timer_signal_thread_rclk; - break; -#ifdef _POSIX_CPUTIME - case CLOCK_PROCESS_CPUTIME_ID: - thread = &__timer_signal_thread_pclk; - break; -#endif -#ifdef _POSIX_THREAD_CPUTIME - case CLOCK_THREAD_CPUTIME_ID: - thread = &__timer_signal_thread_tclk; - break; -#endif - } - + thread = &__timer_signal_thread_rclk; if (! thread->exists) { if (__builtin_expect (__timer_thread_start (thread), --- libc/linuxthreads/tst-clock1.c.jj 2004-07-09 01:44:50.000000000 +0200 +++ libc/linuxthreads/tst-clock1.c 2004-11-30 23:59:30.000000000 +0100 @@ -25,7 +25,7 @@ #include -#if _POSIX_THREAD_CPUTIME +#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 static pthread_barrier_t b2; static pthread_barrier_t bN; @@ -55,9 +55,17 @@ tf (void *arg) int do_test (void) { -#if _POSIX_THREAD_CPUTIME +#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 # define N 10 +# if _POSIX_THREAD_CPUTIME == 0 + if (sysconf (_SC_THREAD_CPUTIME) < 0) + { + puts ("_POSIX_THREAD_CPUTIME option not available"); + return 0; + } +# endif + if (pthread_barrier_init (&b2, NULL, 2) != 0 || pthread_barrier_init (&bN, NULL, N + 1) != 0) { Jakub From jakub@redhat.com Wed Dec 1 21:19:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 01 Dec 2004 21:19:00 -0000 Subject: [PATCH] Fix 2 issues found by valgrind In-Reply-To: <200412011956.iB1Juj8e004792@magilla.sf.frob.com> References: <20041129175841.GI8259@sunsite.mff.cuni.cz> <200412011956.iB1Juj8e004792@magilla.sf.frob.com> Message-ID: <20041201211914.GP8259@sunsite.mff.cuni.cz> On Wed, Dec 01, 2004 at 11:56:45AM -0800, Roland McGrath wrote: > I applied those fixes. Can you make publically visible somewhere the > error reports you are looking into? If you have already classified some as > false-positive, that is helpful for all to see as well. The false positives are e.g. in tst-fmemopen and several others (see attached valgrind-bug2.c for simplified testcase): Another one is: ==12068== Conditional jump or move depends on uninitialised value(s) ==12068== at 0x1B9A2A0B: re_compile_fastmap_iter (regcomp.c:356) ==12068== by 0x1B9A2E9B: re_compile_fastmap (regcomp.c:301) ==12068== by 0x1B9AC671: regcomp (regcomp.c:515) ==12068== by 0x8048C73: test (tst-rxspencer.c:214) (see attached valgrind-bug1.c). Anything with -lpthread apparently can't be trusted with valgrind, as valgrind's -lpthread is very incomplete and not compatible with NPTL libc.so. Then there are things like: ==15623== Syscall param sigqueueinfo(uinfo) contains uninitialised or unaddressable byte(s) ==15623== at 0x1B90BFE7: __aio_sigqueue (aio_sigqueue.c:51) ==15623== by 0x1B90C0F5: __aio_notify_only (aio_notify.c:108) ==15623== by 0x1B90C209: __aio_notify (aio_notify.c:160) ==15623== by 0x1B90AD89: handle_fildes_io (aio_misc.c:595) ==15623== Address 0x1BF87D37 is on thread 2's stack ==15702== Syscall param timer_create(evp) contains uninitialised or unaddressable byte(s) ==15702== at 0x1B90CCA4: timer_create (timer_create.c:91) ==15702== by 0x8048BBF: do_timer_create (tst-timer3.c:22) ==15702== by 0x1B922925: thread_wrapper (vg_libpthread.c:867) ==15702== by 0xB000F14F: do__quit (vg_scheduler.c:1872) ==15702== Address 0x52BFDC44 is on thread 1's stack ==15866== Syscall param socketcall.sendto(msg) contains uninitialised or unaddressable byte(s) ==15866== at 0x1B9D3731: sendto (socket.S:65) ==15866== by 0x1B9EEAA2: if_nameindex (if_index.c:192) ==15866== by 0x80485F4: main (test_ifindex.c:31) ==15866== Address 0x52BFDC0D is on thread 1's stack ==15866== ==15866== Syscall param ioctl(SIOCGIFNAME) contains uninitialised or unaddressable byte(s) ==15866== at 0x1B9CA959: ioctl (in /usr/src/libc/obj32/libc.so) ==15866== by 0x8048663: main (test_ifindex.c:52) ==15866== Address 0x1 is not stack'd, malloc'd or (recently) free'd ==15881== Syscall param socketcall.sendto(msg) contains uninitialised or unaddressable byte(s) ==15881== at 0x1B9D3731: sendto (socket.S:65) ==15881== by 0x1B9EF35F: getifaddrs (ifaddrs.c:292) ==15881== by 0x8048559: main (test-ifaddrs.c:70) ==15881== Address 0x52BFDADD is on thread 1's stack ==15881== ==15881== Syscall param socketcall.sendto(msg) contains uninitialised or unaddressable byte(s) ==15881== at 0x1B9D3731: sendto (socket.S:65) ==15881== by 0x1B9EF397: getifaddrs (ifaddrs.c:310) ==15881== by 0x8048559: main (test-ifaddrs.c:70) ==15881== Address 0x52BFDADD is on thread 1's stack etc. Jakub -------------- next part -------------- /* gcc34 -m32 -O2 -march=i386 -mtune=pentium4 */ #include struct S { unsigned int s1 : 8, s2 : 10; unsigned int s3 : 1, s4 : 1, s5 : 1, s6 : 1; }; int test (struct S *s, int n) { int i, ret; i = 0, ret = 0; while (++i < n && s[i].s1 == 1 && s[i].s5) ++ret; return ret; } int main (void) { struct S *s = malloc (4 * sizeof (struct S)); int i; for (i = 0; i < 4; ++i) { s[i].s1 = (i + 2) / 2; if (i < 2) s[i].s5 = 1; } return test (s, 4) != 1; } -------------- next part -------------- /* gcc34 -m32 -O2 -march=i686 */ #include #include #include int main (void) { const char blah[] = "BLAH"; FILE *fp; if ((fp = fopen ("test-1", "w+")) == NULL) exit (1); if (fwrite (blah, 1, strlen (blah), fp) != strlen (blah)) exit (2); return 0; } From roland@redhat.com Wed Dec 1 23:56:00 2004 From: roland@redhat.com (Roland McGrath) Date: Wed, 01 Dec 2004 23:56:00 -0000 Subject: [PATCH] Fix 2 issues found by valgrind In-Reply-To: Jakub Jelinek's message of Wednesday, 1 December 2004 22:19:14 +0100 <20041201211914.GP8259@sunsite.mff.cuni.cz> Message-ID: <200412012356.iB1Nu566032141@magilla.sf.frob.com> > ==15623== Syscall param sigqueueinfo(uinfo) contains uninitialised or unaddressable byte(s) Is there a valgrind FAQ that mentions this? These are all true false-positive cases. i.e., the kernel does not examine the uninitialized areas. From jakub@redhat.com Thu Dec 2 13:22:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 02 Dec 2004 13:22:00 -0000 Subject: [testcase] Another ungetc related bug Message-ID: <20041202132226.GR8259@sunsite.mff.cuni.cz> Hi! This testcase fails 0 1 3 4 tests with current CVS; before my ~ month old fixes failed just 1 3 4 tests. So far I just saw that the cause is probably because read_base is not restored through _IO_switch_to_main_get_area to its value before pushbackc. 2004-12-02 Jakub Jelinek * libio/Makefile (tests): Add bug-ungetc4. * libio/bug-ungetc4.c: New test. --- libc/libio/Makefile.jj 2004-11-09 12:26:42.000000000 +0100 +++ libc/libio/Makefile 2004-12-02 14:16:13.695118870 +0100 @@ -54,7 +54,7 @@ tests = tst_swprintf tst_wprintf tst_sws tst-freopen bug-rewind bug-rewind2 bug-ungetc bug-fseek \ tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \ tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \ - bug-ungetc2 bug-ftell bug-ungetc3 + bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 test-srcs = test-freopen all: # Make this the default target; it will be defined in Rules. --- libc/libio/bug-ungetc4.c.jj 2004-12-02 14:01:35.430096555 +0100 +++ libc/libio/bug-ungetc4.c 2004-12-02 14:14:05.447038236 +0100 @@ -0,0 +1,116 @@ +/* Test program for ungetc/fseekpos interaction. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2004. + + 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 + +static void do_prepare (void); +#define PREPARE(argc, argv) do_prepare () +static int do_test (void); +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" + +static const char pattern[] = "abcdefghijklmnopqrstuvwxyz"; +static char *temp_file; + +static void +do_prepare (void) +{ + int fd = create_temp_file ("bug-ungetc.", &temp_file); + if (fd == -1) + { + printf ("cannot create temporary file: %m\n"); + exit (1); + } + write (fd, pattern, sizeof (pattern)); + close (fd); +} + +#define TEST_POS 5 + +static int +do_one_test (int mode) +{ + FILE *f = fopen (temp_file, "r"); + if (f == NULL) + { + printf ("%d: could not open temporary file: %m\n", mode); + return 1; + } + + int i; + for (i = 0; i < TEST_POS; ++i) + getc (f); + + fpos_t p; + if (fgetpos (f, &p) != 0) + { + printf ("%d: fgetpos failed: %m\n", mode); + return 1; + } + + if (mode) + { + if (fseek (f, 0, SEEK_SET) != 0) + { + printf ("%d: fseek failed: %m\n", mode); + return 1; + } + + for (i = 0; i < TEST_POS - (mode >= 2); ++i) + getc (f); + } + + if (mode != 2 && ungetc ('X', f) != 'X') + { + printf ("%d: ungetc failed\n", mode); + return 1; + } + + if (mode == 3 && getc (f) != 'X') + { + printf ("%d: getc after ungetc did not return X\n", mode); + return 1; + } + + if (fsetpos (f, &p) != 0) + { + printf ("%d: fsetpos failed: %m\n", mode); + return 1; + } + + if (getc (f) != pattern[TEST_POS]) + { + printf ("%d: getc did not return %c\n", mode, pattern[TEST_POS]); + return 1; + } + + fclose (f); + + return 0; +} + +static int +do_test (void) +{ + int mode, ret = 0; + for (mode = 0; mode <= 4; mode++) + ret |= do_one_test (mode); + return ret; +} Jakub From jakub@redhat.com Thu Dec 2 18:30:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 02 Dec 2004 18:30:00 -0000 Subject: [PATCH] Fix mktime Message-ID: <20041202182942.GA5149@sunsite.mff.cuni.cz> Hi! The latest changes in mktime apparently broke mktime when tm_sec is < 0 or >= 60. mktime returns as if the tm_sec given was 0 resp. 59. 2004-12-01 Jakub Jelinek * time/mktime.c (__mktime_internal): If sec_requested != sec, convert t2, not t. * time/Makefile (tests): Add tst-mktime3. * time/tst-mktime3.c: New test. --- libc/time/Makefile.jj 2004-11-01 13:25:55.000000000 +0100 +++ libc/time/Makefile 2004-12-02 19:03:43.945786121 +0100 @@ -34,7 +34,8 @@ aux := era alt_digit lc-time-cleanup distribute := datemsk tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ - tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime + tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \ + tst-mktime3 include ../Rules --- libc/time/mktime.c.jj 2004-11-12 13:58:25.000000000 +0100 +++ libc/time/mktime.c 2004-12-02 19:24:16.362448335 +0100 @@ -463,8 +463,9 @@ __mktime_internal (struct tm *tp, t2 = t1 + sec_adjustment; if (((t1 < t) != (sec_requested < 0)) | ((t2 < t1) != (sec_adjustment < 0)) - | ! (*convert) (&t, &tm)) + | ! (*convert) (&t2, &tm)) return -1; + t = t2; } *tp = tm; --- libc/time/tst-mktime3.c.jj 2004-12-02 19:00:40.590492064 +0100 +++ libc/time/tst-mktime3.c 2004-12-02 19:15:16.564452958 +0100 @@ -0,0 +1,48 @@ +#include +#include +#include + +struct tm tests[] = +{ + { .tm_sec = -1, .tm_mday = 1, .tm_year = 104 }, + { .tm_sec = 65, .tm_min = 59, .tm_hour = 23, .tm_mday = 31, + .tm_mon = 11, .tm_year = 101 } +}; +struct tm expected[] = +{ + { .tm_sec = 59, .tm_min = 59, .tm_hour = 23, .tm_mday = 31, + .tm_mon = 11, .tm_year = 103, .tm_wday = 3, .tm_yday = 364 }, + { .tm_sec = 5, .tm_mday = 1, .tm_year = 102, .tm_wday = 2 } +}; + +int +main (void) +{ + setenv ("TZ", "UTC", 1); + int i; + for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) + { + if (mktime (&tests[i]) < 0) + { + printf ("mktime %d failed\n", i); + return 1; + } +#define CHECK(name) \ + if (tests[i].name != expected[i].name) \ + { \ + printf ("test %d " #name " got %d expected %d\n", \ + i, tests[i].name, expected[i].name); \ + return 1; \ + } + CHECK (tm_sec) + CHECK (tm_min) + CHECK (tm_hour) + CHECK (tm_mday) + CHECK (tm_mon) + CHECK (tm_year) + CHECK (tm_wday) + CHECK (tm_yday) + CHECK (tm_isdst) + } + return 0; +} Jakub From roland@redhat.com Thu Dec 2 22:18:00 2004 From: roland@redhat.com (Roland McGrath) Date: Thu, 02 Dec 2004 22:18:00 -0000 Subject: [PATCH] Fix mktime In-Reply-To: Jakub Jelinek's message of Thursday, 2 December 2004 19:29:42 +0100 <20041202182942.GA5149@sunsite.mff.cuni.cz> Message-ID: <200412022218.iB2MI15g023258@magilla.sf.frob.com> > 2004-12-01 Jakub Jelinek > > * time/mktime.c (__mktime_internal): If sec_requested != sec, > convert t2, not t. > * time/Makefile (tests): Add tst-mktime3. > * time/tst-mktime3.c: New test. Applied. Thanks, Roland From drepper@redhat.com Sun Dec 5 23:04:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 05 Dec 2004 23:04:00 -0000 Subject: Remove unused elements from yp_2_yperr In-Reply-To: References: Message-ID: <41B393CC.8070703@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Applied. - -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFBs5PM2ijCOnn/RHQRAjexAJ9b4vBCOQlNXMPWMbbnYzk45RTYPwCgpmaA CkN+p4wu+dNFiwO/Xcxx//8= =eufR -----END PGP SIGNATURE----- From drepper@redhat.com Mon Dec 6 05:03:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 06 Dec 2004 05:03:00 -0000 Subject: simplify assertion check in _dl_fini() In-Reply-To: References: Message-ID: <41B3E7F5.4080007@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Why should runtime overhead be added just to simplify asserts which are not present in final binaries? The patch is completely bogus. - -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFBs+f12ijCOnn/RHQRAl8IAJ45Lj05u4EwY3v+1CPJKTOqzf7V3ACfcorm EJF9eprATdoMyXwkjN/1quk= =qqth -----END PGP SIGNATURE----- From drepper@redhat.com Mon Dec 6 05:04:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 06 Dec 2004 05:04:00 -0000 Subject: DTV_AT_TP _dl_determine_tlsoffset often doesn't use free gap In-Reply-To: References: Message-ID: <41B3E822.7060003@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 How about checking the cvs code first? - -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFBs+gi2ijCOnn/RHQRAvahAJ9cnFOpCJouyDOhUWQ7FETG2YDEMgCfdkJR 6wQAUaiFlEYoKYAd1lTi06w= =p3uA -----END PGP SIGNATURE----- From aoliva@redhat.com Mon Dec 6 21:14:00 2004 From: aoliva@redhat.com (Alexandre Oliva) Date: Mon, 06 Dec 2004 21:14:00 -0000 Subject: simplify assertion check in _dl_fini() In-Reply-To: <41B3E7F5.4080007@redhat.com> References: <41B3E7F5.4080007@redhat.com> Message-ID: On Dec 6, 2004, Ulrich Drepper wrote: > Why should runtime overhead be added just to simplify asserts which are > not present in final binaries? To keep the data structure consistent before the inconsistency actually bites? -- Alexandre Oliva http://www.ic.unicamp.br/~oliva/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org} From aoliva@redhat.com Mon Dec 6 21:15:00 2004 From: aoliva@redhat.com (Alexandre Oliva) Date: Mon, 06 Dec 2004 21:15:00 -0000 Subject: DTV_AT_TP _dl_determine_tlsoffset often doesn't use free gap In-Reply-To: <41B3E822.7060003@redhat.com> References: <41B3E822.7060003@redhat.com> Message-ID: On Dec 6, 2004, Ulrich Drepper wrote: > How about checking the cvs code first? Oops, sorry. I expected to get a reply saying it was applied, like you seem to post for others that don't have CVS write access. -- Alexandre Oliva http://www.ic.unicamp.br/~oliva/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org} From drepper@redhat.com Mon Dec 6 22:41:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 06 Dec 2004 22:41:00 -0000 Subject: [testcase] Another ungetc related bug In-Reply-To: <20041202132226.GR8259@sunsite.mff.cuni.cz> References: <20041202132226.GR8259@sunsite.mff.cuni.cz> Message-ID: <41B4DFD3.9030005@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Applied, and t he bug is fixed. - -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFBtN/T2ijCOnn/RHQRApm5AJ9YGFfNCcs8sDotiwOW8NafHzHMwgCfUMQ/ ZaW3nBofQBZ7/SyWXLOyQAU= =HhRV -----END PGP SIGNATURE----- From jakub@redhat.com Mon Dec 6 22:45:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 06 Dec 2004 22:45:00 -0000 Subject: [PATCH] For bogus TZ values use offset 0 rather than 1 or -1 Message-ID: <20041206224517.GC5149@sunsite.mff.cuni.cz> Hi! For say TZ=FOOT+X or TZ=BAR- tzset doesn't use UTC, but offset -1L resp. 1L. While user's shouldn't expect anything particular in that case, I think it is better to clear offset if the sscanf after first + or - fails. 2004-12-06 Jakub Jelinek * time/tzset.c (tzset_internal): If + or - is seen, but no offset after it, reset offset to 0. [BZ #601] --- libc/time/tzset.c.jj 2004-09-16 11:35:42.000000000 +0200 +++ libc/time/tzset.c 2004-12-06 23:07:17.034717956 +0100 @@ -240,6 +240,7 @@ tzset_internal (always, explicit) switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss)) { default: + tz_rules[0].offset = 0; goto out; case 1: mm = 0; Jakub From drepper@redhat.com Mon Dec 6 22:51:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 06 Dec 2004 22:51:00 -0000 Subject: [PATCH] For bogus TZ values use offset 0 rather than 1 or -1 In-Reply-To: <20041206224517.GC5149@sunsite.mff.cuni.cz> References: <20041206224517.GC5149@sunsite.mff.cuni.cz> Message-ID: <41B4E243.8010205@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Applied. - -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFBtOJD2ijCOnn/RHQRAvdkAKCBu+6XNC5fjaLsxlMy3J6FZMaG2ACgpuDn sHQ+OTvuMe6S/RxisYuNnQ4= =4Z4r -----END PGP SIGNATURE----- From kkojima@rr.iij4u.or.jp Tue Dec 7 13:38:00 2004 From: kkojima@rr.iij4u.or.jp (Kaz Kojima) Date: Tue, 07 Dec 2004 13:38:00 -0000 Subject: [PATCH] SH: Fixup clone for NPTL Message-ID: <20041207.223723.104056124.kkojima@rr.iij4u.or.jp> Hi, The appended patch is an SH version of the change done in x86 clone.S. I've also found that the frame pointer wasn't cleared at the begining of the new thread. Regards, kaz -- [nptl/ChangeLog] 2004-12-07 Kaz Kojima * sysdeps/unix/sysv/linux/sh/clone.S: New file. [ChangeLog] 2004-12-07 Kaz Kojima * sysdeps/unix/sysv/linux/sh/clone.S: Clear the frame pointer when starting a new thread. Add support for NPTL where the PID is stored at userlevel and needs to be reset when CLONE_THREAD is not used. diff -u3prN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/clone.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/clone.S --- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/clone.S Thu Jan 1 09:00:00 1970 +++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/clone.S Tue Dec 7 09:40:56 2004 @@ -0,0 +1,2 @@ +#define RESET_PID +#include diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/sh/clone.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/clone.S --- ORIG/libc/sysdeps/unix/sysv/linux/sh/clone.S Tue Feb 11 14:29:43 2003 +++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/clone.S Tue Dec 7 10:49:02 2004 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2003, 2004 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 @@ -22,11 +22,13 @@ #include #define _ERRNO_H 1 #include - +#ifdef RESET_PID +#include +#endif /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, pid_t *ptid, void *tls, pid_t *ctid); */ - .text + .text ENTRY(__clone) /* sanity check arguments. */ tst r4, r4 @@ -64,6 +66,31 @@ ENTRY(__clone) rts nop 2: + /* terminate the stack frame */ + mov #0, r14 +#ifdef RESET_PID + mov r4, r0 + shlr16 r0 + tst #1, r0 // CLONE_THREAD = (1 << 16) + bf/s 4f + mov r4, r0 + /* new pid */ + shlr8 r0 + tst #1, r0 // CLONE_VM = (1 << 8) + bf/s 3f + mov #-1, r0 + mov #+SYS_ify(getpid), r3 + trapa #0x15 +3: + stc gbr, r1 + mov.w .Lpidoff, r2 + add r1, r2 + mov.l r0, @r2 + mov.w .Ltidoff, r2 + add r1, r2 + mov.l r0, @r2 +4: +#endif /* thread starts */ mov.l @r15, r1 jsr @r1 @@ -94,6 +121,12 @@ ENTRY(__clone) .long _GLOBAL_OFFSET_TABLE_ .L3: .long PLTJMP(C_SYMBOL_NAME(_exit)) +#ifdef RESET_PID +.Lpidoff: + .word PID - TLS_PRE_TCB_SIZE +.Ltidoff: + .word TID - TLS_PRE_TCB_SIZE +#endif PSEUDO_END (__clone) weak_alias (__clone, clone) From drepper@redhat.com Tue Dec 7 19:40:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 07 Dec 2004 19:40:00 -0000 Subject: [PATCH] SH: Fixup clone for NPTL In-Reply-To: <20041207.223723.104056124.kkojima@rr.iij4u.or.jp> References: <20041207.223723.104056124.kkojima@rr.iij4u.or.jp> Message-ID: <41B606E2.6090603@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Applied. - -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFBtgbi2ijCOnn/RHQRAlG4AJsE5K5e0wDaDV/TUZmupA69CvKOdgCgqwRP 3HM6vyecmDcYuvbiYh8zBQ4= =U6jD -----END PGP SIGNATURE----- From jakub@redhat.com Tue Dec 7 20:08:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 07 Dec 2004 20:08:00 -0000 Subject: [PATCH] Fix ia64 clone2 Message-ID: <20041207200608.GD5149@sunsite.mff.cuni.cz> Hi! Besides adding the RESET_PID stuff, this patch also fixes the _exit call if function passed to clone2 ever returns (before gp was not restored and thus _exit segfaulted). 2004-12-07 Jakub Jelinek * sysdeps/unix/sysv/linux/ia64/clone2.S (__clone2): Add support for NPTL where the PID is stored at userlevel and needs to be reset when CLONE_THREAD is not used. Restore gp before calling _exit. nptl/ * sysdeps/ia64/tcb-offsets.sym (TID): Add. * sysdeps/unix/sysv/linux/ia64/clone2.S: New file. * Makefile (tests): Add tst-getpid2.c. * tst-getpid1.c (TEST_CLONE_FLAGS): Define. (do_test): Use it. Use __clone2 instead of clone on ia64. * tst-getpid2.c: New test. --- libc/sysdeps/unix/sysv/linux/ia64/clone2.S.jj 2004-04-28 20:39:49.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/ia64/clone2.S 2004-12-07 14:23:52.971586610 +0100 @@ -30,7 +30,7 @@ ENTRY(__clone2) .prologue - alloc r2=ar.pfs,8,0,6,0 + alloc r2=ar.pfs,8,1,6,0 cmp.eq p6,p0=0,in0 mov r8=EINVAL mov out0=in3 /* Flags are first syscall argument. */ @@ -63,15 +63,34 @@ ENTRY(__clone2) cmp.eq CHILD,PARENT=0,r8 /* Are we the child? */ (p6) br.cond.spnt.many __syscall_error ;; -(CHILD) ld8 out1=[in0],8 /* Retrieve code pointer. */ -(CHILD) mov out0=in4 /* Pass proper argument to fn */ +(CHILD) mov loc0=gp (PARENT) ret ;; +#ifdef RESET_PID + tbit.nz p6,p0=in3,16 /* CLONE_THREAD */ + tbit.z p7,p10=in3,8 /* CLONE_VM */ +(p6) br.cond.dptk 1f + ;; + mov r15=SYS_ify (getpid) +(p10) addl r8=-1,r0 +(p7) break __BREAK_SYSCALL + ;; + add r9=PID,r13 + add r10=TID,r13 + ;; + st4 [r9]=r8 + st4 [r10]=r8 + ;; +#endif +1: ld8 out1=[in0],8 /* Retrieve code pointer. */ + mov out0=in4 /* Pass proper argument to fn */ + ;; ld8 gp=[in0] /* Load function gp. */ mov b6=out1 br.call.dptk.many rp=b6 /* Call fn(arg) in the child */ ;; mov out0=r8 /* Argument to _exit */ + mov gp=loc0 .globl HIDDEN_JUMPTARGET(_exit) br.call.dpnt.many rp=HIDDEN_JUMPTARGET(_exit) /* call _exit with result from fn. */ --- libc/nptl/sysdeps/unix/sysv/linux/ia64/clone2.S.jj 2004-12-07 15:10:34.480852179 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/ia64/clone2.S 2004-12-07 15:10:41.277637762 +0100 @@ -0,0 +1,2 @@ +#define RESET_PID +#include --- libc/nptl/sysdeps/ia64/tcb-offsets.sym.jj 2004-03-10 20:02:20.000000000 +0100 +++ libc/nptl/sysdeps/ia64/tcb-offsets.sym 2004-12-07 14:19:54.824158224 +0100 @@ -2,5 +2,6 @@ #include PID offsetof (struct pthread, pid) - sizeof (struct pthread) +TID offsetof (struct pthread, tid) - sizeof (struct pthread) MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads) - sizeof (struct pthread) SYSINFO_OFFSET offsetof (tcbhead_t, private) --- libc/nptl/tst-getpid2.c.jj 2004-12-07 14:17:13.094068910 +0100 +++ libc/nptl/tst-getpid2.c 2004-12-07 14:17:09.551702136 +0100 @@ -0,0 +1,2 @@ +#define TEST_CLONE_FLAGS CLONE_VM +#include "tst-getpid1.c" --- libc/nptl/tst-getpid1.c.jj 2004-12-05 08:46:02.000000000 +0100 +++ libc/nptl/tst-getpid1.c 2004-12-07 14:14:45.748407926 +0100 @@ -5,6 +5,10 @@ #include #include +#ifndef TEST_CLONE_FLAGS +#define TEST_CLONE_FLAGS 0 +#endif + static int sig; static int @@ -35,8 +39,16 @@ do_test (void) return 1; } +#ifdef __ia64__ + extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base, + size_t __child_stack_size, int __flags, + void *__arg, ...); + char st[256 * 1024]; + pid_t p = __clone2 (f, st, sizeof (st), TEST_CLONE_FLAGS, 0); +#else char st[128 * 1024]; - pid_t p = clone (f, st + sizeof (st), 0, 0); + pid_t p = clone (f, st + sizeof (st), TEST_CLONE_FLAGS, 0); +#endif if (p == -1) { printf("clone failed: %m\n"); --- libc/nptl/Makefile.jj 2004-12-06 12:40:54.000000000 +0100 +++ libc/nptl/Makefile 2004-12-07 14:17:27.958411793 +0100 @@ -241,7 +241,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 \ tst-backtrace1 \ tst-oddstacklimit \ tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \ - tst-getpid1 + tst-getpid1 tst-getpid2 xtests = tst-setuid1 tst-setuid1-static # Files which must not be linked with libpthread. Jakub From drepper@redhat.com Tue Dec 7 20:34:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 07 Dec 2004 20:34:00 -0000 Subject: [PATCH] Fix ia64 clone2 In-Reply-To: <20041207200608.GD5149@sunsite.mff.cuni.cz> References: <20041207200608.GD5149@sunsite.mff.cuni.cz> Message-ID: <41B6138D.2090605@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Applied. - -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFBthON2ijCOnn/RHQRAnk1AJ9Z8IIJ1BOb7w6/8VwuVy8U3+TldACgtXm9 QUdd3HByo5nyqXi3BappNBw= =huuK -----END PGP SIGNATURE----- From jakub@redhat.com Tue Dec 7 20:48:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 07 Dec 2004 20:48:00 -0000 Subject: [PATCH] Shut up a warning in sysconf.c Message-ID: <20041207204807.GE5149@sunsite.mff.cuni.cz> Hi! On ia64 I get: ../sysdeps/posix/sysconf.c:1215: warning: '__sysconf_check_spec' defined but not used The following patch seems to cure it. I tried __attribute__((unused)) first but for some reason that still warned (maybe compiler bug). __attribute_used__ is not something that is desirable in this case, as there is no point in actually having the routine if it will be never used. 2004-12-07 Jakub Jelinek * sysdeps/posix/sysconf.c (__sysconf_check_spec): Only define if it will be actually used. --- libc/sysdeps/posix/sysconf.c.jj 2004-12-07 15:42:04.000000000 -0500 +++ libc/sysdeps/posix/sysconf.c 2004-12-07 15:50:38.000000000 -0500 @@ -34,7 +34,12 @@ #include +#if !defined _XBS5_ILP32_OFF32 || !defined _XBS5_ILP32_OFFBIG \ + || !defined _XBS5_LP64_OFF64 || !defined _XBS5_LPBIG_OFFBIG \ + || !defined _POSIX_V6_ILP32_OFF32 || !defined _POSIX_V6_ILP32_OFFBIG \ + || !defined _POSIX_V6_LP64_OFF64 || !defined _POSIX_V6_LPBIG_OFFBIG static long int __sysconf_check_spec (const char *spec); +#endif /* Get the value of the system variable NAME. */ @@ -1210,6 +1215,10 @@ __sysconf (name) weak_alias (__sysconf, sysconf) libc_hidden_def (__sysconf) +#if !defined _XBS5_ILP32_OFF32 || !defined _XBS5_ILP32_OFFBIG \ + || !defined _XBS5_LP64_OFF64 || !defined _XBS5_LPBIG_OFFBIG \ + || !defined _POSIX_V6_ILP32_OFF32 || !defined _POSIX_V6_ILP32_OFFBIG \ + || !defined _POSIX_V6_LP64_OFF64 || !defined _POSIX_V6_LPBIG_OFFBIG static long int __sysconf_check_spec (const char *spec) { @@ -1230,3 +1239,4 @@ __sysconf_check_spec (const char *spec) __set_errno (save_errno); return ret; } +#endif Jakub From roland@redhat.com Tue Dec 7 20:54:00 2004 From: roland@redhat.com (Roland McGrath) Date: Tue, 07 Dec 2004 20:54:00 -0000 Subject: [PATCH] Shut up a warning in sysconf.c In-Reply-To: Jakub Jelinek's message of Tuesday, 7 December 2004 21:48:07 +0100 <20041207204807.GE5149@sunsite.mff.cuni.cz> Message-ID: <200412072054.iB7KsXD4014962@magilla.sf.frob.com> Can you replace that repeated #if mess with just one that defines a single macro for the other to test? From jakub@redhat.com Tue Dec 7 21:03:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 07 Dec 2004 21:03:00 -0000 Subject: [PATCH] Shut up a warning in sysconf.c (take 2) In-Reply-To: <200412072054.iB7KsXD4014962@magilla.sf.frob.com> References: <20041207204807.GE5149@sunsite.mff.cuni.cz> <200412072054.iB7KsXD4014962@magilla.sf.frob.com> Message-ID: <20041207210351.GF5149@sunsite.mff.cuni.cz> On Tue, Dec 07, 2004 at 12:54:33PM -0800, Roland McGrath wrote: > Can you replace that repeated #if mess with just one that defines a single > macro for the other to test? Sure. I was too lazy, sorry. 2004-12-07 Jakub Jelinek * sysdeps/posix/sysconf.c (__sysconf_check_spec): Only define if it will be actually used. --- libc/sysdeps/posix/sysconf.c.jj 2004-12-06 12:44:16.000000000 +0100 +++ libc/sysdeps/posix/sysconf.c 2004-12-07 22:01:24.312738283 +0100 @@ -34,7 +34,14 @@ #include +#define NEED_CHECK_SPEC \ + (!defined _XBS5_ILP32_OFF32 || !defined _XBS5_ILP32_OFFBIG \ + || !defined _XBS5_LP64_OFF64 || !defined _XBS5_LPBIG_OFFBIG \ + || !defined _POSIX_V6_ILP32_OFF32 || !defined _POSIX_V6_ILP32_OFFBIG \ + || !defined _POSIX_V6_LP64_OFF64 || !defined _POSIX_V6_LPBIG_OFFBIG) +#if NEED_CHECK_SPEC static long int __sysconf_check_spec (const char *spec); +#endif /* Get the value of the system variable NAME. */ @@ -1210,6 +1217,7 @@ __sysconf (name) weak_alias (__sysconf, sysconf) libc_hidden_def (__sysconf) +#if NEED_CHECK_SPEC static long int __sysconf_check_spec (const char *spec) { @@ -1230,3 +1238,4 @@ __sysconf_check_spec (const char *spec) __set_errno (save_errno); return ret; } +#endif Jakub From roland@redhat.com Tue Dec 7 21:06:00 2004 From: roland@redhat.com (Roland McGrath) Date: Tue, 07 Dec 2004 21:06:00 -0000 Subject: [PATCH] Shut up a warning in sysconf.c (take 2) In-Reply-To: Jakub Jelinek's message of Tuesday, 7 December 2004 22:03:51 +0100 <20041207210351.GF5149@sunsite.mff.cuni.cz> Message-ID: <200412072106.iB7L6sYf015034@magilla.sf.frob.com> > On Tue, Dec 07, 2004 at 12:54:33PM -0800, Roland McGrath wrote: > > Can you replace that repeated #if mess with just one that defines a single > > macro for the other to test? > > Sure. I was too lazy, sorry. Yeah, that's always the problem with you. ;-) > 2004-12-07 Jakub Jelinek > > * sysdeps/posix/sysconf.c (__sysconf_check_spec): Only define > if it will be actually used. > Applied. Thanks, Roland From kukuk@suse.de Wed Dec 8 09:22:00 2004 From: kukuk@suse.de (Thorsten Kukuk) Date: Wed, 08 Dec 2004 09:22:00 -0000 Subject: Fix for Bug #305 Message-ID: <20041208092254.GA31270@suse.de> Hi, this is for Bug #305: It seems new NIS+ server are now sending empty strings with length field "1". Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux Products GmbH Maxfeldstr. 5 D-90409 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B -------------- next part -------------- 2004-12-08 Thorsten Kukuk * nis/nss_nisplus/nisplus-netgrp.c (_nss_nisplus_getnetgrent_r): Add check if the value is not an empty string [Bug #305] --- nis/nss_nisplus/nisplus-netgrp.c +++ nis/nss_nisplus/nisplus-netgrp.c 2004/12/07 12:40:18 @@ -88,7 +88,9 @@ result->type = triple_val; - if (hostlen == 0) + if (hostlen == 0 || + NISENTRYVAL (result->position, 2, + (nis_result *) result->data)[0] == '\0') result->val.triple.host = NULL; else { @@ -99,7 +101,9 @@ *cp++ = '\0'; } - if (userlen == 0) + if (userlen == 0 || + NISENTRYVAL (result->position, 3, + (nis_result *) result->data)[0] == '\0') result->val.triple.user = NULL; else { @@ -110,7 +114,9 @@ *cp++ = '\0'; } - if (domainlen == 0) + if (domainlen == 0 || + NISENTRYVAL (result->position, 4, + (nis_result *) result->data)[0] == '\0') result->val.triple.domain = NULL; else { From drepper@redhat.com Fri Dec 10 04:41:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 10 Dec 2004 04:41:00 -0000 Subject: [PATCH] Fix strtold In-Reply-To: <20041129120017.GH8259@sunsite.mff.cuni.cz> References: <20041129120017.GH8259@sunsite.mff.cuni.cz> Message-ID: <41B928D9.2030103@redhat.com> The patch looks fine. -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? From drepper@redhat.com Fri Dec 10 10:44:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 10 Dec 2004 10:44:00 -0000 Subject: Fix for Bug #305 In-Reply-To: <20041208092254.GA31270@suse.de> References: <20041208092254.GA31270@suse.de> Message-ID: <41B97DBA.8040005@redhat.com> Applied. -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? From pere@hungry.com Fri Dec 10 10:47:00 2004 From: pere@hungry.com (Petter Reinholdtsen) Date: Fri, 10 Dec 2004 10:47:00 -0000 Subject: Fix for Bug #305 In-Reply-To: <41B97DBA.8040005@redhat.com> References: <20041208092254.GA31270@suse.de> <41B97DBA.8040005@redhat.com> Message-ID: <20041210104749.GD3227@saruman.uio.no> [Ulrich Drepper] > Applied. I believe this was the wrong bugzilla number. #305 is a locale issue. From jakub@redhat.com Fri Dec 10 10:52:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 10 Dec 2004 10:52:00 -0000 Subject: Fix for Bug #305 In-Reply-To: <20041210104749.GD3227@saruman.uio.no> References: <20041208092254.GA31270@suse.de> <41B97DBA.8040005@redhat.com> <20041210104749.GD3227@saruman.uio.no> Message-ID: <20041210105142.GH5149@sunsite.mff.cuni.cz> On Fri, Dec 10, 2004 at 11:47:49AM +0100, Petter Reinholdtsen wrote: > [Ulrich Drepper] > > Applied. > > I believe this was the wrong bugzilla number. #305 is a locale issue. Yes, #597 instead. Jakub From schwab@suse.de Sun Dec 12 16:47:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Sun, 12 Dec 2004 16:47:00 -0000 Subject: Fix compilation of malloc/arena.c Message-ID: 2004-12-12 Andreas Schwab * malloc/arena.c [USE_ARENAS]: Include . --- malloc/arena.c.~1.13.~ 2004-12-12 17:39:32.000000000 +0100 +++ malloc/arena.c 2004-12-12 17:46:55.167066564 +0100 @@ -539,6 +539,8 @@ thread_atfork_static(ptmalloc_lock_all, #if USE_ARENAS +#include + #if MALLOC_DEBUG > 1 /* Print the complete contents of a single heap to stderr. */ -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Sun Dec 12 19:10:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 12 Dec 2004 19:10:00 -0000 Subject: Fix compilation of malloc/arena.c In-Reply-To: References: Message-ID: <41BC975E.9080808@redhat.com> Andreas Schwab wrote: > 2004-12-12 Andreas Schwab > > * malloc/arena.c [USE_ARENAS]: Include . Which architecture is this? We should make all the internal headers equal so that these stupid things don't happen again. -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 256 bytes Desc: OpenPGP digital signature URL: From schwab@suse.de Sun Dec 12 19:52:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Sun, 12 Dec 2004 19:52:00 -0000 Subject: Fix compilation of malloc/arena.c In-Reply-To: <41BC975E.9080808@redhat.com> (Ulrich Drepper's message of "Sun, 12 Dec 2004 11:09:18 -0800") References: <41BC975E.9080808@redhat.com> Message-ID: Ulrich Drepper writes: > Andreas Schwab wrote: >> 2004-12-12 Andreas Schwab >> * malloc/arena.c [USE_ARENAS]: Include . > > Which architecture is this? Any one. You use bool, you need . It's as simple as that. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Sun Dec 12 19:59:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 12 Dec 2004 19:59:00 -0000 Subject: Fix compilation of malloc/arena.c In-Reply-To: References: <41BC975E.9080808@redhat.com> Message-ID: <41BCA2C8.70002@redhat.com> Andreas Schwab wrote: > Any one. You use bool, you need . It's as simple as that. Want to be a moron, ey? The archs I use apparently include implicitly some way. This needs to be duplicated for the other archs. -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 256 bytes Desc: OpenPGP digital signature URL: From schwab@suse.de Sun Dec 12 20:43:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Sun, 12 Dec 2004 20:43:00 -0000 Subject: Fix compilation of malloc/arena.c In-Reply-To: <41BCA2C8.70002@redhat.com> (Ulrich Drepper's message of "Sun, 12 Dec 2004 11:58:00 -0800") References: <41BC975E.9080808@redhat.com> <41BCA2C8.70002@redhat.com> Message-ID: Ulrich Drepper writes: > Andreas Schwab wrote: > >> Any one. You use bool, you need . It's as simple as that. > > Want to be a moron, ey? The archs I use apparently include > implicitly some way. This needs to be duplicated for the other archs. No, nothing needs to be duplicated. This is broken for _every_ architecture. Just try building with linuxthreads. Also, the file should be usable outside glibc. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Sun Dec 12 20:59:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 12 Dec 2004 20:59:00 -0000 Subject: Fix compilation of malloc/arena.c In-Reply-To: References: <41BC975E.9080808@redhat.com> <41BCA2C8.70002@redhat.com> Message-ID: <41BCB0CF.50107@redhat.com> Andreas Schwab wrote: > Also, the file should be usable outside glibc. No, we are far beyond that. This is a customized version. -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 256 bytes Desc: OpenPGP digital signature URL: From schwab@suse.de Sun Dec 12 21:23:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Sun, 12 Dec 2004 21:23:00 -0000 Subject: Fix compilation of malloc/arena.c In-Reply-To: <41BCB0CF.50107@redhat.com> (Ulrich Drepper's message of "Sun, 12 Dec 2004 12:57:51 -0800") References: <41BC975E.9080808@redhat.com> <41BCA2C8.70002@redhat.com> <41BCB0CF.50107@redhat.com> Message-ID: Ulrich Drepper writes: > Andreas Schwab wrote: >> Also, the file should be usable outside glibc. > > No, we are far beyond that. This is a customized version. Then we should rip out all #ifdef _LIBC. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From jakub@redhat.com Mon Dec 13 11:36:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 13 Dec 2004 11:36:00 -0000 Subject: [PATCH] Fix getconf Message-ID: <20041213113652.GI5149@sunsite.mff.cuni.cz> Hi! http://www.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html says about _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS: The format of each name shall be suitable for use with the getconf -v option. and http://www.opengroup.org/onlinepubs/009695399/utilities/getconf.html clearly uses POSIX_V6_* as arguments to -v option. So we should not print _POSIX_V6_* but POSIX_V6_* and adjust /usr/libexec/getconf/ filenames accordingly. 2004-12-13 Jakub Jelinek * posix/getconf.c (main): Prepend just $GETCONF_DIR/ instead of $GETCONF_DIR/_ to spec. * posix/confstr.c (confstr): Remove leading underscores for _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS. --- libc/posix/confstr.c.jj 2004-12-06 12:40:55.000000000 +0100 +++ libc/posix/confstr.c 2004-12-13 12:29:59.189578287 +0100 @@ -55,7 +55,7 @@ confstr (name, buf, len) Currently this means all environment which the system allows. */ { - char restenvs[4 * sizeof "_POSIX_V6_LPBIG_OFFBIG"]; + char restenvs[4 * sizeof "POSIX_V6_LPBIG_OFFBIG"]; string_len = 0; #ifndef _POSIX_V6_ILP32_OFF32 @@ -63,9 +63,9 @@ confstr (name, buf, len) #endif #if !defined _POSIX_V6_ILP32_OFF32 || _POSIX_V6_ILP32_OFF32 > 0 { - memcpy (restenvs + string_len, "_POSIX_V6_ILP32_OFF32", - sizeof "_POSIX_V6_ILP32_OFF32" - 1); - string_len += sizeof "_POSIX_V6_ILP32_OFF32" - 1; + memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFF32", + sizeof "POSIX_V6_ILP32_OFF32" - 1); + string_len += sizeof "POSIX_V6_ILP32_OFF32" - 1; } #endif #ifndef _POSIX_V6_ILP32_OFFBIG @@ -75,9 +75,9 @@ confstr (name, buf, len) { if (string_len) restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "_POSIX_V6_ILP32_OFFBIG", - sizeof "_POSIX_V6_ILP32_OFFBIG" - 1); - string_len += sizeof "_POSIX_V6_ILP32_OFFBIG" - 1; + memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFFBIG", + sizeof "POSIX_V6_ILP32_OFFBIG" - 1); + string_len += sizeof "POSIX_V6_ILP32_OFFBIG" - 1; } #endif #ifndef _POSIX_V6_LP64_OFF64 @@ -87,9 +87,9 @@ confstr (name, buf, len) { if (string_len) restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "_POSIX_V6_LP64_OFF64", - sizeof "_POSIX_V6_LP64_OFF64" - 1); - string_len += sizeof "_POSIX_V6_LP64_OFF64" - 1; + memcpy (restenvs + string_len, "POSIX_V6_LP64_OFF64", + sizeof "POSIX_V6_LP64_OFF64" - 1); + string_len += sizeof "POSIX_V6_LP64_OFF64" - 1; } #endif #ifndef _POSIX_V6_LPBIG_OFFBIG @@ -99,9 +99,9 @@ confstr (name, buf, len) { if (string_len) restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "_POSIX_V6_LPBIG_OFFBIG", - sizeof "_POSIX_V6_LPBIG_OFFBIG" - 1); - string_len += sizeof "_POSIX_V6_LPBIG_OFFBIG" - 1; + memcpy (restenvs + string_len, "POSIX_V6_LPBIG_OFFBIG", + sizeof "POSIX_V6_LPBIG_OFFBIG" - 1); + string_len += sizeof "POSIX_V6_LPBIG_OFFBIG" - 1; } #endif restenvs[string_len++] = '\0'; --- libc/posix/getconf.c.jj 2004-12-13 09:39:45.000000000 +0100 +++ libc/posix/getconf.c 2004-12-13 12:24:50.442826735 +0100 @@ -997,7 +997,7 @@ warranty; not even for MERCHANTABILITY o { char default_name[getconf_dirlen + sizeof "/default"]; memcpy (mempcpy (default_name, getconf_dir, getconf_dirlen), - "/default", sizeof "/default"); + "/default", sizeof "/default"); int len = readlink (default_name, buf, sizeof buf - 1); if (len > 0) { @@ -1034,10 +1034,10 @@ warranty; not even for MERCHANTABILITY o { const char *args[argc + 3]; size_t spec_len = strlen (spec); - char getconf_name[getconf_dirlen + 2 + spec_len + 1]; + char getconf_name[getconf_dirlen + 1 + spec_len + 1]; memcpy (mempcpy (mempcpy (getconf_name, getconf_dir, - getconf_dirlen), - "/_", 2), spec, spec_len + 1); + getconf_dirlen), + "/", 1), spec, spec_len + 1); args[0] = argv0; args[1] = "-v"; args[2] = spec; Jakub From jakub@redhat.com Tue Dec 14 15:15:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 14 Dec 2004 15:15:00 -0000 Subject: [PATCH] Follow up for the /usr/libexec/getconf file renaming Message-ID: <20041214151516.GM5149@sunsite.mff.cuni.cz> Hi! Withouth this, sysconf (_POSIX_V6_whatever) will not work for the other ABI environments. 2004-12-14 Jakub Jelinek * sysdeps/posix/sysconf.c (__sysconf_check_spec): Remove leading underscore from GETCONF_DIR filenames. --- libc/sysdeps/posix/sysconf.c.jj 2004-12-13 09:39:54.000000000 +0100 +++ libc/sysdeps/posix/sysconf.c 2004-12-14 16:12:44.926421643 +0100 @@ -1227,9 +1227,9 @@ __sysconf_check_spec (const char *spec) size_t getconf_dirlen = strlen (getconf_dir); size_t speclen = strlen (spec); - char name[getconf_dirlen + sizeof ("/_POSIX_V6_") + speclen]; + char name[getconf_dirlen + sizeof ("/POSIX_V6_") + speclen]; memcpy (mempcpy (mempcpy (name, getconf_dir, getconf_dirlen), - "/_POSIX_V6_", sizeof ("/_POSIX_V6_") - 1), + "/POSIX_V6_", sizeof ("/POSIX_V6_") - 1), spec, speclen + 1); struct stat64 st; Jakub From schwab@suse.de Tue Dec 14 16:55:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Tue, 14 Dec 2004 16:55:00 -0000 Subject: [RFC] Splitting kernel headers and deprecating __KERNEL__ In-Reply-To: (Linus Torvalds's message of "Tue, 14 Dec 2004 07:49:05 -0800 (PST)") References: <19865.1101395592@redhat.com> <20041125165433.GA2849@parcelfarce.linux.theplanet.co.uk> <1101406661.8191.9390.camel@hades.cambridge.redhat.com> <20041127032403.GB10536@kroah.com> <16810.24893.747522.656073@cargo.ozlabs.ibm.com> <20041214025110.A28617@almesberger.net> Message-ID: Linus Torvalds writes: > This is a common issue with namespace pollution. For example, this program > is perfectly valid afaik (well, except for being _stupid_, but that's > another issue): > > #include > > const char *int32_t(int i) > { > return i ? "non-zero" : "zero"; > } Actually this is not allowed in POSIX. _Any_ header may define any identifier ending with "_t". Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From jakub@redhat.com Tue Dec 14 17:14:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 14 Dec 2004 17:14:00 -0000 Subject: [PATCH] Fix nptl/tst-getpid{1,2} on s390{,x} Message-ID: <20041214171452.GN5149@sunsite.mff.cuni.cz> Hi! So far tested outside of glibc tree only (and solely 31 bit). Martin, does this look ok? I'll test it fully in my next automated glibc build. 2004-12-14 Jakub Jelinek * sysdeps/unix/sysv/linux/s390/s390-32/clone.S (__clone): Add support for NPTL where the PID is stored at userlevel and needs to be reset when CLONE_THREAD is not used. * sysdeps/unix/sysv/linux/s390/s390-64/clone.S (__clone): Likewise. nptl/ * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file. * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file. * sysdeps/s390/tcb-offsets.sym (TID): Add. --- libc/sysdeps/unix/sysv/linux/s390/s390-32/clone.S.jj 2004-07-12 17:50:26.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/s390/s390-32/clone.S 2004-12-14 17:39:17.888568618 +0100 @@ -54,6 +54,18 @@ error: PSEUDO_END (__clone) thread_start: +#ifdef RESET_PID + tmh %r3,1 /* CLONE_THREAD == 0x00010000 */ + jne 1f + lhi %r2,-1 + tml %r3,256 /* CLONE_VM == 0x00000100 */ + jne 2f + svc SYS_ify(getpid) +2: ear %r3,%a0 + st %r2,PID(%r3) + st %r2,TID(%r3) +1: +#endif /* fn is in gpr 1, arg in gpr 0 */ lr %r2,%r0 /* set first parameter to void *arg */ ahi %r15,-96 /* make room on the stack for the save area */ --- libc/sysdeps/unix/sysv/linux/s390/s390-64/clone.S.jj 2004-07-12 17:50:26.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/s390/s390-64/clone.S 2004-12-14 18:03:24.020208726 +0100 @@ -55,6 +55,20 @@ error: PSEUDO_END (__clone) thread_start: +#ifdef RESET_PID + tmh %r3,1 /* CLONE_THREAD == 0x00010000 */ + jne 1f + lhi %r2,-1 + tml %r3,256 /* CLONE_VM == 0x00000100 */ + jne 2f + svc SYS_ify(getpid) +2: ear %r3,%a0 + sllg %r3,%r3,32 + ear %r3,%a1 + st %r2,PID(%r3) + st %r2,TID(%r3) +1: +#endif /* fn is in gpr 1, arg in gpr 0 */ lgr %r2,%r0 /* set first parameter to void *arg */ aghi %r15,-160 /* make room on the stack for the save area */ --- libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/clone.S.jj 2004-12-14 17:56:54.715727557 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/clone.S 2004-12-14 17:57:02.301372155 +0100 @@ -0,0 +1,2 @@ +#define RESET_PID +#include --- libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/clone.S.jj 2004-12-14 17:56:54.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/clone.S 2004-12-14 18:03:46.223246796 +0100 @@ -0,0 +1,2 @@ +#define RESET_PID +#include --- libc/nptl/sysdeps/s390/tcb-offsets.sym.jj 2004-03-10 20:02:20.000000000 +0100 +++ libc/nptl/sysdeps/s390/tcb-offsets.sym 2004-12-14 17:56:00.412430245 +0100 @@ -3,3 +3,4 @@ MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) PID offsetof (struct pthread, pid) +TID offsetof (struct pthread, tid) Jakub From schwab@suse.de Tue Dec 14 20:26:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Tue, 14 Dec 2004 20:26:00 -0000 Subject: [RFC] Splitting kernel headers and deprecating __KERNEL__ In-Reply-To: (Linus Torvalds's message of "Tue, 14 Dec 2004 11:58:47 -0800 (PST)") References: <20041214135029.A1271@almesberger.net> <200412141923.iBEJNCY9011317@laptop11.inf.utfsm.cl> <20041214194531.GB13811@mars.ravnborg.org> Message-ID: Linus Torvalds writes: > We used to compile with "-nostdinc" to make sure that you couldn't include > user files even by mistake, but that was removed for some reason I can't > for the life of me remember any more. ??? We still do that, see NOSTDINC_FLAGS. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From aj@suse.de Wed Dec 15 07:47:00 2004 From: aj@suse.de (Andreas Jaeger) Date: Wed, 15 Dec 2004 07:47:00 -0000 Subject: ia64/dl-machine.h changes for GCC 4.0 Message-ID: To compile glibc with GCC 4.0 on IA64 I need the following patch - similar to those done for i386/x86-64 already. Ok to commit? Andreas 2004-12-15 Andreas Jaeger * sysdeps/ia64/dl-machine.h (elf_machine_rela): Mark auto instead of static, add always_inline attribute. (elf_machine_rela_relative): Likewise. (elf_machine_lazy_rel): Likewise. ============================================================ Index: sysdeps/ia64/dl-machine.h --- sysdeps/ia64/dl-machine.h 6 Aug 2004 17:56:03 -0000 1.35 +++ sysdeps/ia64/dl-machine.h 15 Dec 2004 07:44:56 -0000 @@ -499,7 +499,8 @@ elf_machine_plt_value (struct link_map * /* Perform the relocation specified by RELOC and SYM (which is fully resolved). MAP is the object containing the reloc. */ -static inline void +auto inline void +__attribute ((always_inline)) elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, const Elf64_Sym *sym, @@ -603,7 +604,8 @@ elf_machine_rela (struct link_map *map, can be skipped. */ #define ELF_MACHINE_REL_RELATIVE 1 -static inline void +auto inline void +__attribute ((always_inline)) elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, void *const reloc_addr_arg) { @@ -615,7 +617,8 @@ elf_machine_rela_relative (Elf64_Addr l_ } /* Perform a RELATIVE reloc on the .got entry that transfers to the .plt. */ -static inline void +auto inline void +__attribute ((always_inline)) elf_machine_lazy_rel (struct link_map *map, Elf64_Addr l_addr, const Elf64_Rela *reloc) { -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From roland@redhat.com Wed Dec 15 08:36:00 2004 From: roland@redhat.com (Roland McGrath) Date: Wed, 15 Dec 2004 08:36:00 -0000 Subject: ia64/dl-machine.h changes for GCC 4.0 In-Reply-To: Andreas Jaeger's message of Wednesday, 15 December 2004 08:47:55 +0100 Message-ID: <200412150833.iBF8XghX024028@magilla.sf.frob.com> > To compile glibc with GCC 4.0 on IA64 I need the following patch - > similar to those done for i386/x86-64 already. > > Ok to commit? Yes. From jakub@redhat.com Wed Dec 15 11:33:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 15 Dec 2004 11:33:00 -0000 Subject: [PATCH] Fix tst-getpid{1,2} on ppc64 Message-ID: <20041215113329.GQ5149@sunsite.mff.cuni.cz> Hi! Seems ppc64 is not restoring r2 and so crashes when _exit is called with bogus toc register. I haven't tested this patch yet, but will do RSN, certainly if tst-getpid1.c is modified to call _exit (1) resp. _exit (0) instead of return {1,0}, it succeeds (well, I have one day old glibc, so fails with wrong signal value, but the child doesn't crash). 2004-12-15 Jakub Jelinek * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S (__clone): Save and restore r2 around call to fn. --- libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S.jj 2004-12-15 12:21:04.000000000 +0100 +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2004-12-15 12:26:22.049075256 +0100 @@ -104,12 +104,14 @@ L(nomoregetpid): L(oldpid): #endif + std r2,40(r1) /* Call procedure. */ ld r0,0(r29) ld r2,8(r29) mtctr r0 mr r3,r31 bctrl + ld r2,40(r1) /* Call _exit with result from procedure. */ #ifdef SHARED b JUMPTARGET(__GI__exit) Jakub From jakub@redhat.com Wed Dec 15 14:07:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 15 Dec 2004 14:07:00 -0000 Subject: [PATCH] Fix nptl/tst-getpid{1,2} on s390{,x} (take 2) In-Reply-To: <20041214171452.GN5149@sunsite.mff.cuni.cz> References: <20041214171452.GN5149@sunsite.mff.cuni.cz> Message-ID: <20041215140704.GR5149@sunsite.mff.cuni.cz> On Tue, Dec 14, 2004 at 06:14:52PM +0100, Jakub Jelinek wrote: > So far tested outside of glibc tree only (and solely 31 bit). > Martin, does this look ok? > I'll test it fully in my next automated glibc build. Testing revealed missing #include , fixed below. With this patch plus the ppc64 clone.S patch I posted today tst-getpid{1,2} passes on i386/i686/x86_64/ia64/ppc/ppc64/s390/s390x. 2004-12-15 Jakub Jelinek * sysdeps/unix/sysv/linux/s390/s390-32/clone.S (__clone): Add support for NPTL where the PID is stored at userlevel and needs to be reset when CLONE_THREAD is not used. * sysdeps/unix/sysv/linux/s390/s390-64/clone.S (__clone): Likewise. nptl/ * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file. * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file. * sysdeps/s390/tcb-offsets.sym (TID): Add. --- libc/sysdeps/unix/sysv/linux/s390/s390-32/clone.S 1 Jul 2004 17:34:29 -0000 1.8 +++ libc/sysdeps/unix/sysv/linux/s390/s390-32/clone.S 15 Dec 2004 12:20:45 -0000 1.8.2.2 @@ -21,6 +21,7 @@ and invokes a function in the right context after its all over. */ #include +#include #define _ERRNO_H 1 #include @@ -54,6 +55,18 @@ error: PSEUDO_END (__clone) thread_start: +#ifdef RESET_PID + tmh %r3,1 /* CLONE_THREAD == 0x00010000 */ + jne 1f + lhi %r2,-1 + tml %r3,256 /* CLONE_VM == 0x00000100 */ + jne 2f + svc SYS_ify(getpid) +2: ear %r3,%a0 + st %r2,PID(%r3) + st %r2,TID(%r3) +1: +#endif /* fn is in gpr 1, arg in gpr 0 */ lr %r2,%r0 /* set first parameter to void *arg */ ahi %r15,-96 /* make room on the stack for the save area */ --- libc/sysdeps/unix/sysv/linux/s390/s390-64/clone.S 1 Jul 2004 17:34:30 -0000 1.10 +++ libc/sysdeps/unix/sysv/linux/s390/s390-64/clone.S 15 Dec 2004 12:20:47 -0000 1.10.2.2 @@ -22,6 +22,7 @@ and invokes a function in the right context after its all over. */ #include +#include #define _ERRNO_H 1 #include @@ -55,6 +56,20 @@ error: PSEUDO_END (__clone) thread_start: +#ifdef RESET_PID + tmh %r3,1 /* CLONE_THREAD == 0x00010000 */ + jne 1f + lhi %r2,-1 + tml %r3,256 /* CLONE_VM == 0x00000100 */ + jne 2f + svc SYS_ify(getpid) +2: ear %r3,%a0 + sllg %r3,%r3,32 + ear %r3,%a1 + st %r2,PID(%r3) + st %r2,TID(%r3) +1: +#endif /* fn is in gpr 1, arg in gpr 0 */ lgr %r2,%r0 /* set first parameter to void *arg */ aghi %r15,-160 /* make room on the stack for the save area */ --- libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/clone.S 1 Jan 1970 00:00:00 -0000 +++ libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/clone.S 15 Dec 2004 09:53:45 -0000 1.1.2.1 @@ -0,0 +1,2 @@ +#define RESET_PID +#include --- libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/clone.S 1 Jan 1970 00:00:00 -0000 +++ libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/clone.S 15 Dec 2004 09:53:45 -0000 1.1.2.1 @@ -0,0 +1,2 @@ +#define RESET_PID +#include --- libc/nptl/sysdeps/s390/tcb-offsets.sym 10 Mar 2004 18:59:29 -0000 1.2 +++ libc/nptl/sysdeps/s390/tcb-offsets.sym 15 Dec 2004 09:53:44 -0000 1.2.2.1 @@ -3,3 +3,4 @@ MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) PID offsetof (struct pthread, pid) +TID offsetof (struct pthread, tid) Jakub From jakub@redhat.com Wed Dec 15 16:11:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 15 Dec 2004 16:11:00 -0000 Subject: [PATCH] Fix libnsl.so ABI issue Message-ID: <20041215161138.GS5149@sunsite.mff.cuni.cz> Hi! Due to typo, nis_domain_of_r stopped being exported from libnsl.so. Fixed thusly. 2004-12-15 Jakub Jelinek * nis/nis_domain_of_r.c (nis_domain_of_r): Use libnsl_hidden_def, not libnsl_hidden_proto. --- libc/nis/nis_domain_of_r.c.jj 2004-11-01 13:25:30.000000000 +0100 +++ libc/nis/nis_domain_of_r.c 2004-12-15 17:08:22.350059309 +0100 @@ -54,4 +54,4 @@ nis_domain_of_r (const_nis_name name, ch return memcpy (buffer, cptr, cptr_len + 1); } -libnsl_hidden_proto (nis_domain_of_r) +libnsl_hidden_def (nis_domain_of_r) Jakub From jakub@redhat.com Thu Dec 16 13:47:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 16 Dec 2004 13:47:00 -0000 Subject: [PATCH] Some sparc{,v9,64} glibc fixes Message-ID: <20041216134720.GU5149@sunsite.mff.cuni.cz> Hi! I have done 3 sparc builds this morning and this is the result of that. BTW, Andreas, can you please recompute: Failure: Test: atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994380 Result: is: -1.80338464113663849327e+00 -0x1.cdaa9da7ca620c5349dcp+0 should be: -1.80338464113663849327e+00 -0x1.cdaa9da7ca620c5349dcp+0 difference: 3.60900012278724126504e-30 0x1.24cc0000000000000000p-98 ulp : 18739.0000 max.ulp : 0.0000 with additional precision? This is something I haven't included in libm-test-ulps patch, as that is not atan2 ldbl-128 bug, but testcase. 30 digits aren't enough, all other numbers have at least 36. Thanks. 2004-12-16 Jakub Jelinek * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__clone): Add support for NPTL where the PID is stored at userlevel and needs to be reset when CLONE_THREAD is not used. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (SYSCALL_ERROR_HANDLER): If RTLD_PRIVATE_ERRNO, use rtld_errno instead of errno. * sysdeps/unix/sysv/linux/sparc/sparc64/socket.S: Include sysdep-cancel.h instead of sysdep.h. Handle cancellation. * sysdeps/sparc/sparc64/fpu/libm-test-ulps: Regenerate. * sysdeps/ieee754/ldbl-128/e_expl.c: Include stdlib.h. nptl/ * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file. * sysdeps/sparc/tcb-offsets.sym: Add TID. --- libc/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S.jj 2003-08-31 13:21:42.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S 2004-12-16 05:59:47.000000000 -0500 @@ -1,4 +1,5 @@ -/* Copyright (C) 1996, 1997, 1998, 2000, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@tamu.edu). @@ -22,6 +23,10 @@ #include #include +#include + +#define CLONE_VM 0x00000100 +#define CLONE_THREAD 0x00010000 /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, pid_t *ptid, void *tls, pid_t *ctid); */ @@ -69,6 +74,19 @@ __clone: .type __thread_start,@function __thread_start: +#ifdef RESET_PID + sethi %hi(CLONE_THREAD), %l0 + andcc %i2, %l0, %g0 + bne 1f + andcc %i2, CLONE_VM, %g0 + bne,a 2f + mov -1,%o0 + set __NR_getpid,%g1 + ta 0x10 +2: st %o0,[%g7 + PID] + st %o0,[%g7 + TID] +1: +#endif call %i0 mov %i3,%o0 call _exit,0 --- libc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h.jj 2003-11-11 20:04:05.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h 2004-12-16 05:59:23.608227358 -0500 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2000, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson , 1997. @@ -85,7 +85,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_er sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \ call __sparc64.get_pic.l7; \ add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \ - ldx [%l7 + errno], %l0; \ + ldx [%l7 + rtld_errno], %l0; \ st %i0, [%l0]; \ jmpl %i7+8, %g0; \ restore %g0, -1, %o0; \ --- libc/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S.jj 2002-12-28 04:19:30.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S 2004-12-16 08:03:47.627523950 -0500 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Miguel de Icaza , 1997. @@ -17,7 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include +#include #include #define P(a, b) P2(a, b) @@ -63,7 +63,12 @@ ENTRY (__socket) #endif #endif - mov P(SOCKOP_,socket), %o0 /* arg 1: socket subfunction */ +#if defined NEED_CANCELLATION && defined CENABLE + SINGLE_THREAD_P + cmp %g1, 0 + bne .Lsocket_cancel +#endif + mov P(SOCKOP_,socket), %o0 /* arg 1: socket subfunction */ add %sp, STACK_BIAS + 128, %o1 /* arg 2: parameter block */ LOADSYSCALL(socketcall) ta 0x6d @@ -73,6 +78,31 @@ ENTRY (__socket) retl nop +#if defined NEED_CANCELLATION && defined CENABLE +.Lsocket_cancel: + cfi_startproc + save %sp, -160, %sp + cfi_def_cfa_register (%fp) + cfi_window_save + cfi_register (%o7, %i7) + CENABLE + nop + mov %o0, %l0 + add %sp, 160 + STACK_BIAS + 128, %o1 + mov P(SOCKOP_,socket), %o0 + LOADSYSCALL(socketcall) + ta 0x6d + + bcs,pn %xcc, __syscall_error_handler2 + mov %o0, %l1 + CDISABLE + mov %l0, %o0 + jmpl %i7 + 8, %g0 + restore %g0, %l1, %o0 + cfi_endproc + SYSCALL_ERROR_HANDLER2 +#endif + SYSCALL_ERROR_HANDLER END (__socket) --- libc/sysdeps/sparc/sparc64/fpu/libm-test-ulps.jj 2003-03-22 19:52:10.000000000 -0500 +++ libc/sysdeps/sparc/sparc64/fpu/libm-test-ulps 2004-12-16 07:54:25.772938830 -0500 @@ -1,6 +1,9 @@ # Begin of automatic generation # atan2 +Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994380": +float: 6 +ifloat: 6 Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025": float: 3 ifloat: 3 @@ -130,9 +133,14 @@ double: 1 idouble: 1 # ccos +Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i": +ildouble: 1 +ldouble: 1 Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": double: 1 float: 1 @@ -146,9 +154,13 @@ ifloat: 1 Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": double: 1 float: 1 @@ -195,11 +207,16 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +Test "Real part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i": +ildouble: 1 +ldouble: 1 Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i": double: 1 float: 5 idouble: 1 ifloat: 5 +ildouble: 1 +ldouble: 1 Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i": double: 1 float: 1 @@ -342,11 +359,17 @@ ildouble: 1 ldouble: 1 # csin +Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i": +ildouble: 1 +ldouble: 1 Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i": ildouble: 1 ldouble: 1 # csinh +Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": +ildouble: 1 +ldouble: 1 Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": double: 1 idouble: 1 @@ -376,6 +399,11 @@ ldouble: 1 Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i": double: 1 idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i": +ildouble: 1 +ldouble: 1 Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i": double: 1 idouble: 1 @@ -388,6 +416,11 @@ double: 1 float: 2 idouble: 1 ifloat: 2 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i": +ildouble: 1 +ldouble: 1 Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i": float: 1 ifloat: 1 @@ -644,11 +677,15 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1": double: 1 float: 2 idouble: 1 ifloat: 2 +ildouble: 1 +ldouble: 1 # log10 Test "log10 (0.75) == -0.124938736608299953132449886193870744": @@ -906,8 +943,8 @@ idouble: 1 # Maximal error of functions: Function: "atan2": -float: 3 -ifloat: 3 +float: 6 +ifloat: 6 ildouble: 1 ldouble: 1 @@ -996,20 +1033,28 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Function: Imaginary part of "ccos": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Function: Real part of "ccosh": double: 1 float: 1 idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Function: Imaginary part of "ccosh": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Function: Real part of "cexp": float: 1 @@ -1036,12 +1081,15 @@ ifloat: 3 Function: Real part of "clog10": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Function: Imaginary part of "clog10": double: 1 float: 5 idouble: 1 ifloat: 5 +ildouble: 1 ldouble: 1 Function: "cos": @@ -1072,9 +1120,15 @@ Function: Real part of "csin": ildouble: 1 ldouble: 1 +Function: Imaginary part of "csin": +ildouble: 1 +ldouble: 1 + Function: Real part of "csinh": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Function: Imaginary part of "csinh": double: 1 @@ -1095,6 +1149,8 @@ ldouble: 1 Function: Real part of "ctan": double: 1 idouble: 1 +ildouble: 1 +ldouble: 1 Function: Imaginary part of "ctan": double: 1 @@ -1107,10 +1163,14 @@ double: 1 float: 2 idouble: 1 ifloat: 2 +ildouble: 1 +ldouble: 1 Function: Imaginary part of "ctanh": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Function: "erf": double: 1 --- libc/sysdeps/ieee754/ldbl-128/e_expl.c.jj 2001-07-06 00:55:55.000000000 -0400 +++ libc/sysdeps/ieee754/ldbl-128/e_expl.c 2004-12-16 07:11:09.428643158 -0500 @@ -66,6 +66,7 @@ #include #include #include +#include #include "t_expl.h" static const long double C[] = { --- libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S.jj 2004-12-16 05:59:47.000000000 -0500 +++ libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S 2004-12-16 05:59:47.000000000 -0500 @@ -0,0 +1,2 @@ +#define RESET_PID +#include --- libc/nptl/sysdeps/sparc/tcb-offsets.sym.jj 2004-03-10 13:59:29.000000000 -0500 +++ libc/nptl/sysdeps/sparc/tcb-offsets.sym 2004-12-16 05:59:47.000000000 -0500 @@ -3,3 +3,4 @@ MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) PID offsetof (struct pthread, pid) +TID offsetof (struct pthread, tid) Jakub From aj@suse.de Thu Dec 16 14:53:00 2004 From: aj@suse.de (Andreas Jaeger) Date: Thu, 16 Dec 2004 14:53:00 -0000 Subject: Fix for math.h Message-ID: If you compile with -Wundef -Wsystem-headers you get warnings that __USE_ISOC99 is not defined in math.h. In general we use #ifdef __USE_ISOC99 and not just an #if... Here's a patch for the remaining places. Ok to commit? Andreas 2004-12-16 Andreas Jaeger * math/math.h: Use #if defined to not receive warnings about undefined symbols. ============================================================ Index: math/math.h --- math/math.h 15 Mar 2004 21:44:08 -0000 1.68 +++ math/math.h 16 Dec 2004 14:53:31 -0000 @@ -1,5 +1,5 @@ /* Declarations for math functions. - Copyright (C) 1991-1993,1995-1999,2001,2002 Free Software Foundation, Inc. + Copyright (C) 1991-1993,1995-1999,2001,2002,2004 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 @@ -132,7 +132,7 @@ extern int signgam; /* ISO C99 defines some generic macros which work on any data type. */ -#if __USE_ISOC99 +#ifdef __USE_ISOC99 /* Get the architecture specific values describing the floating-point evaluation. The following symbols will get defined: @@ -362,7 +362,7 @@ extern int matherr (struct exception *__ # define __NO_MATH_INLINES 1 #endif -#if __USE_ISOC99 && __GNUC_PREREQ(2,97) +#if defined __USE_ISOC99 && __GNUC_PREREQ(2,97) /* ISO C99 defines some macros to compare number while taking care for unordered numbers. Many FPUs provide special instructions to support these operations. Generic support in GCC for these as builtins went @@ -382,7 +382,7 @@ extern int matherr (struct exception *__ # include #endif -#if __USE_ISOC99 +#ifdef __USE_ISOC99 /* If we've still got undefined comparison macros, provide defaults. */ /* Return nonzero value if X is greater than Y. */ -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From drepper@redhat.com Thu Dec 16 16:42:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 16 Dec 2004 16:42:00 -0000 Subject: Fix for math.h In-Reply-To: References: Message-ID: <41C1BA77.6060107@redhat.com> Andreas Jaeger wrote: > Ok to commit? Yes. -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 256 bytes Desc: OpenPGP digital signature URL: From aj@suse.de Thu Dec 16 20:04:00 2004 From: aj@suse.de (Andreas Jaeger) Date: Thu, 16 Dec 2004 20:04:00 -0000 Subject: [PATCH] Some sparc{,v9,64} glibc fixes In-Reply-To: <20041216134720.GU5149@sunsite.mff.cuni.cz> (Jakub Jelinek's message of "Thu, 16 Dec 2004 14:47:20 +0100") References: <20041216134720.GU5149@sunsite.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Hi! > > I have done 3 sparc builds this morning and this is the result of that. > > BTW, Andreas, can you please recompute: > Failure: Test: atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994380 > Result: > is: -1.80338464113663849327e+00 -0x1.cdaa9da7ca620c5349dcp+0 > should be: -1.80338464113663849327e+00 -0x1.cdaa9da7ca620c5349dcp+0 > difference: 3.60900012278724126504e-30 0x1.24cc0000000000000000p-98 > ulp : 18739.0000 > max.ulp : 0.0000 > with additional precision? This is something I haven't included in > libm-test-ulps patch, as that is not atan2 ldbl-128 bug, but testcase. > 30 digits aren't enough, all other numbers have at least 36. Thanks. the result with 36 digits is: -1.80338464113663849327153994379639112 Ok to commit? Andreas 2004-12-16 Andreas Jaeger * math/libm-test.inc (atan2_test): Compute value with 36 digits. ============================================================ Index: math/libm-test.inc --- math/libm-test.inc 21 Nov 2004 19:55:57 -0000 1.63 +++ math/libm-test.inc 16 Dec 2004 18:46:59 -0000 @@ -943,7 +943,7 @@ atan2_test (void) TEST_ff_f (atan2, 0.390625L, .00029L, 1.57005392693128974780151246612928941L); TEST_ff_f (atan2, 1.390625L, 0.9296875L, 0.981498387184244311516296577615519772L); - TEST_ff_f (atan2, -0.00756827042671106339L, -.001792735857538728036L, -1.80338464113663849327153994380L); + TEST_ff_f (atan2, -0.00756827042671106339L, -.001792735857538728036L, -1.80338464113663849327153994379639112L); END (atan2); } -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From aj@suse.de Fri Dec 17 06:47:00 2004 From: aj@suse.de (Andreas Jaeger) Date: Fri, 17 Dec 2004 06:47:00 -0000 Subject: [PATCH] Some sparc{,v9,64} glibc fixes In-Reply-To: <20041216221356.GT10340@devserv.devel.redhat.com> (Jakub Jelinek's message of "Thu, 16 Dec 2004 17:13:56 -0500") References: <20041216134720.GU5149@sunsite.mff.cuni.cz> <20041216221356.GT10340@devserv.devel.redhat.com> Message-ID: Jakub Jelinek writes: > On Thu, Dec 16, 2004 at 07:47:59PM +0100, Andreas Jaeger wrote: >> > BTW, Andreas, can you please recompute: >> > Failure: Test: atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994380 >> > Result: >> > is: -1.80338464113663849327e+00 -0x1.cdaa9da7ca620c5349dcp+0 >> > should be: -1.80338464113663849327e+00 -0x1.cdaa9da7ca620c5349dcp+0 >> > difference: 3.60900012278724126504e-30 0x1.24cc0000000000000000p-98 >> > ulp : 18739.0000 >> > max.ulp : 0.0000 >> > with additional precision? This is something I haven't included in >> > libm-test-ulps patch, as that is not atan2 ldbl-128 bug, but testcase. >> > 30 digits aren't enough, all other numbers have at least 36. Thanks. >> >> the result with 36 digits is: >> -1.80338464113663849327153994379639112 >> >> Ok to commit? >> >> Andreas >> >> 2004-12-16 Andreas Jaeger >> >> * math/libm-test.inc (atan2_test): Compute value with 36 digits. > > Thanks. If you also do > find sysdeps -name libm-test-ulps | xargs sed -i s/1.80338464113663849327153994380/1.80338464113663849327153994379639112/ > then I'd appreciate that (verified this number only appears in this exact > atan2 test). Will do now - thanks for the handy command, Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From jakub@redhat.com Fri Dec 17 07:17:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 17 Dec 2004 07:17:00 -0000 Subject: [PATCH] Some sparc{,v9,64} glibc fixes In-Reply-To: References: <20041216134720.GU5149@sunsite.mff.cuni.cz> <20041216221356.GT10340@devserv.devel.redhat.com> Message-ID: <20041217071747.GV5149@sunsite.mff.cuni.cz> On Fri, Dec 17, 2004 at 07:47:07AM +0100, Andreas Jaeger wrote: > > Thanks. If you also do > > find sysdeps -name libm-test-ulps | xargs sed -i s/1.80338464113663849327153994380/1.80338464113663849327153994379639112/ > > then I'd appreciate that (verified this number only appears in this exact > > atan2 test). > > Will do now - thanks for the handy command, Can you on top of such patch commit also following? 2004-12-17 Jakub Jelinek * sysdeps/sparc/sparc64/fpu/libm-test-ulps: Update. --- libc/sysdeps/sparc/sparc64/fpu/libm-test-ulps.jj 2004-12-17 02:02:25.920847000 -0500 +++ libc/sysdeps/sparc/sparc64/fpu/libm-test-ulps 2004-12-17 02:10:25.134996262 -0500 @@ -4,6 +4,8 @@ Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994379639112": float: 6 ifloat: 6 +ildouble: 1 +ldouble: 1 Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025": float: 3 ifloat: 3 @@ -335,8 +337,8 @@ double: 2 float: 3 idouble: 2 ifloat: 3 -ildouble: 1 -ldouble: 1 +ildouble: 10 +ldouble: 10 Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i": ildouble: 2 ldouble: 2 @@ -1105,8 +1107,8 @@ double: 2 float: 4 idouble: 2 ifloat: 4 -ildouble: 1 -ldouble: 1 +ildouble: 10 +ldouble: 10 Function: Imaginary part of "cpow": double: 2 Jakub From aj@suse.de Fri Dec 17 07:40:00 2004 From: aj@suse.de (Andreas Jaeger) Date: Fri, 17 Dec 2004 07:40:00 -0000 Subject: [PATCH] Some sparc{,v9,64} glibc fixes In-Reply-To: <20041217071747.GV5149@sunsite.mff.cuni.cz> (Jakub Jelinek's message of "Fri, 17 Dec 2004 08:17:48 +0100") References: <20041216134720.GU5149@sunsite.mff.cuni.cz> <20041216221356.GT10340@devserv.devel.redhat.com> <20041217071747.GV5149@sunsite.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > On Fri, Dec 17, 2004 at 07:47:07AM +0100, Andreas Jaeger wrote: >> > Thanks. If you also do >> > find sysdeps -name libm-test-ulps | xargs sed -i s/1.80338464113663849327153994380/1.80338464113663849327153994379639112/ >> > then I'd appreciate that (verified this number only appears in this exact >> > atan2 test). >> >> Will do now - thanks for the handy command, > > Can you on top of such patch commit also following? Yes, Andreas -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From aj@suse.de Sun Dec 19 14:32:00 2004 From: aj@suse.de (Andreas Jaeger) Date: Sun, 19 Dec 2004 14:32:00 -0000 Subject: BZ#560: Fix Message-ID: ICC reserves __interface and therefore has problems including . I suggest the appended patch. Ok to commit? Andreas 2004-12-19 Andreas Jaeger [BZ #560] * inet/netinet/in.h: Use __interface_addr instead of __interface. ============================================================ Index: inet/netinet/in.h --- inet/netinet/in.h 7 Aug 2004 18:21:41 -0000 1.52 +++ inet/netinet/in.h 19 Dec 2004 14:31:25 -0000 @@ -479,13 +479,13 @@ extern int inet6_option_find (__const st /* Multicast source filter support. */ /* Get IPv4 source filter. */ -extern int getipv4sourcefilter (int __s, struct in_addr __interface, +extern int getipv4sourcefilter (int __s, struct in_addr __interface_addr, struct in_addr __group, uint32_t *__fmode, uint32_t *__numsrc, struct in_addr *__slist) __THROW; /* Set IPv4 source filter. */ -extern int setipv4sourcefilter (int __s, struct in_addr __interface, +extern int setipv4sourcefilter (int __s, struct in_addr __interface_addr, struct in_addr __group, uint32_t __fmode, uint32_t __numsrc, __const struct in_addr *__slist) @@ -493,14 +493,14 @@ extern int setipv4sourcefilter (int __s, /* Get source filter. */ -extern int getsourcefilter (int __s, uint32_t __interface, +extern int getsourcefilter (int __s, uint32_t __interface_addr, __const struct sockaddr *__group, socklen_t __grouplen, uint32_t *__fmode, uint32_t *__numsrc, struct sockaddr_storage *__slist) __THROW; /* Set source filter. */ -extern int setsourcefilter (int __s, uint32_t __interface, +extern int setsourcefilter (int __s, uint32_t __interface_addr, __const struct sockaddr *__group, socklen_t __grouplen, uint32_t __fmode, uint32_t __numsrc, -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From aj@suse.de Sun Dec 19 19:26:00 2004 From: aj@suse.de (Andreas Jaeger) Date: Sun, 19 Dec 2004 19:26:00 -0000 Subject: Fix sunrpc/xcrypt.c for GCC 4.0 Message-ID: Ok to commit the appended patch to fix xcrypt with GCC 4.0? This is similar to a patch by Alexandre for getnetgrent_r. Andreas 2004-12-19 Andreas Jaeger [BZ #573] * sunrpc/xcrypt.c (passwd2des_internal): Make it hidden instead of internal linkage. ============================================================ Index: sunrpc/xcrypt.c --- sunrpc/xcrypt.c 17 Sep 2002 10:58:00 -0000 1.7 +++ sunrpc/xcrypt.c 19 Dec 2004 15:13:10 -0000 @@ -69,13 +69,15 @@ static char hexval (char) internal_funct static void hex2bin (int, char *, char *) internal_function; static void bin2hex (int, unsigned char *, char *) internal_function; -static void passwd2des_internal (char *pw, char *key); - +void passwd2des_internal (char *pw, char *key); +#ifdef _LIBC +libc_hidden_proto (passwd2des_internal) +#endif /* * Turn password into DES key */ -static void +void passwd2des_internal (char *pw, char *key) { int i; @@ -88,6 +90,7 @@ passwd2des_internal (char *pw, char *key } #ifdef _LIBC +libc_hidden_def (passwd2des_internal) strong_alias (passwd2des_internal, passwd2des) #else void passwd2des (char *pw, char *key) -- Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From roland@redhat.com Sun Dec 19 20:23:00 2004 From: roland@redhat.com (Roland McGrath) Date: Sun, 19 Dec 2004 20:23:00 -0000 Subject: BZ#560: Fix In-Reply-To: Andreas Jaeger's message of Sunday, 19 December 2004 15:32:31 +0100 Message-ID: <200412192023.iBJKNJCq003369@magilla.sf.frob.com> > ICC reserves __interface and therefore has problems including > . I suggest the appended patch. > > Ok to commit? Yes, that is fine. From roland@redhat.com Sun Dec 19 20:33:00 2004 From: roland@redhat.com (Roland McGrath) Date: Sun, 19 Dec 2004 20:33:00 -0000 Subject: Fix sunrpc/xcrypt.c for GCC 4.0 In-Reply-To: Andreas Jaeger's message of Sunday, 19 December 2004 20:15:13 +0100 Message-ID: <200412192033.iBJKX9Kv003417@magilla.sf.frob.com> > 2004-12-19 Andreas Jaeger > > [BZ #573] > * sunrpc/xcrypt.c (passwd2des_internal): Make it hidden instead of > internal linkage. Yes, this is ok. From hjl@lucon.org Sun Dec 19 20:59:00 2004 From: hjl@lucon.org (H. J. Lu) Date: Sun, 19 Dec 2004 20:59:00 -0000 Subject: Fix sunrpc/xcrypt.c for GCC 4.0 In-Reply-To: References: Message-ID: <20041219205945.GB29877@lucon.org> On Sun, Dec 19, 2004 at 08:15:13PM +0100, Andreas Jaeger wrote: > > Ok to commit the appended patch to fix xcrypt with GCC 4.0? This is > similar to a patch by Alexandre for getnetgrent_r. > > Andreas > > 2004-12-19 Andreas Jaeger > > [BZ #573] > * sunrpc/xcrypt.c (passwd2des_internal): Make it hidden instead of > internal linkage. > > ============================================================ > Index: sunrpc/xcrypt.c > --- sunrpc/xcrypt.c 17 Sep 2002 10:58:00 -0000 1.7 > +++ sunrpc/xcrypt.c 19 Dec 2004 15:13:10 -0000 > @@ -69,13 +69,15 @@ static char hexval (char) internal_funct > > static void hex2bin (int, char *, char *) internal_function; > static void bin2hex (int, unsigned char *, char *) internal_function; > -static void passwd2des_internal (char *pw, char *key); > - > +void passwd2des_internal (char *pw, char *key); > +#ifdef _LIBC > +libc_hidden_proto (passwd2des_internal) > +#endif > > /* > * Turn password into DES key > */ > -static void > +void > passwd2des_internal (char *pw, char *key) > { > int i; > @@ -88,6 +90,7 @@ passwd2des_internal (char *pw, char *key > } > > #ifdef _LIBC > +libc_hidden_def (passwd2des_internal) > strong_alias (passwd2des_internal, passwd2des) > #else > void passwd2des (char *pw, char *key) This patch will make gcc not to inline passwd2des_internal which is the correct thing to do. Marking passwd2des_internal as "used" will support inlining passwd2des_internal. H.J. From roland@redhat.com Tue Dec 21 02:58:00 2004 From: roland@redhat.com (Roland McGrath) Date: Tue, 21 Dec 2004 02:58:00 -0000 Subject: glibc 2.3 stable branch Message-ID: <200412210257.iBL2vx3Y018518@magilla.sf.frob.com> There is a new branch called glibc-2_3-branch in the glibc CVS repository. The tag glibc-2_3-base marks the point it forked from HEAD (and the branch hasn't had any commits of its own so far). This is now the stable production release branch. I anticipate calling 2.3.4 released soon with perhaps no further changes. But the new branch is for 2.3.x, not just 2.3.4; 2.3.5 and future 2.3.x versions will come from this branch. After 2.3.4, these releases will contain necessary fixes only, and follow strict rules, as I have mentioned in the past and will detail below. The trunk of the glibc CVS repository remains the place for primary development. As of now, the work done there is slated for future 2.4.x releases (whenever they may be); new ABI symbols added will be in a GLIBC_2.4 version set. In bugzilla there is now a "2.3.4" version available, and for the time being that's what reports about the code in glibc-2_3-branch should use. In the past, I have described on this mailing list my thoughts for how a stable release process would go. There was never a whole lot of discussion on it, and as a result I remain convinced of the wisdom of my original plan. That's what we're doing now. I'll summarize the essential rules of the process, but for the complex rationalizations you can look up my prior drivel. The paramount rule of the stable branch is that everything that happens there must be specifically approved by the branch's release manager, who is me. I intend to be merciless about enforcing these rules I'm making up right now. (Of course, I will violate them myself for unspecified reasons at unspecified times, but that doesn't mean I will violate them for you when you ask.) The essential theory of the stable production branch is that it only ever gets changes that have already been tested in production. Every change must have an associated bugzilla number. When the issue has been fixed in the stable branch, the bugzilla report should not be marked as closed until the issue is resolved in the trunk code as well. If an issue is addressed in the trunk first and a change is being backported, a new bugzilla item should be filed under the stable version (now 2.3.4) explaining the situation. There are no ABI or API additions in the stable branch. There will never be a new version set called "GLIBC_2.3.something", GLIBC_2.3.4 is it. The only kind of ABI change that might be considered is something correcting broken compatibility with a past ABI to match the actual ABI of the past. Header file changes will be restricted to necessary things like syntax fixes and harmless things like comment changes or minute macro rearrangements, or changes that correct a recent unintended incompatibility with the API of the past. No changes will go directly onto the stable branch. No changes will be automatically backported from the trunk to the stable branch. (I will probably relax this for non-code changes, and I'm liable to make occasional exceptions for minuscule and obviously correct fixes.) A change goes in only after it has been tested in real-world situations in someone's production version of the stable branch code. i.e., some kind of test release, or rolling public development with a lot of testers (such as Fedora development, aka Rawhide), with some credible amount of QA work done somewhere. These releases of modified versions of the stable branch are what in reality get all the real testing there is, so they are part of the criteria for including code in the stable branch. I don't just mean "my distro uses this patch and we are happy". For starters, I mean whole-system distributors' system libraries that are having production binaries tested regularly, that are based on the entire current glibc stable branch, and have minimal divergence from the official stable branch code. To my knowledge, at the moment these criteria mean de facto just fedora-branch. That's not because Fedora is special, it's because Fedora is trying hard to stay close to the current official code. I hope the glibc maintainers for other distribution projects will bring their packages up to using the current stable glibc code, and get involved directly in the stable branch maintenance. Patches meeting these criteria don't necessarily go in, of course. They are also subject to the release manager's discretion, and I may reject things that are not critically important enough for the stable branch, or that are not good enough or not appropriate for GNU software, even if everyone's distribution is using them. Note that I have not done any branching or tagging of the add-on ports module in the glibc repository. It's easy enough to do retroactively if we decide that's what we want. Off hand, I am expecting that the working ports there (actually everything there but am33 is known to be quite bit-rotted already) may keep up only with the stable branch for quite some time, and that new contributed ports will usually want to start out targetted for the current stable branch at whatever time they go into the ports repository. Hence the ports module may well stay one step behind, with its trunk corresponding to the current stable branch of the libc module. If you have questions about this process, please send them to me and I'll CC my response to the list if I think it will be useful (unless you ask me not to, of course). Thanks, Roland From jakub@redhat.com Tue Dec 21 17:54:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 21 Dec 2004 17:54:00 -0000 Subject: [PATCH] Fix i386 stack alignment in clone and linuxthreads Message-ID: <20041221175348.GX5149@sunsite.mff.cuni.cz> Hi! As shown by the testcases below, while NPTL maintains 16 byte stack alignment on i386 for thread body function, LinuxThreads and, probably more important (as LT is going to die eventually) clone function don't. Turns out sysdeps/unix/sysv/linux/i386/clone.S has been adjusted to what CALL_THREAD_FCT did, i.e. account for an extra pushl in there. So, in NPTL, start_thread function has misaligned stack (and any function it calls, with the exception of the thread body). I think this is wrong, as if you use clone yourself, you should be able to expect aligned stack. This patch further adds an i386/tst-stack-align.h, so that the 16 byte stack alignment is tested not just on -march=pentium4 or -msse2 compiled glibc, but any glibc. 2004-12-21 Jakub Jelinek * sysdeps/unix/sysv/linux/i386/clone.S (__clone): Make sure %esp when calling fn is 16 byte aligned. * sysdeps/i386/tst-stack-align.h: New file. nptl/ * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of %esp. * Makefile (tests): Add tst-align2. * tst-align2.c: New test. * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add -mpreferred-stack-boundary=4. linuxthreads/ * Makefile (tests): Add tst-align. * tst-align.c: New test. * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. --- libc/sysdeps/unix/sysv/linux/i386/clone.S.jj 2004-12-06 12:40:59.000000000 +0100 +++ libc/sysdeps/unix/sysv/linux/i386/clone.S 2004-12-21 15:05:27.000000000 +0100 @@ -67,7 +67,7 @@ ENTRY (BP_SYM (__clone)) /* Insert the argument onto the new stack. Make sure the new thread is started with an alignment of (mod 16). */ andl $0xfffffff0, %ecx - subl $24,%ecx + subl $28,%ecx movl ARG(%esp),%eax /* no negative argument counts */ movl %eax,12(%ecx) --- libc/sysdeps/i386/tst-stack-align.h.jj 2004-12-21 14:41:36.000000000 +0100 +++ libc/sysdeps/i386/tst-stack-align.h 2004-12-21 14:56:17.000000000 +0100 @@ -0,0 +1,42 @@ +/* Copyright (C) 2004 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 + +typedef struct { int i[4]; } int_al16 __attribute__((aligned (16))); + +#define TEST_STACK_ALIGN() \ + ({ \ + int_al16 _m; \ + double _d = 12.0; \ + long double _ld = 15.0; \ + int _ret = 0; \ + printf ("int_al16: %p %zu\n", &_m, __alignof (int_al16)); \ + if ((((uintptr_t) &_m) & (__alignof (int_al16) - 1)) != 0) \ + _ret = 1; \ + \ + printf ("double: %g %p %zu\n", _d, &_d, __alignof (double)); \ + if ((((uintptr_t) &_d) & (__alignof (double) - 1)) != 0) \ + _ret = 1; \ + \ + printf ("ldouble: %Lg %p %zu\n", _ld, &_ld, __alignof (long double)); \ + if ((((uintptr_t) &_ld) & (__alignof (long double) - 1)) != 0) \ + _ret = 1; \ + _ret; \ + }) --- libc/nptl/Makefile.jj 2004-12-13 09:36:18.000000000 +0100 +++ libc/nptl/Makefile 2004-12-21 16:19:21.000000000 +0100 @@ -205,7 +205,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 \ tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \ tst-sem8 tst-sem9 \ tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \ - tst-align \ + tst-align tst-align2 \ tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \ tst-kill1 tst-kill2 tst-kill3 tst-kill4 tst-kill5 tst-kill6 \ tst-raise1 \ --- libc/nptl/tst-align2.c.jj 2004-12-21 14:44:48.000000000 +0100 +++ libc/nptl/tst-align2.c 2004-12-21 14:59:04.000000000 +0100 @@ -0,0 +1,87 @@ +/* Copyright (C) 2004 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 +#include +#include +#include + +static int +f (void *arg) +{ + bool ok = true; + + if (TEST_STACK_ALIGN ()) + ok = false; + + return ok ? 0 : 1; +} + +static int +do_test (void) +{ + bool ok = true; + + puts ("in main"); + + if (TEST_STACK_ALIGN ()) + ok = false; + +#ifdef __ia64__ + extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base, + size_t __child_stack_size, int __flags, + void *__arg, ...); + char st[256 * 1024]; + pid_t p = __clone2 (f, st, sizeof (st), 0, 0); +#else + char st[128 * 1024]; + pid_t p = clone (f, st + sizeof (st), 0, 0); +#endif + if (p == -1) + { + printf("clone failed: %m\n"); + return 1; + } + + int e; + if (waitpid (p, &e, __WCLONE) != p) + { + puts ("waitpid failed"); + kill (p, SIGKILL); + return 1; + } + if (!WIFEXITED (e)) + { + if (WIFSIGNALED (e)) + printf ("died from signal %s\n", strsignal (WTERMSIG (e))); + else + puts ("did not terminate correctly"); + return 1; + } + if (WEXITSTATUS (e) != 0) + ok = false; + + return ok ? 0 : 1; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" --- libc/nptl/sysdeps/i386/Makefile.jj 2004-05-18 10:55:59.000000000 +0200 +++ libc/nptl/sysdeps/i386/Makefile 2004-12-21 15:00:18.000000000 +0100 @@ -22,4 +22,6 @@ endif ifeq ($(subdir),nptl) CFLAGS-pthread_create.c += -mpreferred-stack-boundary=4 +CFLAGS-tst-align.c += -mpreferred-stack-boundary=4 +CFLAGS-tst-align2.c += -mpreferred-stack-boundary=4 endif --- libc/nptl/sysdeps/i386/tls.h.jj 2004-05-18 10:55:59.000000000 +0200 +++ libc/nptl/sysdeps/i386/tls.h 2004-12-21 15:15:47.000000000 +0100 @@ -397,9 +397,12 @@ union user_desc_init #define CALL_THREAD_FCT(descr) \ ({ void *__res; \ int __ignore1, __ignore2; \ - asm volatile ("pushl %%gs:%P4\n\t" \ + asm volatile ("pushl %%eax\n\t" \ + "pushl %%eax\n\t" \ + "pushl %%eax\n\t" \ + "pushl %%gs:%P4\n\t" \ "call *%%gs:%P3\n\t" \ - "addl $4, %%esp" \ + "addl $16, %%esp" \ : "=a" (__res), "=c" (__ignore1), "=d" (__ignore2) \ : "i" (offsetof (struct pthread, start_routine)), \ "i" (offsetof (struct pthread, arg))); \ --- libc/linuxthreads/Makefile.jj 2004-12-06 12:40:53.000000000 +0100 +++ libc/linuxthreads/Makefile 2004-12-21 15:02:37.000000000 +0100 @@ -111,7 +111,7 @@ tests = ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex17 ex18 tst-cancel tst-context bug-sleep \ tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 tst-cancel5 \ tst-cancel6 tst-cancel7 tst-cancel8 tst-popen tst-popen2 tst-attr1 \ - tst-stack1 + tst-stack1 tst-align test-srcs = tst-signal # These tests are linked with libc before libpthread tests-reverse += tst-cancel5 --- libc/linuxthreads/sysdeps/i386/Makefile.jj 2003-09-17 11:13:28.000000000 +0200 +++ libc/linuxthreads/sysdeps/i386/Makefile 2004-12-21 15:03:38.000000000 +0100 @@ -15,6 +15,7 @@ CFLAGS-pthread.c += -fno-omit-frame-poin CFLAGS-ptlongjmp.c += -fno-omit-frame-pointer CFLAGS-semaphore.c += -fno-omit-frame-pointer CFLAGS-sighandler.c += -fno-omit-frame-pointer -mpreferred-stack-boundary=4 +CFLAGS-tst-align.c += -mpreferred-stack-boundary=4 endif ifeq ($(subdir),csu) --- libc/linuxthreads/tst-align.c.jj 2004-12-21 15:01:36.000000000 +0100 +++ libc/linuxthreads/tst-align.c 2003-09-17 10:31:18.000000000 +0200 @@ -0,0 +1,71 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2003. + + 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 + +static void * +tf (void *arg) +{ + bool ok = true; + + puts ("in thread"); + + if (TEST_STACK_ALIGN ()) + ok = false; + + return ok ? NULL : (void *) -1l; +} + +static int +do_test (void) +{ + bool ok = true; + + puts ("in main"); + + if (TEST_STACK_ALIGN ()) + ok = false; + + pthread_t th; + if (pthread_create (&th, NULL, tf, NULL) != 0) + { + puts ("create failed"); + return 1; + } + + void *res; + if (pthread_join (th, &res) != 0) + { + puts ("join failed"); + return 1; + } + + if (res != NULL) + ok = false; + + return ok ? 0 : 1; +} + + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" Jakub From jakub@redhat.com Tue Dec 21 18:09:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 21 Dec 2004 18:09:00 -0000 Subject: [PATCH] Fix {,q}ecvt{,_r} on denormals Message-ID: <20041221180906.GY5149@sunsite.mff.cuni.cz> Hi! As shown by the testcase below, ecvt/ecvt_r doesn't work on denormals (well, it works for double denormals on IA-32 unless -mfpmath=sse, as there if you are lucky f is computed in long double precision and not spilled until done with it). The problem is that a denormal needs to be multiplied by a power of 10 bigger than what can fit into the floating type (double resp. long double) if the result of the multiplication should be bigger or equal than 1.0. So current CVS code overflows f into +Inf and efcvt_r gives incorrect result. If ecvt/ecvt_r was some function where we would care a lot about speed, it would be perhaps good to also use some precomputed powers of ten (1e-4096, 1e-2048, ... 1e1, 1e2, 1e4, 1e8, 1e16, 1e32, 1e64, ... 1e4096), so that we don't for close to smallest normalized doubles multiply f by 10 ~ 300 times and for really small long doubles ~ 4900 times. But given that it is a legacy function, I'm not sure if it is ok to increase .rodata by 16 * sizeof (double) and 24 * sizeof (long double) and code size because of that. What do you think? 2004-12-21 Jakub Jelinek * misc/efgcvt_r.c (FLOAT_MIN_10_EXP, FLOAT_MIN_10_NORM): Define. (ecvt_r): Special case denormals. * misc/qefgcvt_r.c (FLOAT_MIN_10_EXP, FLOAT_MIN_10_NORM): Define. * misc/tst-efgcvt.c: Include float.h. (ecvt_tests): Add 2 new tests. --- libc/misc/tst-efgcvt.c.jj 2001-07-06 06:55:36.000000000 +0200 +++ libc/misc/tst-efgcvt.c 2004-12-21 18:41:02.890224202 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2000, 2004 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 @@ -20,6 +20,7 @@ # define _GNU_SOURCE 1 #endif +#include #include #include #include @@ -59,6 +60,10 @@ static testcase ecvt_tests[] = { 123.01, -4, 3, "" }, { 126.71, -4, 3, "" }, { 0.0, 4, 1, "0000" }, +#if DBL_MANT_DIG == 53 + { 0x1p-1074, 3, -323, "494" }, + { -0x1p-1074, 3, -323, "494" }, +#endif /* -1.0 is end marker. */ { -1.0, 0, 0, "" } }; --- libc/misc/qefgcvt_r.c.jj 2004-05-07 14:32:16.000000000 +0200 +++ libc/misc/qefgcvt_r.c 2004-12-21 18:18:31.261313136 +0100 @@ -24,6 +24,7 @@ #define FUNC_PREFIX q #define FLOAT_FMT_FLAG "L" #define FLOAT_NAME_EXT l +#define FLOAT_MIN_10_EXP LDBL_MIN_10_EXP #if LDBL_MANT_DIG == 64 # define NDIGIT_MAX 21 #elif LDBL_MANT_DIG == 53 @@ -40,5 +41,16 @@ # error "NDIGIT_MAX must be precomputed" # define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * LDBL_MANT_DIG + 1.0))) #endif +#if LDBL_MIN_10_EXP == -37 +# define FLOAT_MIN_10_NORM 1.0e-37L +#elif LDBL_MIN_10_EXP == -307 +# define FLOAT_MIN_10_NORM 1.0e-307L +#elif LDBL_MIN_10_EXP == -4931 +# define FLOAT_MIN_10_NORM 1.0e-4931L +#else +/* libc can't depend on libm. */ +# error "FLOAT_MIN_10_NORM must be precomputed" +# define FLOAT_MIN_10_NORM exp10l (LDBL_MIN_10_EXP) +#endif #include "efgcvt_r.c" --- libc/misc/efgcvt_r.c.jj 2004-08-04 14:42:22.000000000 +0200 +++ libc/misc/efgcvt_r.c 2004-12-21 18:31:52.486396147 +0100 @@ -1,5 +1,5 @@ /* Compatibility functions for floating point formatting, reentrant versions. - Copyright (C) 1995,96,97,98,99,2000,01,02 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,01,02,04 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 @@ -31,6 +31,7 @@ # define FUNC_PREFIX # define FLOAT_FMT_FLAG # define FLOAT_NAME_EXT +# define FLOAT_MIN_10_EXP DBL_MIN_10_EXP # if DBL_MANT_DIG == 53 # define NDIGIT_MAX 17 # elif DBL_MANT_DIG == 24 @@ -43,6 +44,17 @@ # error "NDIGIT_MAX must be precomputed" # define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0))) # endif +# if DBL_MIN_10_EXP == -37 +# define FLOAT_MIN_10_NORM 1.0e-37 +# elif DBL_MIN_10_EXP == -307 +# define FLOAT_MIN_10_NORM 1.0e-307 +# elif DBL_MIN_10_EXP == -4931 +# define FLOAT_MIN_10_NORM 1.0e-4931 +# else +/* libc can't depend on libm. */ +# error "FLOAT_MIN_10_NORM must be precomputed" +# define FLOAT_MIN_10_NORM exp10 (DBL_MIN_10_EXP) +# endif #endif #define APPEND(a, b) APPEND2 (a, b) @@ -171,6 +183,17 @@ APPEND (FUNC_PREFIX, ecvt_r) (value, ndi d = -value; else d = value; + /* For denormalized numbers the d < 1.0 case below won't work, + as f can overflow to +Inf. */ + if (d < FLOAT_MIN_10_NORM) + { + value /= FLOAT_MIN_10_NORM; + if (value < 0.0) + d = -value; + else + d = value; + exponent += FLOAT_MIN_10_EXP; + } if (d < 1.0) { do Jakub From drepper@redhat.com Wed Dec 22 19:57:00 2004 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 22 Dec 2004 19:57:00 -0000 Subject: [PATCH] Fix {,q}ecvt{,_r} on denormals In-Reply-To: <20041221180906.GY5149@sunsite.mff.cuni.cz> References: <20041221180906.GY5149@sunsite.mff.cuni.cz> Message-ID: <41C9D18B.8040709@redhat.com> Jakub Jelinek wrote: > But given that it is a legacy function, I'm not sure if it > is ok to increase .rodata by 16 * sizeof (double) and 24 * sizeof (long > double) and code size because of that. What do you think? It's definitely not necessary. Only denorms are affected and if somebody uses them with these interfaces, I very much doubt the quality of the code. -- ??? Ulrich Drepper ??? Red Hat, Inc. ??? 444 Castro St ??? Mountain View, CA ??? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature URL: From bonzini@gnu.org Mon Dec 27 15:26:00 2004 From: bonzini@gnu.org (Paolo Bonzini) Date: Mon, 27 Dec 2004 15:26:00 -0000 Subject: Ping: BZ501, BZ605, BZ611 Message-ID: <41D028F7.70307@gnu.org> All of these had been posted to libc-alpha; I've just checked that the patches on Bugzilla apply to the current CVS. Tested with the sed testsuite on powerpc-darwin (in the CVS version, it tests REG_NO_SUB behavior as well), and with the glibc testsuite on powerpc-linux. Paolo From jakub@redhat.com Wed Dec 29 11:24:00 2004 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 29 Dec 2004 11:24:00 -0000 Subject: [PATCH] ia64 libm update Message-ID: <20041229112119.GN3168@sunsite.mff.cuni.cz> Hi! wget -O ia64-libm.patch.bz2 'http://sources.redhat.com/bugzilla/attachment.cgi?id=327&action=view' bzcat ia64-libm.patch.bz2 | patch -p0 -E rm -f sysdeps/ia64/fpu/e_atan2l.S sysdeps/ia64/fpu/e_expl.S with the following fix on top of it looks good for me (no make check regressions, no ABI changes, the licensing comments look ok as well and it doesn't introduce new libc.so PLT slots (and even removes some libm.so PLT slots). Can you please apply? Thanks. 2004-12-29 Jakub Jelinek * sysdeps/ia64/fpu/libm_support.h (__libm_error_support): Use libc_hidden_proto instead of HIDDEN_PROTO. * sysdeps/ia64/fpu/libm-symbols.h (HIDDEN_PROTO): Remove. (__libm_error_support): If ASSEMBLER and in libc, define to HIDDEN_JUMPTARGET(__libm_error_support). --- sysdeps/ia64/fpu/libm_support.h.jj 2004-12-29 05:02:00.678755000 -0500 +++ sysdeps/ia64/fpu/libm_support.h 2004-12-29 05:27:08.673668532 -0500 @@ -286,7 +286,7 @@ typedef enum void __libm_error_support(void*,void*,void*,error_types); #ifdef _LIBC -HIDDEN_PROTO(__libm_error_support) +libc_hidden_proto(__libm_error_support) #endif #define HI_SIGNIFICAND_LESS(X, HI) ((X)->hi_significand < 0x ## HI) --- sysdeps/ia64/fpu/libm-symbols.h.jj 2004-12-29 05:02:00.576216000 -0500 +++ sysdeps/ia64/fpu/libm-symbols.h 2004-12-29 05:30:41.246042994 -0500 @@ -59,8 +59,6 @@ ASM_SIZE_DIRECTIVE(__ieee754_##name); \ ASM_TYPE_DIRECTIVE(__ieee754_##name, @function) -#ifdef ASSEMBLER -# define HIDDEN_PROTO(name) HIDDEN_JUMPTARGET(name) -#else -# define HIDDEN_PROTO(name) libc_hidden_proto(name) +#if defined ASSEMBLER && !defined NOT_IN_libc +# define __libm_error_support HIDDEN_JUMPTARGET(__libm_error_support) #endif Jakub