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

[commits] r3230 - in /fsf/trunk/libc: ./ debug/ elf/ iconv/ iconvdata/ localedata/ localedata/locales/ nptl/ nptl/sysdeps/unix/sysv/li...



Author: eglibc
Date: Wed Aug 22 00:03:47 2007
New Revision: 3230

Log:
Import glibc-mainline for 2007-08-22

Added:
    fsf/trunk/libc/iconvdata/bug-iconv5.c
    fsf/trunk/libc/localedata/locales/wo_SN
    fsf/trunk/libc/nptl/tst-tsd6.c
    fsf/trunk/libc/nscd/res_hconf.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/debug/pcprofiledump.c
    fsf/trunk/libc/debug/segfault.c
    fsf/trunk/libc/elf/do-lookup.h
    fsf/trunk/libc/elf/elf.h
    fsf/trunk/libc/iconv/gconv.c
    fsf/trunk/libc/iconvdata/Makefile
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/SUPPORTED
    fsf/trunk/libc/localedata/locales/as_IN
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/Makefile
    fsf/trunk/libc/nptl/allocatestack.c
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
    fsf/trunk/libc/nscd/Makefile
    fsf/trunk/libc/nscd/connections.c
    fsf/trunk/libc/nscd/gethstbyad_r.c
    fsf/trunk/libc/nscd/gethstbynm2_r.c
    fsf/trunk/libc/nscd/hstcache.c
    fsf/trunk/libc/resolv/res_hconf.c
    fsf/trunk/libc/resolv/res_send.c
    fsf/trunk/libc/stdio-common/tempnam.c
    fsf/trunk/libc/string/strtok.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Aug 22 00:03:47 2007
@@ -1,3 +1,71 @@
+2007-08-21  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #4566]
+	* string/strtok.c: Fix typo in comment.
+
+	[BZ #4582]
+	* debug/segfault.c: Fix typos in comments.
+
+	[BZ #4588]
+	* stdio-common/tempnam.c: Fix comment, it is not checked that
+	TMPDIR points to a writable directory.
+
+	[BZ #4726]
+	* resolv/res_send.c (__libc_res_nsend): Initialize all of the
+	memory allocated for the name server address.
+
+	[BZ #4946]
+	* nscd/connections.c (handle_request): Using sendfile always
+	requires that mmap is used for the database.
+	Patch by Petr Baudis <pasky@xxxxxxx>.
+
+	[BZ #4905]
+	* nscd/hstcache.c (cache_addhst): When reloading an entry which
+	suddenly has two or more addresses, ignore it and remove the old
+	entry.
+
+	[BZ #4814]
+	* resolv/res_hconf.c: Prepare for compiling outside libc.
+	* nscd/res_hconf.c: New file.
+	* nscd/Makefile (nscd-modules): Add res_hconf.  Add rules to build
+	the new file.
+	* nscd/gethstbynm2_r.c (NEED__RES_HCONF): Define.
+	* nscd/gethstbyad_r.c (NEED__RES_HCONF): Likewise.
+
+	* nscd/hstcache.c (cache_addhst): Minimal optimization.
+
+	[BZ #4925]
+	* debug/pcprofiledump.c: Turn on internationalization by calling
+	setlocale.  Patch mostly by Benno Schulenberg.
+
+	[BZ #4936]
+	* iconv/gconv.c (__gconv): If flush was successful, clear rest of
+	the state.
+	* iconvdata/Makefile: Add rules to build and run bug-iconv5.
+	* iconvdata/bug-iconv5.c: New file.
+
+2007-08-04  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
+
+	[BZ #4896]
+	* elf/elf.h: Define R_PARISC_PLABEL21L, R_PARISC_PLABEL14R,
+	R_PARISC_GNU_VTENTRY, R_PARISC_GNU_VTINHERIT, R_PARISC_TLS_GD21L,
+	R_PARISC_TLS_GD14R, R_PARISC_TLS_GDCALL, R_PARISC_TLS_LDM21L,
+	R_PARISC_TLS_LDM14R, R_PARISC_TLS_LDMCALL, R_PARISC_TLS_LDO21L,
+	R_PARISC_TLS_LDO14R, R_PARISC_TLS_DTPMOD32, R_PARISC_TLS_DTPMOD64,
+	R_PARISC_TLS_DTPOFF32, R_PARISC_TLS_DTPOFF64, R_PARISC_TLS_LE21L,
+	R_PARISC_TLS_LE14R, R_PARISC_TLS_IE21L, R_PARISC_TLS_IE14R,
+	R_PARISC_TLS_TPREL32, R_PARISC_TLS_TPREL64.
+
+2007-08-21  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #4937]
+	* elf/do-lookup.h (do_lookup_x): Minimal improvement in hash
+	lookup loop.  Suggested by John Reiser.
+
+2007-08-21  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/alpha/sysdep.h: Include tls.h.
+
 2007-08-20  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* csu/libc-start.c: Don't handle VDSO_SETUP here.

Modified: fsf/trunk/libc/debug/pcprofiledump.c
==============================================================================
--- fsf/trunk/libc/debug/pcprofiledump.c (original)
+++ fsf/trunk/libc/debug/pcprofiledump.c Wed Aug 22 00:03:47 2007
@@ -1,5 +1,5 @@
 /* Dump information generated by PC profiling.
-   Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1999.
 
@@ -37,6 +37,7 @@
 
 #include "../version.h"
 
+#define PACKAGE _libc_intl_domainname
 
 #ifndef _
 # define _(Str) gettext (Str)
@@ -75,14 +76,17 @@
 int
 main (int argc, char *argv[])
 {
+  /* Set locale via LC_ALL.  */
+  setlocale (LC_ALL, "");
+
+  /* Set the text message domain.  */
+  textdomain (PACKAGE);
+
+  /* Parse and process arguments.  */
+  int remaining;
+  argp_parse (&argp, argc, argv, 0, &remaining, NULL);
+
   int fd;
-  int remaining;
-  int must_swap;
-  uint32_t word;
-
-  /* Parse and process arguments.  */
-  argp_parse (&argp, argc, argv, 0, &remaining, NULL);
-
   if (remaining == argc)
     fd = STDIN_FILENO;
   else if (remaining + 1 != argc)
@@ -102,11 +106,12 @@
 
   /* Read the first 4-byte word.  It contains the information about
      the word size and the endianess.  */
+  uint32_t word;
   if (TEMP_FAILURE_RETRY (read (fd, &word, 4)) != 4)
     error (EXIT_FAILURE, errno, _("cannot read header"));
 
   /* Check whether we have to swap the byte order.  */
-  must_swap = (word & 0xfffffff0) == bswap_32 (0xdeb00000);
+  int must_swap = (word & 0xfffffff0) == bswap_32 (0xdeb00000);
   if (must_swap)
     word = bswap_32 (word);
 

Modified: fsf/trunk/libc/debug/segfault.c
==============================================================================
--- fsf/trunk/libc/debug/segfault.c (original)
+++ fsf/trunk/libc/debug/segfault.c Wed Aug 22 00:03:47 2007
@@ -1,5 +1,5 @@
 /* Catch segmentation faults and print backtrace.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -42,7 +42,7 @@
 /* Get code to possibly dump the content of all registers.  */
 #include <register-dump.h>
 
-/* We'll use tis a lot.  */
+/* We'll use this a lot.  */
 #define WRITE_STRING(s) write (fd, s, strlen (s))
 
 /* Name of the output file.  */
@@ -67,7 +67,7 @@
 
 
 /* This function is called when a segmentation fault is caught.  The system
-   is in an instable state now.  This means especially that malloc() might
+   is in an unstable state now.  This means especially that malloc() might
    not work anymore.  */
 static void
 catch_segfault (int signal, SIGCONTEXT ctx)

Modified: fsf/trunk/libc/elf/do-lookup.h
==============================================================================
--- fsf/trunk/libc/elf/do-lookup.h (original)
+++ fsf/trunk/libc/elf/do-lookup.h Wed Aug 22 00:03:47 2007
@@ -190,7 +190,7 @@
 		  const Elf32_Word *hasharr = &map->l_gnu_chain_zero[bucket];
 
 		  do
-		    if ((*hasharr & ~1u) == (new_hash & ~1u))
+		    if (((*hasharr ^ new_hash) >> 1) == 0)
 		      {
 			symidx = hasharr - map->l_gnu_chain_zero;
 			sym = check_match (&symtab[symidx]);

Modified: fsf/trunk/libc/elf/elf.h
==============================================================================
--- fsf/trunk/libc/elf/elf.h (original)
+++ fsf/trunk/libc/elf/elf.h Wed Aug 22 00:03:47 2007
@@ -1723,6 +1723,8 @@
 #define R_PARISC_LTOFF_FPTR14R	62	/* LT-rel. fct ptr, right 14 bits. */
 #define R_PARISC_FPTR64		64	/* 64 bits function address.  */
 #define R_PARISC_PLABEL32	65	/* 32 bits function address.  */
+#define R_PARISC_PLABEL21L	66	/* Left 21 bits of fdesc address.  */
+#define R_PARISC_PLABEL14R	70	/* Right 14 bits of fdesc address.  */
 #define R_PARISC_PCREL64	72	/* 64 bits PC-rel. address.  */
 #define R_PARISC_PCREL22F	74	/* 22 bits PC-rel. address.  */
 #define R_PARISC_PCREL14WR	75	/* PC-rel. address, right 14 bits.  */
@@ -1783,6 +1785,26 @@
 #define R_PARISC_LTOFF_TP16F	229	/* 16 bits LT-TP-rel. address.  */
 #define R_PARISC_LTOFF_TP16WF	230	/* 16 bits LT-TP-rel. address.  */
 #define R_PARISC_LTOFF_TP16DF	231	/* 16 bits LT-TP-rel. address.  */
+#define R_PARISC_GNU_VTENTRY	232
+#define R_PARISC_GNU_VTINHERIT	233
+#define R_PARISC_TLS_GD21L	234	/* GD 21-bit left.  */
+#define R_PARISC_TLS_GD14R	235	/* GD 14-bit right.  */
+#define R_PARISC_TLS_GDCALL	236	/* GD call to __t_g_a.  */
+#define R_PARISC_TLS_LDM21L	237	/* LD module 21-bit left.  */
+#define R_PARISC_TLS_LDM14R	238	/* LD module 14-bit right.  */
+#define R_PARISC_TLS_LDMCALL	239	/* LD module call to __t_g_a.  */
+#define R_PARISC_TLS_LDO21L	240	/* LD offset 21-bit left.  */
+#define R_PARISC_TLS_LDO14R	241	/* LD offset 14-bit right.  */
+#define R_PARISC_TLS_DTPMOD32	242	/* DTP module 32-bit.  */
+#define R_PARISC_TLS_DTPMOD64	243	/* DTP module 64-bit.  */
+#define R_PARISC_TLS_DTPOFF32	244	/* DTP offset 32-bit.  */
+#define R_PARISC_TLS_DTPOFF64	245	/* DTP offset 32-bit.  */
+#define R_PARISC_TLS_LE21L	R_PARISC_TPREL21L
+#define R_PARISC_TLS_LE14R	R_PARISC_TPREL14R
+#define R_PARISC_TLS_IE21L	R_PARISC_LTOFF_TP21L
+#define R_PARISC_TLS_IE14R	R_PARISC_LTOFF_TP14R
+#define R_PARISC_TLS_TPREL32	R_PARISC_TPREL32
+#define R_PARISC_TLS_TPREL64	R_PARISC_TPREL64
 #define R_PARISC_HIRESERVE	255
 
 /* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr.  */

Modified: fsf/trunk/libc/iconv/gconv.c
==============================================================================
--- fsf/trunk/libc/iconv/gconv.c (original)
+++ fsf/trunk/libc/iconv/gconv.c Wed Aug 22 00:03:47 2007
@@ -1,6 +1,6 @@
 /* Convert characters in input buffer using conversion descriptor to
    output buffer.
-   Copyright (C) 1997-2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997-2001, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -55,11 +55,19 @@
 #endif
 
   if (inbuf == NULL || *inbuf == NULL)
-    /* We just flush.  */
-    result = DL_CALL_FCT (fct,
-			  (cd->__steps, cd->__data, NULL, NULL, NULL,
-			   irreversible,
-			   cd->__data[last_step].__outbuf == NULL ? 2 : 1, 0));
+    {
+      /* We just flush.  */
+      result = DL_CALL_FCT (fct,
+			    (cd->__steps, cd->__data, NULL, NULL, NULL,
+			     irreversible,
+			     cd->__data[last_step].__outbuf == NULL ? 2 : 1,
+			     0));
+
+      /* If the flush was successful clear the rest of the state.  */
+      if (result == __GCONV_OK)
+	for (size_t cnt = 0; cnt <= last_step; ++cnt)
+	  cd->__data[cnt].__invocation_counter = 0;
+    }
   else
     {
       const unsigned char *last_start;

Modified: fsf/trunk/libc/iconvdata/Makefile
==============================================================================
--- fsf/trunk/libc/iconvdata/Makefile (original)
+++ fsf/trunk/libc/iconvdata/Makefile Wed Aug 22 00:03:47 2007
@@ -66,7 +66,7 @@
 
 ifeq (yes,$(build-shared))
 tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
-	tst-iconv6
+	tst-iconv6 bug-iconv5
 ifeq ($(have-thread-library),yes)
 tests += bug-iconv3
 endif
@@ -354,6 +354,8 @@
 $(objpfx)bug-iconv3: $(libdl)
 $(objpfx)bug-iconv3.out: $(objpfx)gconv-modules \
 			 $(addprefix $(objpfx),$(modules.so))
+$(objpfx)bug-iconv5.out: $(objpfx)gconv-modules \
+			 $(addprefix $(objpfx),$(modules.so))
 $(objpfx)tst-loading.out: $(objpfx)gconv-modules \
 			  $(addprefix $(objpfx),$(modules.so))
 $(objpfx)tst-iconv4.out: $(objpfx)gconv-modules \

Added: fsf/trunk/libc/iconvdata/bug-iconv5.c
==============================================================================
--- fsf/trunk/libc/iconvdata/bug-iconv5.c (added)
+++ fsf/trunk/libc/iconvdata/bug-iconv5.c Wed Aug 22 00:03:47 2007
@@ -1,0 +1,53 @@
+#include <iconv.h>
+#include <stdint.h>
+#include <stdio.h>
+
+
+static int
+do_test (void)
+{
+  iconv_t cd = iconv_open ("utf-8", "unicode");
+  if (cd == (iconv_t) -1)
+    {
+      puts ("cannot open iconv module");
+      return 1;
+    }
+
+  static const uint16_t us[] = { 0xfeff, 0x0041, 0x0042, 0x0043 };
+  char buf[100];
+
+  char *inbuf;
+  size_t inlen;
+  char *outbuf;
+  size_t outlen;
+  size_t n;
+
+  inbuf = (char *) us;
+  inlen = sizeof (us);
+  outbuf = buf;
+  outlen = sizeof (buf);
+  n = iconv (cd, &inbuf, &inlen, &outbuf, &outlen);
+  if (n == (size_t) -1 || inlen != 0 || outlen != sizeof (buf) - 3)
+    {
+      puts ("first conversion failed");
+      return 1;
+    }
+
+  iconv (cd, NULL, NULL, NULL, NULL);
+
+  inbuf = (char *) us;
+  inlen = sizeof (us);
+  outbuf = buf;
+  outlen = sizeof (buf);
+  n = iconv (cd, &inbuf, &inlen, &outbuf, &outlen);
+  if (n == (size_t) -1 || inlen != 0 || outlen != sizeof (buf) - 3)
+    {
+      puts ("second conversion failed");
+      return 1;
+    }
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Wed Aug 22 00:03:47 2007
@@ -1,3 +1,12 @@
+2007-08-22  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #4554]
+	* locales/wo_SN: New file.
+	* SUPPORTED: Add wo_SN entry.
+
+	[BZ #4557]
+	* locales/as_IN: Change <UNASSIGNED-09CE> to <U09CE>.
+
 2007-08-03  Jakub Jelinek  <jakub@xxxxxxxxxx>
 
 	* locales/translit_combining: Add U0141 and U0142.

Modified: fsf/trunk/libc/localedata/SUPPORTED
==============================================================================
--- fsf/trunk/libc/localedata/SUPPORTED (original)
+++ fsf/trunk/libc/localedata/SUPPORTED Wed Aug 22 00:03:47 2007
@@ -362,6 +362,7 @@
 wa_BE/ISO-8859-1 \
 wa_BE@euro/ISO-8859-15 \
 wa_BE.UTF-8/UTF-8 \
+wo_SN/UTF-8 \
 xh_ZA.UTF-8/UTF-8 \
 xh_ZA/ISO-8859-1 \
 yi_US.UTF-8/UTF-8 \

Modified: fsf/trunk/libc/localedata/locales/as_IN
==============================================================================
--- fsf/trunk/libc/localedata/locales/as_IN (original)
+++ fsf/trunk/libc/localedata/locales/as_IN Wed Aug 22 00:03:47 2007
@@ -596,7 +596,7 @@
 <U09CC> <X689A>;<X0005>;<X0005>;IGNORE
 <U09CD> <X689C>;<X0005>;<X0005>;IGNORE
 <U09D7> <X689E>;<X0005>;<X0005>;IGNORE
-<UNASSIGNED-09CE> "<XE2E9><X6B20>";<X0005>;"<X0005><X00C0>";IGNORE
+<U09CE> "<XE2E9><X6B20>";<X0005>;"<X0005><X00C0>";IGNORE
 UNDEFINED IGNORE;IGNORE;IGNORE;%...
 
 order_end

Added: fsf/trunk/libc/localedata/locales/wo_SN
==============================================================================
--- fsf/trunk/libc/localedata/locales/wo_SN (added)
+++ fsf/trunk/libc/localedata/locales/wo_SN Wed Aug 22 00:03:47 2007
@@ -1,0 +1,180 @@
+comment_char %
+escape_char  /
+%
+% Wolof locale for Senegal
+% Source: The Debian Project
+% Contact: Christian Perrier/Samba Ndao Diop
+% Email: bubulle@xxxxxxxxxx/samba.ndao.diop@xxxxxxxxxx
+% Tel: +33 - 130699222
+% Language: wo
+% Territory: SN
+% Revision: 1.0
+% Date: 2004-09-15
+% Users: general
+% Charset: UTF-8
+% Distribution and use is free, also
+% for commercial purposes.
+
+LC_IDENTIFICATION
+title      "Wolof locale for Senegal"
+source     "The Debian Project"
+address    ""
+contact    "Christian Perrier"
+email      "bubulle@xxxxxxxxxx"
+tel        ""
+fax        ""
+language   "Wolof"
+territory  "Senegal"
+revision   "1.0"
+date       "2004-09-08"
+%
+category  "mg_MG:2000";LC_IDENTIFICATION
+category  "mg_MG:2000";LC_CTYPE
+category  "mg_MG:2000";LC_COLLATE
+category  "mg_MG:2000";LC_TIME
+category  "mg_MG:2000";LC_NUMERIC
+category  "mg_MG:2000";LC_MONETARY
+category  "mg_MG:2000";LC_MESSAGES
+category  "mg_MG:2000";LC_PAPER
+category  "mg_MG:2000";LC_NAME
+category  "mg_MG:2000";LC_ADDRESS
+category  "mg_MG:2000";LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "i18n"
+
+translit_start
+
+% Accents are simply omitted if they cannot be represented.
+include "translit_combining";""
+
+translit_end
+
+END LC_CTYPE
+
+LC_COLLATE
+% Copy the template from ISO/IEC 14651
+copy "iso14651_t1"
+END LC_COLLATE
+
+LC_MESSAGES
+% Yes=Waaw
+% No=Déet
+yesexpr "<U005E><U005B><U0077><U0057><U0079><U0059><U005D><U002E><U002A>"
+noexpr  "<U005E><U005B><U0064><U0044><U006E><U004E><U005D><U002E><U002A>"
+END LC_MESSAGES
+
+LC_MONETARY
+int_curr_symbol           "<U0058><U004F><U0046><U0020>"
+currency_symbol           "<U0043><U0046><U0041>"
+mon_decimal_point         "<U002C>"
+mon_thousands_sep         "<U0020>"
+mon_grouping              3;3
+positive_sign             ""
+negative_sign             "<U002D>"
+int_frac_digits           2
+frac_digits               2
+p_cs_precedes             0
+p_sep_by_space            1
+n_cs_precedes             0
+n_sep_by_space            1
+p_sign_posn               1
+n_sign_posn               1
+END LC_MONETARY
+
+LC_NUMERIC
+decimal_point             "<U002C>"
+thousands_sep             ""
+grouping                  0;0
+END LC_NUMERIC
+
+LC_TIME
+% dib'eer (dib), altine (alt), talaata (tal), allarba (all), alxames (alx),
+% ajjuma (ajj), gaawu (gaa)
+% Sunday, Monday....
+abday   "<U0064><U0069><U0062>";"<U0061><U006C><U0074>";/
+        "<U0074><U0061><U006C>";"<U0061><U006C><U006C>";/
+        "<U0061><U006C><U0078>";"<U0061><U006A><U006A>";/
+        "<U0067><U0061><U0061>"
+day     "<U0064><U0069><U0062><U0027><U0065><U0065><U0072>";/
+        "<U0061><U006C><U0074><U0069><U006E><U0065>";/
+        "<U0074><U0061><U006C><U0061><U0061><U0074><U0061>";/
+        "<U0061><U006C><U006C><U0061><U0072><U0062><U0061>";/
+        "<U0061><U006C><U0078><U0061><U006D><U0065><U0073>";/
+        "<U0061><U006A><U006A><U0075><U006D><U0061>";/
+        "<U0067><U0061><U0061><U0077><U0075>"
+% Sanwiy'e,  feebriy'e, mars,  awril, me,  suwen, sulet,  uut, septaambar,
+% oktoobar, nowaambar, desaambar.
+abmon   "<U0073><U0061><U006E>";"<U0066><U0065><U0065>";/
+        "<U006D><U0061><U0072>";"<U0061><U0077><U0072>";/
+        "<U006D><U0065><U0020>";"<U0073><U0075><U0077>";/
+        "<U0073><U0075><U006C>";"<U0075><U0075><U0074>";/
+        "<U0073><U0065><U0070>";"<U006F><U006B><U0074>";/
+        "<U006E><U006F><U0077>";"<U0064><U0065><U0073>"
+mon     "<U0073><U0061><U006E><U0077><U0069><U0079><U0027><U0065>";/
+        "<U0066><U0065><U0065><U0062><U0072><U0069><U0079><U0027><U0065>";/
+        "<U006D><U0061><U0072><U0073>";/
+        "<U0061><U0077><U0072><U0069><U006C>";/
+        "<U006D><U0065>";/
+        "<U0073><U0075><U0077><U0065><U006E>";/
+        "<U0073><U0075><U006C><U0065><U0074>";/
+        "<U0075><U0075><U0074>";/
+        "<U0073><U0065><U0070><U0074><U0061><U0061><U006D><U0062><U0061><U0072>";/
+        "<U006F><U006B><U0074><U006F><U006F><U0062><U0061><U0072>";/
+        "<U006E><U006F><U0077><U0061><U0061><U006D><U0062><U0061><U0072>";/
+        "<U0064><U0065><U0073><U0061><U0061><U006D><U0062><U0061><U0072>"
+% %a %d %b %Y %T %Z
+d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
+% %d.%m.%Y
+d_fmt   "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
+% %T
+t_fmt   "<U0025><U0054>"
+am_pm   "";""
+t_fmt_ampm ""
+% %a %b %e %H:%M:%S %Z %Y
+date_fmt       "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
+<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U005A><U0020><U0025><U0059>"
+END LC_TIME
+
+LC_PAPER
+height   297
+width    210
+END LC_PAPER
+
+LC_TELEPHONE
+% +%C %a %l
+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
+<U006C>"
+% %a %l
+tel_dom_fmt    "<U0025><U0061><U0020><U0025><U006C>"
+% 221
+int_prefix     "<U0032><U0032><U0031>"
+% 00
+int_select     "<U0030><U0030>"
+END LC_TELEPHONE
+
+LC_MEASUREMENT
+measurement    1
+END LC_MEASUREMENT
+
+LC_NAME
+% %d%t%g%t%m%t%f
+name_fmt    "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
+<U0025><U006D><U0025><U0074><U0025><U0066>"
+END LC_NAME
+
+LC_ADDRESS
+% %f%N%a%N%d%N%b%N%s %h %e %r%N%%z %T%N%c%N
+postal_fmt    "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
+<U004E><U0025><U0025><U007A><U0020><U0025><U0054><U0025>/
+<U004E><U0025><U0063><U0025><U004E>"
+country_ab2 "<U004D><U0047>"
+country_ab3 "<U004D><U0044><U0047>"
+country_num 450
+END LC_ADDRESS
+

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Wed Aug 22 00:03:47 2007
@@ -1,3 +1,16 @@
+2007-08-21  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #4938]
+	* allocatestack.c (__reclaim_stacks): Clear the TSD in the
+	reclaimed stack if necessary.
+	* Makefile (tests): Add tst-tsd6.
+	* tst-tsd6.c: New file.
+
+2007-08-21  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
+	Add private argument.
+
 2007-08-20  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S

Modified: fsf/trunk/libc/nptl/Makefile
==============================================================================
--- fsf/trunk/libc/nptl/Makefile (original)
+++ fsf/trunk/libc/nptl/Makefile Wed Aug 22 00:03:47 2007
@@ -227,7 +227,7 @@
 	tst-join1 tst-join2 tst-join3 tst-join4 tst-join5 tst-join6 \
 	tst-detach1 \
 	tst-eintr1 tst-eintr2 tst-eintr3 tst-eintr4 tst-eintr5 \
-	tst-tsd1 tst-tsd2 tst-tsd3 tst-tsd4 tst-tsd5 \
+	tst-tsd1 tst-tsd2 tst-tsd3 tst-tsd4 tst-tsd5 tst-tsd6 \
 	tst-tls1 tst-tls2 \
 	tst-fork1 tst-fork2 tst-fork3 tst-fork4 \
 	tst-atfork1 \

Modified: fsf/trunk/libc/nptl/allocatestack.c
==============================================================================
--- fsf/trunk/libc/nptl/allocatestack.c (original)
+++ fsf/trunk/libc/nptl/allocatestack.c Wed Aug 22 00:03:47 2007
@@ -794,6 +794,26 @@
 
 	  /* Account for the size of the stack.  */
 	  stack_cache_actsize += curp->stackblock_size;
+
+	  if (curp->specific_used)
+	    {
+	      /* Clear the thread-specific data.  */
+	      memset (curp->specific_1stblock, '\0',
+		      sizeof (curp->specific_1stblock));
+
+	      curp->specific_used = false;
+
+	      for (size_t cnt = 1; cnt < PTHREAD_KEY_1STLEVEL_SIZE; ++cnt)
+		if (curp->specific[cnt] != NULL)
+		  {
+		    memset (curp->specific[cnt], '\0',
+			    sizeof (curp->specific_1stblock));
+
+		    /* We have allocated the block which we do not
+		       free here so re-set the bit.  */
+		    curp->specific_used = true;
+		  }
+	    }
 	}
     }
 

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h Wed Aug 22 00:03:47 2007
@@ -94,12 +94,12 @@
     INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret;		      \
   })
 
-#define lll_robust_dead(futexv) \
+#define lll_robust_dead(futexv, private) \
   do									      \
     {									      \
       int *__futexp = &(futexv);					      \
       atomic_or (__futexp, FUTEX_OWNER_DIED);				      \
-      lll_futex_wake (__futexp, 1, LLL_SHARED);				      \
+      lll_futex_wake (__futexp, 1, private);				      \
     }									      \
   while (0)
 

Added: fsf/trunk/libc/nptl/tst-tsd6.c
==============================================================================
--- fsf/trunk/libc/nptl/tst-tsd6.c (added)
+++ fsf/trunk/libc/nptl/tst-tsd6.c Wed Aug 22 00:03:47 2007
@@ -1,0 +1,89 @@
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+#define NKEYS 100
+static pthread_key_t keys[NKEYS];
+static pthread_barrier_t b;
+
+
+static void *
+tf (void *arg)
+{
+  void *res = NULL;
+  for (int i = 0; i < NKEYS; ++i)
+    {
+      void *p = pthread_getspecific (keys[i]);
+      pthread_setspecific (keys[i], (void *) 7);
+      if (p != NULL)
+	res = p;
+    }
+  if (arg != NULL)
+    {
+      pthread_barrier_wait (arg);
+      pthread_barrier_wait (arg);
+    }
+  return res;
+}
+
+
+static int
+do_test (void)
+{
+  pthread_barrier_init (&b, NULL, 2);
+
+  for (int i = 0; i < NKEYS; ++i)
+    if (pthread_key_create (&keys[i], NULL) != 0)
+      {
+	puts ("cannot create keys");
+	return 1;
+      }
+
+  pthread_t th;
+  if (pthread_create (&th, NULL, tf, &b) != 0)
+    {
+      puts ("cannot create thread in parent");
+      return 1;
+    }
+
+  pthread_barrier_wait (&b);
+
+  pid_t pid = fork ();
+  if (pid == 0)
+    {
+      if (pthread_create (&th, NULL, tf, NULL) != 0)
+	{
+	  puts ("cannot create thread in child");
+	  exit (1);
+	}
+
+      void *res;
+      pthread_join (th, &res);
+
+      exit (res != NULL);
+    }
+  else if (pid == -1)
+    {
+      puts ("cannot create child process");
+      return 1;
+    }
+
+  int s;
+  if (TEMP_FAILURE_RETRY (waitpid (pid, &s, 0)) != pid)
+    {
+      puts ("failing to wait for child process");
+      return 1;
+    }
+
+  pthread_barrier_wait (&b);
+  pthread_join (th, NULL);
+
+  return !WIFEXITED (s) ? 2 : WEXITSTATUS (s);
+}
+
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/nscd/Makefile
==============================================================================
--- fsf/trunk/libc/nscd/Makefile (original)
+++ fsf/trunk/libc/nscd/Makefile Wed Aug 22 00:03:47 2007
@@ -35,7 +35,7 @@
 		getgrnam_r getgrgid_r hstcache gethstbyad_r gethstbynm2_r \
 		getsrvbynm_r getsrvbypt_r servicescache \
 		dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \
-		xmalloc xstrdup aicache initgrcache gai
+		xmalloc xstrdup aicache initgrcache gai res_hconf
 
 ifeq ($(have-thread-library),yes)
 
@@ -122,6 +122,7 @@
 CFLAGS-servicescache.c += $(nscd-cflags)
 CFLAGS-getsrvbynm_r.c += $(nscd-cflags)
 CFLAGS-getsrvbypt_r.c += $(nscd-cflags)
+CFLAGS-res_hconf.c += $(nscd-cflags)
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
 relro-LDFLAGS += -Wl,-z,now

Modified: fsf/trunk/libc/nscd/connections.c
==============================================================================
--- fsf/trunk/libc/nscd/connections.c (original)
+++ fsf/trunk/libc/nscd/connections.c Wed Aug 22 00:03:47 2007
@@ -1016,7 +1016,7 @@
 	  ssize_t nwritten;
 
 #ifdef HAVE_SENDFILE
-	  if (db->mmap_used || !cached->notfound)
+	  if (__builtin_expect (db->mmap_used, 1))
 	    {
 	      assert (db->wr_fd != -1);
 	      assert ((char *) cached->data > (char *) db->data);

Modified: fsf/trunk/libc/nscd/gethstbyad_r.c
==============================================================================
--- fsf/trunk/libc/nscd/gethstbyad_r.c (original)
+++ fsf/trunk/libc/nscd/gethstbyad_r.c Wed Aug 22 00:03:47 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2000, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -26,5 +26,6 @@
 #define ADD_VARIABLES	addr, len, type
 #define NEED_H_ERRNO	1
 #define NEED__RES	1
+#define NEED__RES_HCONF 1
 
 #include "../nss/getXXbyYY_r.c"

Modified: fsf/trunk/libc/nscd/gethstbynm2_r.c
==============================================================================
--- fsf/trunk/libc/nscd/gethstbynm2_r.c (original)
+++ fsf/trunk/libc/nscd/gethstbynm2_r.c Wed Aug 22 00:03:47 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 2000, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998, 2000, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -30,6 +30,7 @@
 #define ADD_PARAMS	const char *name, int af
 #define ADD_VARIABLES	name, af
 #define NEED_H_ERRNO	1
+#define NEED__RES_HCONF 1
 
 #define HANDLE_DIGITS_DOTS	1
 #define HAVE_LOOKUP_BUFFER	1

Modified: fsf/trunk/libc/nscd/hstcache.c
==============================================================================
--- fsf/trunk/libc/nscd/hstcache.c (original)
+++ fsf/trunk/libc/nscd/hstcache.c Wed Aug 22 00:03:47 2007
@@ -196,7 +196,7 @@
 
       /* Determine the number of addresses.  */
       h_addr_list_cnt = 0;
-      for (cnt = 0; hst->h_addr_list[cnt]; ++cnt)
+      while (hst->h_addr_list[h_addr_list_cnt] != NULL)
 	++h_addr_list_cnt;
 
       if (h_addr_list_cnt == 0)
@@ -221,7 +221,7 @@
 	 the current cache handling cannot handle and it is more than
 	 questionable whether it is worthwhile complicating the cache
 	 handling just for handling such a special case. */
-      if (he == NULL && hst->h_addr_list[1] == NULL)
+      if (he == NULL && h_addr_list_cnt == 1)
 	{
 	  dataset = (struct dataset *) mempool_alloc (db,
 						      total + req->key_len);
@@ -298,25 +298,31 @@
 	      /* The data has not changed.  We will just bump the
 		 timeout value.  Note that the new record has been
 		 allocated on the stack and need not be freed.  */
+	      assert (h_addr_list_cnt == 1);
 	      dh->timeout = dataset->head.timeout;
 	      ++dh->nreloads;
 	    }
 	  else
 	    {
-	      /* We have to create a new record.  Just allocate
-		 appropriate memory and copy it.  */
-	      struct dataset *newp
-		= (struct dataset *) mempool_alloc (db, total + req->key_len);
-	      if (newp != NULL)
+	      if (h_addr_list_cnt == 1)
 		{
-		  /* Adjust pointers into the memory block.  */
-		  addresses = (char *) newp + (addresses - (char *) dataset);
-		  aliases = (char *) newp + (aliases - (char *) dataset);
-		  assert (key_copy != NULL);
-		  key_copy = (char *) newp + (key_copy - (char *) dataset);
-
-		  dataset = memcpy (newp, dataset, total + req->key_len);
-		  alloca_used = false;
+		  /* We have to create a new record.  Just allocate
+		     appropriate memory and copy it.  */
+		  struct dataset *newp
+		    = (struct dataset *) mempool_alloc (db,
+							total + req->key_len);
+		  if (newp != NULL)
+		    {
+		      /* Adjust pointers into the memory block.  */
+		      addresses = (char *) newp + (addresses
+						   - (char *) dataset);
+		      aliases = (char *) newp + (aliases - (char *) dataset);
+		      assert (key_copy != NULL);
+		      key_copy = (char *) newp + (key_copy - (char *) dataset);
+
+		      dataset = memcpy (newp, dataset, total + req->key_len);
+		      alloca_used = false;
+		    }
 		}
 
 	      /* Mark the old record as obsolete.  */

Added: fsf/trunk/libc/nscd/res_hconf.c
==============================================================================
--- fsf/trunk/libc/nscd/res_hconf.c (added)
+++ fsf/trunk/libc/nscd/res_hconf.c Wed Aug 22 00:03:47 2007
@@ -1,0 +1,13 @@
+/* Add the include here so that we can redefine __fxprintf.  */
+#include <stdio.h>
+
+/* Rename symbols for protected names used in libc itself.  */
+#define __ioctl ioctl
+#define __socket socket
+#define __strchrnul strchrnul
+#define __strncasecmp strncasecmp
+
+#define __fxprintf(args...) /* ignore */
+
+
+#include "../resolv/res_hconf.c"

Modified: fsf/trunk/libc/resolv/res_hconf.c
==============================================================================
--- fsf/trunk/libc/resolv/res_hconf.c (original)
+++ fsf/trunk/libc/resolv/res_hconf.c Wed Aug 22 00:03:47 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995-2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger (davidm@xxxxxxxxxxxxx).
 
@@ -361,6 +361,7 @@
 }
 
 
+#ifndef NOT_IN_libc
 /* List of known interfaces.  */
 libc_freeres_ptr (
 static struct netaddr
@@ -532,3 +533,4 @@
   for (i = 0; hp->h_aliases[i]; ++i)
     _res_hconf_trim_domain (hp->h_aliases[i]);
 }
+#endif

Modified: fsf/trunk/libc/resolv/res_send.c
==============================================================================
--- fsf/trunk/libc/resolv/res_send.c (original)
+++ fsf/trunk/libc/resolv/res_send.c Wed Aug 22 00:03:47 2007
@@ -425,9 +425,12 @@
 				EXT(statp).nsaddrs[n] =
 				    malloc(sizeof (struct sockaddr_in6));
 			if (EXT(statp).nsaddrs[n] != NULL) {
-				memcpy(EXT(statp).nsaddrs[n],
-				       &statp->nsaddr_list[ns],
-				       sizeof (struct sockaddr_in));
+				memset (mempcpy(EXT(statp).nsaddrs[n],
+						&statp->nsaddr_list[ns],
+						sizeof (struct sockaddr_in)),
+					'\0',
+					sizeof (struct sockaddr_in6)
+					- sizeof (struct sockaddr_in));
 				EXT(statp).nssocks[n] = -1;
 				n++;
 			}

Modified: fsf/trunk/libc/stdio-common/tempnam.c
==============================================================================
--- fsf/trunk/libc/stdio-common/tempnam.c (original)
+++ fsf/trunk/libc/stdio-common/tempnam.c Wed Aug 22 00:03:47 2007
@@ -19,13 +19,13 @@
 #include <stdio.h>
 #include <string.h>
 
-/* Generate a unique temporary filename using up to five characters of PFX
-   if it is not NULL.  The directory to put this file in is searched for
-   as follows: First the environment variable "TMPDIR" is checked.
-   If it contains the name of a writable directory, that directory is used.
-   If not and if DIR is not NULL, that value is checked.  If that fails,
-   P_tmpdir is tried and finally "/tmp".  The storage for the filename
-   is allocated by `malloc'.  */
+/* Generate a unique temporary filename using up to five characters of
+   PFX if it is not NULL.  The directory to put this file in is
+   searched for as follows: First the environment variable "TMPDIR" is
+   checked.  If it contains the name of a directory, that directory is
+   used.  If not and if DIR is not NULL, that value is checked.  If
+   that fails, P_tmpdir is tried and finally "/tmp".  The storage for
+   the filename is allocated by `malloc'.  */
 char *
 tempnam (const char *dir, const char *pfx)
 {

Modified: fsf/trunk/libc/string/strtok.c
==============================================================================
--- fsf/trunk/libc/string/strtok.c (original)
+++ fsf/trunk/libc/string/strtok.c Wed Aug 22 00:03:47 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1996,1997,1999,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1996,1997,1999,2000,2001,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
@@ -30,7 +31,7 @@
 	x = strtok(s, "-");		// x = "abc"
 	x = strtok(NULL, "-=");		// x = "def"
 	x = strtok(NULL, "=");		// x = NULL
-		// s = "abc\0-def\0"
+		// s = "abc\0=-def\0"
 */
 char *
 strtok (s, delim)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h Wed Aug 22 00:03:47 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004
+/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@xxxxxxxxxxxxxx>, August 1995.
@@ -28,6 +28,8 @@
 
 /* There is some commonality.  */
 #include <sysdeps/unix/alpha/sysdep.h>
+
+#include <tls.h>
 
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h