[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r2877 - in /fsf/trunk/libc: ./ bits/ debug/ hurd/hurd/ include/ libio/ localedata/ localedata/locales/ malloc/ nptl/ nptl/sy...



Author: eglibc
Date: Fri Jul 20 00:02:41 2007
New Revision: 2877

Log:
Import glibc-mainline for 2007-07-20

Added:
    fsf/trunk/libc/stdio-common/tst-popen2.c
    fsf/trunk/libc/sysdeps/ia64/sched_cpucount.c
    fsf/trunk/libc/sysdeps/powerpc/sched_cpucount.c
Modified:
    fsf/trunk/libc/CONFORMANCE
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/bits/confname.h
    fsf/trunk/libc/bits/sched.h
    fsf/trunk/libc/bits/types.h
    fsf/trunk/libc/debug/fprintf_chk.c
    fsf/trunk/libc/debug/fwprintf_chk.c
    fsf/trunk/libc/debug/printf_chk.c
    fsf/trunk/libc/debug/vfprintf_chk.c
    fsf/trunk/libc/debug/vfwprintf_chk.c
    fsf/trunk/libc/debug/vprintf_chk.c
    fsf/trunk/libc/debug/vwprintf_chk.c
    fsf/trunk/libc/debug/wprintf_chk.c
    fsf/trunk/libc/hurd/hurd/signal.h
    fsf/trunk/libc/include/features.h
    fsf/trunk/libc/libio/iopopen.c
    fsf/trunk/libc/libio/libioP.h
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/locales/ar_SA
    fsf/trunk/libc/localedata/locales/dz_BT
    fsf/trunk/libc/malloc/malloc.h
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/pthread/bits/stdio-lock.h
    fsf/trunk/libc/posix/getconf.c
    fsf/trunk/libc/posix/sched.h
    fsf/trunk/libc/signal/signal.h
    fsf/trunk/libc/stdio-common/Makefile
    fsf/trunk/libc/stdlib/stdlib.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
    fsf/trunk/libc/sysvipc/sys/msg.h
    fsf/trunk/libc/wcsmbs/wchar.h

Modified: fsf/trunk/libc/CONFORMANCE
==============================================================================
--- fsf/trunk/libc/CONFORMANCE (original)
+++ fsf/trunk/libc/CONFORMANCE Fri Jul 20 00:02:41 2007
@@ -85,10 +85,8 @@
 GCC options		Standard version
 -ansi			ISO/IEC 9899:1990
 -std=c89		ISO/IEC 9899:1990
--std=iso9899:199409	ISO/IEC 9899:1990 as amended by Amd.1:1995 *
+-std=iso9899:199409	ISO/IEC 9899:1990 as amended by Amd.1:1995
 -std=c99		ISO/IEC 9899:1999
-
-* glibc does not support this standard version.
 
 (Note that -std=c99 is not available in GCC 2.95.2, and that no
 version of GCC presently existing implements the full C99 standard.)
@@ -174,25 +172,4 @@
 Issues with headers
 ===================
 
-There are various technical issues with the definitions contained in
-glibc's headers, listed below.  The list below assumes GCC 3.3.2, and
-relates to i686-linux; older GCC may lead to more problems in the
-headers.
-
-Note that the _t suffix is reserved by POSIX, but not by pure ISO C.
-Also, the Single Unix Specification generally requires more types to
-be included in headers (if _XOPEN_SOURCE is defined appropriately)
-than ISO C permits.
-
-<ctype.h> should not declare size_t.
-
-<signal.h> should not declare size_t.
-
-<stdio.h> should not declare or use wchar_t or wint_t.
-
-<wchar.h> does not support AMD1; to support it, the functions
-fwprintf, fwscanf, wprintf, wscanf, swprintf, swscanf, vfwprintf,
-vwprintf, vswprintf and fwide would need to be declared when
-__STDC_VERSION__ >= 199409L and not just for C99.
-
-<wctype.h> should not declare size_t.
+None known.

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Jul 20 00:02:41 2007
@@ -1,3 +1,62 @@
+2007-07-18  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* include/features.h (__USE_ISOC95): New define.
+	* wcsmbs/wchar.h (fwprintf, fwscanf, wprintf, wscanf, swprintf,
+	swscanf, vfwprintf, vwprintf, vswprintf, fwide): Define even
+	for -std=iso9899:199409.
+	* CONFORMANCE: Remove comments about unsupported AMD1.
+
+2007-07-17  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/ia64/sched_cpucount.c: New file.
+	* sysdeps/powerpc/sched_cpucount.c: New file.
+
+2007-07-17  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/bits/sched.h (__sched_cpucount): Add
+	__BEGIN_DECLS/__END_DECLS around the prototype.
+	* bits/sched.h (__sched_cpucount): Likewise.  Make second argument
+	pointer to const cpu_set_t.
+
+	* bits/types.h: Don't include stddef.h, don't define __need_size_t.
+	* signal/signal.h <__USE_BSD || __USE_XOPEN_EXTENDED>: Define
+	__need_size_t and include stddef.h.
+	* sysvipc/sys/msg.h: Likewise.
+	* posix/sched.h: Likewise.
+	* hurd/hurd/signal.h (__need_size_t): Define.
+
+	* CONFORMANCE: ctype.h and wctype.h no longer define size_t,
+	neither does signal.h in pedantic ISO C namespaces.  stdio.h
+	no longer defines wint_t or wchar_t.
+
+	* libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): New function.
+	* debug/vfwprintf_chk.c (__vfwprintf_chk): Use
+	_IO_acquire_lock_clear_flags2 instead of _IO_acquire_lock.
+	* debug/vprintf_chk.c (__vprintf_chk): Likewise.
+	* debug/vwprintf_chk.c (__vwprintf_chk): Likewise.
+	* debug/vfprintf_chk.c (__vfprintf_chk): Likewise.
+	* debug/fwprintf_chk.c (__fwprintf_chk): Likewise.
+	* debug/printf_chk.c (__printf_chk): Likewise.
+	* debug/fprintf_chk.c (__fprintf_chk): Likewise.
+	* debug/wprintf_chk.c (__wprintf_chk): Likewise.
+
+	* sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
+	Define.
+
+	* bits/confname.h (_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS): Define.
+	* posix/getconf.c (vars): Add POSIX_V6_WIDTH_RESTRICTED_ENVS.
+
+2007-07-16  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	[BZ #4792]
+	* stdlib/stdlib.h (realloc): Remove __attribute_malloc__.
+	* malloc/malloc.h (realloc): Likewise.
+
+	* libio/iopopen.c (_IO_new_proc_open): Don't close child_std_end
+	if one of proc_file_chain streams has that fileno.
+	* stdio-common/Makefile (tests): Add tst-popen2.
+	* stdio-common/tst-popen2.c: New test.
+
 2007-07-14  Jakub Jelinek  <jakub@xxxxxxxxxx>
 
 	* elf/ldconfig.c: Allow GPLv2 or any later version.

Modified: fsf/trunk/libc/bits/confname.h
==============================================================================
--- fsf/trunk/libc/bits/confname.h (original)
+++ fsf/trunk/libc/bits/confname.h Fri Jul 20 00:02:41 2007
@@ -1,5 +1,5 @@
 /* `sysconf', `pathconf', and `confstr' NAME values.  Generic version.
-   Copyright (C) 1993,1995-1998,2000,2001,2003,2004
+   Copyright (C) 1993,1995-1998,2000,2001,2003,2004,2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -509,7 +509,8 @@
 #define _CS_PATH		_CS_PATH
 
     _CS_V6_WIDTH_RESTRICTED_ENVS,
-# define _CS_V6_WIDTH_RESTRICTED_ENVS	_CS_V6_WIDTH_RESTRICTED_ENVS
+#define _CS_V6_WIDTH_RESTRICTED_ENVS	_CS_V6_WIDTH_RESTRICTED_ENVS
+#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	_CS_V6_WIDTH_RESTRICTED_ENVS
 
     _CS_GNU_LIBC_VERSION,
 #define _CS_GNU_LIBC_VERSION	_CS_GNU_LIBC_VERSION

Modified: fsf/trunk/libc/bits/sched.h
==============================================================================
--- fsf/trunk/libc/bits/sched.h (original)
+++ fsf/trunk/libc/bits/sched.h Fri Jul 20 00:02:41 2007
@@ -68,7 +68,14 @@
   ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
 # define __CPU_ISSET(cpu, cpusetp) \
   (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
-extern int __sched_cpucount (size_t __setsize, cpu_set_t *__setp) __THROW;
+
+__BEGIN_DECLS
+
+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+     __THROW;
+
+__END_DECLS
+
 # define __CPU_COUNT(cpusetp) \
   __sched_cpucount (sizeof (cpu_set_t), cpusetp)
 #endif

Modified: fsf/trunk/libc/bits/types.h
==============================================================================
--- fsf/trunk/libc/bits/types.h (original)
+++ fsf/trunk/libc/bits/types.h Fri Jul 20 00:02:41 2007
@@ -1,5 +1,5 @@
 /* bits/types.h -- definitions of __*_t types underlying *_t types.
-   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2007 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
@@ -26,9 +26,6 @@
 
 #include <features.h>
 #include <bits/wordsize.h>
-
-#define __need_size_t
-#include <stddef.h>
 
 /* Convenience types.  */
 typedef unsigned char __u_char;

Modified: fsf/trunk/libc/debug/fprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/fprintf_chk.c (original)
+++ fsf/trunk/libc/debug/fprintf_chk.c Fri Jul 20 00:02:41 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2006
+/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -29,7 +29,7 @@
   va_list ap;
   int done;
 
-  _IO_acquire_lock (fp);
+  _IO_acquire_lock_clear_flags2 (fp);
   if (flag > 0)
     fp->_flags2 |= _IO_FLAGS2_FORTIFY;
 

Modified: fsf/trunk/libc/debug/fwprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/fwprintf_chk.c (original)
+++ fsf/trunk/libc/debug/fwprintf_chk.c Fri Jul 20 00:02:41 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005
+/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -29,7 +29,7 @@
   va_list ap;
   int done;
 
-  _IO_acquire_lock (fp);
+  _IO_acquire_lock_clear_flags2 (fp);
   if (flag > 0)
     fp->_flags2 |= _IO_FLAGS2_FORTIFY;
 

Modified: fsf/trunk/libc/debug/printf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/printf_chk.c (original)
+++ fsf/trunk/libc/debug/printf_chk.c Fri Jul 20 00:02:41 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2006
+/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -29,7 +29,7 @@
   va_list ap;
   int done;
 
-  _IO_acquire_lock (stdout);
+  _IO_acquire_lock_clear_flags2 (stdout);
   if (flag > 0)
     stdout->_flags2 |= _IO_FLAGS2_FORTIFY;
 

Modified: fsf/trunk/libc/debug/vfprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/vfprintf_chk.c (original)
+++ fsf/trunk/libc/debug/vfprintf_chk.c Fri Jul 20 00:02:41 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005, 2006
+/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -28,7 +28,7 @@
 {
   int done;
 
-  _IO_acquire_lock (fp);
+  _IO_acquire_lock_clear_flags2 (fp);
   if (flag > 0)
     fp->_flags2 |= _IO_FLAGS2_FORTIFY;
 

Modified: fsf/trunk/libc/debug/vfwprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/vfwprintf_chk.c (original)
+++ fsf/trunk/libc/debug/vfwprintf_chk.c Fri Jul 20 00:02:41 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005, 2006
+/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -28,7 +28,7 @@
 {
   int done;
 
-  _IO_acquire_lock (fp);
+  _IO_acquire_lock_clear_flags2 (fp);
   if (flag > 0)
     fp->_flags2 |= _IO_FLAGS2_FORTIFY;
 

Modified: fsf/trunk/libc/debug/vprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/vprintf_chk.c (original)
+++ fsf/trunk/libc/debug/vprintf_chk.c Fri Jul 20 00:02:41 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2006
+/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -28,7 +28,7 @@
 {
   int done;
 
-  _IO_acquire_lock (stdout);
+  _IO_acquire_lock_clear_flags2 (stdout);
   if (flag > 0)
     stdout->_flags2 |= _IO_FLAGS2_FORTIFY;
 

Modified: fsf/trunk/libc/debug/vwprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/vwprintf_chk.c (original)
+++ fsf/trunk/libc/debug/vwprintf_chk.c Fri Jul 20 00:02:41 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005
+/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -29,7 +29,7 @@
 {
   int done;
 
-  _IO_acquire_lock (stdout);
+  _IO_acquire_lock_clear_flags2 (stdout);
   if (flag > 0)
     stdout->_flags2 |= _IO_FLAGS2_FORTIFY;
 

Modified: fsf/trunk/libc/debug/wprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/wprintf_chk.c (original)
+++ fsf/trunk/libc/debug/wprintf_chk.c Fri Jul 20 00:02:41 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005
+/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -30,7 +30,7 @@
   va_list ap;
   int done;
 
-  _IO_acquire_lock (stdout);
+  _IO_acquire_lock_clear_flags2 (stdout);
   if (flag > 0)
     stdout->_flags2 |= _IO_FLAGS2_FORTIFY;
 

Modified: fsf/trunk/libc/hurd/hurd/signal.h
==============================================================================
--- fsf/trunk/libc/hurd/hurd/signal.h (original)
+++ fsf/trunk/libc/hurd/hurd/signal.h Fri Jul 20 00:02:41 2007
@@ -26,6 +26,7 @@
 #error "Must have `_GNU_SOURCE' feature test macro to use this file"
 #endif
 
+#define __need_size_t
 #define __need_NULL
 #include <stddef.h>
 

Modified: fsf/trunk/libc/include/features.h
==============================================================================
--- fsf/trunk/libc/include/features.h (original)
+++ fsf/trunk/libc/include/features.h Fri Jul 20 00:02:41 2007
@@ -56,6 +56,7 @@
    header files to decide what to declare or define:
 
    __USE_ISOC99		Define ISO C99 things.
+   __USE_ISOC95		Define ISO C90 AMD1 (C95) things.
    __USE_POSIX		Define IEEE Std 1003.1 things.
    __USE_POSIX2		Define IEEE Std 1003.2 things.
    __USE_POSIX199309	Define IEEE Std 1003.1, and .1b things.
@@ -90,6 +91,7 @@
 
 /* Undefine everything, so we get a clean slate.  */
 #undef	__USE_ISOC99
+#undef	__USE_ISOC95
 #undef	__USE_POSIX
 #undef	__USE_POSIX2
 #undef	__USE_POSIX199309
@@ -184,6 +186,12 @@
 # define __USE_ISOC99	1
 #endif
 
+/* This is to enable the ISO C90 Amendment 1:1995 extension.  */
+#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+     || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L))
+# define __USE_ISOC95	1
+#endif
+
 /* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
    (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined).  */
 #if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \

Modified: fsf/trunk/libc/libio/iopopen.c
==============================================================================
--- fsf/trunk/libc/libio/iopopen.c (original)
+++ fsf/trunk/libc/libio/iopopen.c Fri Jul 20 00:02:41 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993, 1997-2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2002, 2003, 2004, 2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Per Bothner <bothner@xxxxxxxxxx>.
 
@@ -169,7 +170,15 @@
          popen() calls that remain open in the parent process are closed
 	 in the new child process." */
       for (p = proc_file_chain; p; p = p->next)
-	_IO_close (_IO_fileno ((_IO_FILE *) p));
+	{
+	  int fd = _IO_fileno ((_IO_FILE *) p);
+
+	  /* If any stream from previous popen() calls has fileno
+	     child_std_end, it has been already closed by the dup2 syscall
+	     above.  */
+	  if (fd != child_std_end)
+	    _IO_close (fd);
+	}
 
       _IO_execl ("/bin/sh", "sh", "-c", command, (char *) 0);
       _IO__exit (127);

Modified: fsf/trunk/libc/libio/libioP.h
==============================================================================
--- fsf/trunk/libc/libio/libioP.h (original)
+++ fsf/trunk/libc/libio/libioP.h Fri Jul 20 00:02:41 2007
@@ -968,3 +968,13 @@
   if ((fp->_flags & _IO_USER_LOCK) == 0)
     _IO_funlockfile (fp);
 }
+
+static inline void
+__attribute__ ((__always_inline__))
+_IO_acquire_lock_clear_flags2_fct (_IO_FILE **p)
+{
+  _IO_FILE *fp = *p;
+  fp->_flags &= ~_IO_FLAGS2_FORTIFY;
+  if ((fp->_flags & _IO_USER_LOCK) == 0)
+    _IO_funlockfile (fp);
+}

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Fri Jul 20 00:02:41 2007
@@ -1,3 +1,9 @@
+2007-07-16  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* locales/ar_SA (d_t_fmt, d_fmt, t_fmt, t_fmt_ampm): Replace %.1d
+	with supported %e and %.1H with %k.
+	* locales/dz_BT (t_fmt): Remove whitespace between % and H.
+
 2007-07-10  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #4773]

Modified: fsf/trunk/libc/localedata/locales/ar_SA
==============================================================================
--- fsf/trunk/libc/localedata/locales/ar_SA (original)
+++ fsf/trunk/libc/localedata/locales/ar_SA Fri Jul 20 00:02:41 2007
@@ -294,16 +294,16 @@
 
 
 % Set up the LC_TIME category
-% d_t_fmt	"%A %.1d %B %Y  %.1H:%M:%S"
-% d_fmt	"%A %.1d %B %Y"
-% t_fmt	"%.1H:%M:%S"
-% t_fmt_ampm	"%.1H:%M:%S"
+% d_t_fmt	"%A %e %B %Y  %k:%M:%S"
+% d_fmt	"%A %e %B %Y"
+% t_fmt	"%k:%M:%S"
+% t_fmt_ampm	"%k:%M:%S"
 
 LC_TIME
-d_t_fmt	"<U0025><U0041><U0020><U0025><U002E><U0031><U0064><U0020><U0025><U0042><U0020><U0025><U0059><U0020><U0020><U0025><U002E><U0031><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-d_fmt	"<U0025><U0041><U0020><U0025><U002E><U0031><U0064><U0020><U0025><U0042><U0020><U0025><U0059>"
-t_fmt	"<U0025><U002E><U0031><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-t_fmt_ampm	"<U0025><U002E><U0031><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
+d_t_fmt	"<U0025><U0041><U0020><U0025><U0065><U0020><U0025><U0042><U0020><U0025><U0059><U0020><U0020><U0025><U006B><U003A><U0025><U004D><U003A><U0025><U0053>"
+d_fmt	"<U0025><U0041><U0020><U0025><U0065><U0020><U0025><U0042><U0020><U0025><U0059>"
+t_fmt	"<U0025><U006B><U003A><U0025><U004D><U003A><U0025><U0053>"
+t_fmt_ampm	"<U0025><U006B><U003A><U0025><U004D><U003A><U0025><U0053>"
 day	"<U0627><U0644><U0623><U062D><U062F>"; /
 	"<U0627><U0644><U0625><U062B><U0646><U064A><U0646>"; /
 	"<U0627><U0644><U062B><U0644><U0627><U062B><U0627><U0621>"; /

Modified: fsf/trunk/libc/localedata/locales/dz_BT
==============================================================================
--- fsf/trunk/libc/localedata/locales/dz_BT (original)
+++ fsf/trunk/libc/localedata/locales/dz_BT Fri Jul 20 00:02:41 2007
@@ -1293,7 +1293,7 @@
 
 % Appropriate time representation  "%H:%M:%S"
 t_fmt        "<U0F46><U0F74><U0F0B><U0F5A><U0F7C><U0F51>/
-%   H<U0F40><U0F66><U0F62><U0F0B><U0F58>/
+%H<U0F40><U0F66><U0F62><U0F0B><U0F58>/
 %M<U0F40><U0F66><U0F62><U0F0B><U0F46>%S"
 
 % AM/PM signs

Modified: fsf/trunk/libc/malloc/malloc.h
==============================================================================
--- fsf/trunk/libc/malloc/malloc.h (original)
+++ fsf/trunk/libc/malloc/malloc.h Fri Jul 20 00:02:41 2007
@@ -1,5 +1,6 @@
 /* Prototypes and definition for malloc implementation.
-   Copyright (C) 1996,97,99,2000,2002-2004,2005 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999, 2000, 2002-2004, 2005, 2007
+   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
@@ -54,8 +55,11 @@
 
 /* Re-allocate the previously allocated block in __ptr, making the new
    block SIZE bytes long.  */
+/* __attribute_malloc__ is not used, because if realloc returns
+   the same pointer that was passed to it, aliasing needs to be allowed
+   between objects pointed by the old and new pointers.  */
 extern void *realloc __MALLOC_P ((void *__ptr, size_t __size))
-       __attribute_malloc__ __attribute_warn_unused_result__;
+       __attribute_warn_unused_result__;
 
 /* Free a block allocated by `malloc', `realloc' or `calloc'.  */
 extern void free __MALLOC_P ((void *__ptr));

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Fri Jul 20 00:02:41 2007
@@ -1,3 +1,8 @@
+2007-07-17  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
+	Define.
+
 2007-07-06  Kaz Kojima  <kkojima@xxxxxxxxxxxxxx>
 
 	* sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and

Modified: fsf/trunk/libc/nptl/sysdeps/pthread/bits/stdio-lock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/pthread/bits/stdio-lock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/pthread/bits/stdio-lock.h Fri Jul 20 00:02:41 2007
@@ -1,5 +1,5 @@
 /* Thread package specific definitions of stream lock type.  NPTL version.
-   Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003, 2007 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
@@ -94,9 +94,15 @@
 	__attribute__((cleanup (_IO_acquire_lock_fct)))			      \
 	= (_fp);							      \
     _IO_flockfile (_IO_acquire_lock_file);
-
+#  define _IO_acquire_lock_clear_flags2(_fp) \
+  do {									      \
+    _IO_FILE *_IO_acquire_lock_file					      \
+	__attribute__((cleanup (_IO_acquire_lock_clear_flags2_fct)))	      \
+	= (_fp);							      \
+    _IO_flockfile (_IO_acquire_lock_file);
 # else
 #  define _IO_acquire_lock(_fp) _IO_acquire_lock_needs_exceptions_enabled
+#  define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
 # endif
 # define _IO_release_lock(_fp) ; } while (0)
 

Modified: fsf/trunk/libc/posix/getconf.c
==============================================================================
--- fsf/trunk/libc/posix/getconf.c (original)
+++ fsf/trunk/libc/posix/getconf.c Fri Jul 20 00:02:41 2007
@@ -610,6 +610,7 @@
 
 #ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
     { "_POSIX_V6_WIDTH_RESTRICTED_ENVS", _CS_V6_WIDTH_RESTRICTED_ENVS, CONFSTR },
+    { "POSIX_V6_WIDTH_RESTRICTED_ENVS", _CS_V6_WIDTH_RESTRICTED_ENVS, CONFSTR },
 #endif
 
 #ifdef _SC_V6_ILP32_OFFBIG

Modified: fsf/trunk/libc/posix/sched.h
==============================================================================
--- fsf/trunk/libc/posix/sched.h (original)
+++ fsf/trunk/libc/posix/sched.h Fri Jul 20 00:02:41 2007
@@ -24,6 +24,9 @@
 
 /* Get type definitions.  */
 #include <bits/types.h>
+
+#define __need_size_t
+#include <stddef.h>
 
 #define __need_timespec
 #include <time.h>

Modified: fsf/trunk/libc/signal/signal.h
==============================================================================
--- fsf/trunk/libc/signal/signal.h (original)
+++ fsf/trunk/libc/signal/signal.h Fri Jul 20 00:02:41 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2003, 2004, 2007 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
@@ -339,6 +339,8 @@
 
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# define __need_size_t
+# include <stddef.h>
 
 /* If INTERRUPT is nonzero, make signal SIG interrupt system calls
    (causing them to fail with EINTR); if INTERRUPT is zero, make system

Modified: fsf/trunk/libc/stdio-common/Makefile
==============================================================================
--- fsf/trunk/libc/stdio-common/Makefile (original)
+++ fsf/trunk/libc/stdio-common/Makefile Fri Jul 20 00:02:41 2007
@@ -55,7 +55,7 @@
 	 tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 bug15 \
 	 tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
 	 tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
-	 bug19 bug19a
+	 bug19 bug19a tst-popen2
 
 test-srcs = tst-unbputc tst-printf
 

Added: fsf/trunk/libc/stdio-common/tst-popen2.c
==============================================================================
--- fsf/trunk/libc/stdio-common/tst-popen2.c (added)
+++ fsf/trunk/libc/stdio-common/tst-popen2.c Fri Jul 20 00:02:41 2007
@@ -1,0 +1,92 @@
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+static int
+do_test (void)
+{
+  int fd = dup (fileno (stdout));
+  if (fd <= 1)
+    {
+      puts ("dup failed");
+      return 1;
+    }
+
+  FILE *f1 = fdopen (fd, "w");
+  if (f1 == NULL)
+    {
+      printf ("fdopen failed: %m\n");
+      return 1;
+    }
+
+  fclose (stdout);
+
+  FILE *f2 = popen ("echo test1", "r");
+  if (f2 == NULL)
+    {
+      fprintf (f1, "1st popen failed: %m\n");
+      return 1;
+    }
+  FILE *f3 = popen ("echo test2", "r");
+  if (f2 == NULL || f3 == NULL)
+    {
+      fprintf (f1, "2nd popen failed: %m\n");
+      return 1;
+    }
+
+  char *line = NULL;
+  size_t len = 0;
+  int result = 0;
+  if (getline (&line, &len, f2) != 6)
+    {
+      fputs ("could not read line from 1st popen\n", f1);
+      result = 1;
+    }
+  else if (strcmp (line, "test1\n") != 0)
+    {
+      fprintf (f1, "read \"%s\"\n", line);
+      result = 1;
+    }
+
+  if (getline (&line, &len, f2) != -1)
+    {
+      fputs ("second getline did not return -1\n", f1);
+      result = 1;
+    }
+
+  if (getline (&line, &len, f3) != 6)
+    {
+      fputs ("could not read line from 2nd popen\n", f1);
+      result = 1;
+    }
+  else if (strcmp (line, "test2\n") != 0)
+    {
+      fprintf (f1, "read \"%s\"\n", line);
+      result = 1;
+    }
+
+  if (getline (&line, &len, f3) != -1)
+    {
+      fputs ("second getline did not return -1\n", f1);
+      result = 1;
+    }
+
+  int ret = pclose (f2);
+  if (ret != 0)
+    {
+      fprintf (f1, "1st pclose returned %d\n", ret);
+      result = 1;
+    }
+
+  ret = pclose (f3);
+  if (ret != 0)
+    {
+      fprintf (f1, "2nd pclose returned %d\n", ret);
+      result = 1;
+    }
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/stdlib/stdlib.h
==============================================================================
--- fsf/trunk/libc/stdlib/stdlib.h (original)
+++ fsf/trunk/libc/stdlib/stdlib.h Fri Jul 20 00:02:41 2007
@@ -597,8 +597,11 @@
 __BEGIN_NAMESPACE_STD
 /* Re-allocate the previously allocated block
    in PTR, making the new block SIZE bytes long.  */
+/* __attribute_malloc__ is not used, because if realloc returns
+   the same pointer that was passed to it, aliasing needs to be allowed
+   between objects pointed by the old and new pointers.  */
 extern void *realloc (void *__ptr, size_t __size)
-     __THROW __attribute_malloc__ __attribute_warn_unused_result__;
+     __THROW __attribute_warn_unused_result__;
 /* Free a block allocated by `malloc', `realloc' or `calloc'.  */
 extern void free (void *__ptr) __THROW;
 __END_NAMESPACE_STD

Added: fsf/trunk/libc/sysdeps/ia64/sched_cpucount.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ia64/sched_cpucount.c (added)
+++ fsf/trunk/libc/sysdeps/ia64/sched_cpucount.c Fri Jul 20 00:02:41 2007
@@ -1,0 +1,21 @@
+/* Copyright (C) 2007 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.  */
+
+#define POPCNT(l) __builtin_popcountl (l)
+
+#include <posix/sched_cpucount.c>

Added: fsf/trunk/libc/sysdeps/powerpc/sched_cpucount.c
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/sched_cpucount.c (added)
+++ fsf/trunk/libc/sysdeps/powerpc/sched_cpucount.c Fri Jul 20 00:02:41 2007
@@ -1,0 +1,23 @@
+/* Copyright (C) 2007 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.  */
+
+#ifdef _ARCH_PWR5
+# define POPCNT(l) __builtin_popcountl (l)
+#endif
+
+#include <posix/sched_cpucount.c>

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h Fri Jul 20 00:02:41 2007
@@ -131,8 +131,14 @@
   ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
 # define __CPU_ISSET(cpu, cpusetp) \
   (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
+
+__BEGIN_DECLS
+
 extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
   __THROW;
+
+__END_DECLS
+
 # define __CPU_COUNT(cpusetp) \
   __sched_cpucount (sizeof (cpu_set_t), cpusetp)
 #endif

Modified: fsf/trunk/libc/sysvipc/sys/msg.h
==============================================================================
--- fsf/trunk/libc/sysvipc/sys/msg.h (original)
+++ fsf/trunk/libc/sysvipc/sys/msg.h Fri Jul 20 00:02:41 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-1997,1999,2000,2003,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997,1999,2000,2003,2006,2007
+   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 +21,9 @@
 #define _SYS_MSG_H
 
 #include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
 
 /* Get common definition of System V style IPC.  */
 #include <sys/ipc.h>

Modified: fsf/trunk/libc/wcsmbs/wchar.h
==============================================================================
--- fsf/trunk/libc/wcsmbs/wchar.h (original)
+++ fsf/trunk/libc/wcsmbs/wchar.h Fri Jul 20 00:02:41 2007
@@ -607,7 +607,7 @@
 extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW;
 #endif
 
-#if defined __USE_ISOC99 || defined __USE_UNIX98
+#if defined __USE_ISOC95 || defined __USE_UNIX98
 __BEGIN_NAMESPACE_C99
 
 /* Select orientation for stream.  */
@@ -674,7 +674,7 @@
      __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
 
 __END_NAMESPACE_C99
-#endif /* Use ISO C99 and Unix98. */
+#endif /* Use ISO C95, C99 and Unix98. */
 
 #ifdef __USE_ISOC99
 __BEGIN_NAMESPACE_C99