* sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup: doinit):
authorRoland McGrath <roland@gnu.org>
Fri, 30 Aug 2002 01:51:11 +0000 (01:51 +0000)
committerRoland McGrath <roland@gnu.org>
Fri, 30 Aug 2002 01:51:11 +0000 (01:51 +0000)
Change argument type from int to intptr_t.

* locale/global-locale.c (__libc_tsd_LOCALE_data): Conditionalize the
initializer on [! _HURD_THREADVAR_H] (bad kludge).
* sysdeps/mach/hurd/i386/init-first.c (init): Initialize
_HURD_THREADVAR_LOCALE slot to &_nl_global_locale.
* hurd/hurdsig.c (_hurdsig_init): Likewise.  Zero other slots.

ChangeLog
hurd/hurdsig.c
locale/global-locale.c
sysdeps/mach/hurd/i386/init-first.c

index 394789a143caa28f189c732b6eb300cc89c29a6f..25de4eee0fabfe6861654b7494a90bf8e8e597c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2002-08-29  Roland McGrath  <roland@redhat.com>
 
+       * sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup: doinit):
+       Change argument type from int to intptr_t.
+
+       * locale/global-locale.c (__libc_tsd_LOCALE_data): Conditionalize the
+       initializer on [! _HURD_THREADVAR_H] (bad kludge).
+       * sysdeps/mach/hurd/i386/init-first.c (init): Initialize
+       _HURD_THREADVAR_LOCALE slot to &_nl_global_locale.
+       * hurd/hurdsig.c (_hurdsig_init): Likewise.  Zero other slots.
+
        * sysdeps/mach/_strerror.c (__strerror_r): Add libc_hidden_def.
 
        * sysdeps/mach/hurd/pwrite64.c: No libc_hidden_def (__libc_pwrite64).
index 2507a8b8a98014265efdd319f2830411fced9a8c..bbd0c17182ee476f850152edb4475599ebf819f0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,01
+/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,01,2002
        Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -31,6 +31,7 @@
 
 #include "hurdfault.h"
 #include "hurdmalloc.h"                /* XXX */
+#include "../locale/localeinfo.h"
 
 const char *_hurdsig_getenv (const char *);
 
@@ -1265,6 +1266,10 @@ _hurdsig_init (const int *intarray, size_t intarraysize)
        malloc (__hurd_threadvar_max * sizeof (unsigned long int));
       if (__hurd_sigthread_variables == NULL)
        __libc_fatal ("hurd: Can't allocate threadvars for signal thread\n");
+      memset (__hurd_sigthread_variables, 0,
+             __hurd_threadvar_max * sizeof (unsigned long int));
+      __hurd_sigthread_variables[_HURD_THREADVAR_LOCALE]
+       = (unsigned long int) &_nl_global_locale;
 
       /* Reinitialize the MiG support routines so they will use a per-thread
         variable for the cached reply port.  */
index 70f10ab5ae97cfbf4f316c74eeb5b014de06f01e..bec7498daeb9843b44d260cd2a03878dda18c2ea 100644 (file)
@@ -58,6 +58,10 @@ __thread void *__libc_tsd_LOCALE = &_nl_global_locale;
 #else
 __libc_tsd_define (, LOCALE)
 /* This is a bad kludge presuming the variable name used by the macros.
-   Using typeof makes sure to barf if we do not match the macro definition.  */
+   Using typeof makes sure to barf if we do not match the macro definition.
+   This ifndef is a further bad kludge for Hurd, where there is an explicit
+   initialization.  */
+# ifndef _HURD_THREADVAR_H
 __typeof (__libc_tsd_LOCALE_data) __libc_tsd_LOCALE_data = &_nl_global_locale;
+# endif
 #endif
index 787a750045ae995a329f939382c8e98598aadeaa..47edae5086b63caefeb8f3f407939f7e22b3c355 100644 (file)
@@ -26,6 +26,7 @@
 #include <set-hooks.h>
 #include "hurdstartup.h"
 #include "hurdmalloc.h"                /* XXX */
+#include "../locale/localeinfo.h"
 
 extern void __mach_init (void);
 extern void __libc_init (int, char **, char **);
@@ -145,6 +146,7 @@ init (int *data)
      for malloc et al, or so we can use malloc below for the real
      threadvars array.  */
   memset (threadvars, 0, sizeof threadvars);
+  threadvars[_HURD_THREADVAR_LOCALE] = (unsigned long int) &_nl_global_locale;
   __hurd_threadvar_stack_offset = (unsigned long int) threadvars;
 
   /* Since the cthreads initialization code uses malloc, and the
@@ -319,7 +321,7 @@ strong_alias (posixland_init, __libc_init_first);
 void
 _hurd_stack_setup (volatile int argc, ...)
 {
-  void doinit (int *data)
+  void doinit (intptr_t *data)
     {
       /* This function gets called with the argument data at TOS.  */
       void doinit1 (volatile int argc, ...)