aboutsummaryrefslogtreecommitdiff
path: root/hurd/hurdinit.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-13 01:10:42 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-13 02:24:18 +0100
commit2aa072d395bf93bfc6aa570983911f1db40a8dac (patch)
tree55ce1b8f3956976f542576925c04606f0e54ea39 /hurd/hurdinit.c
parent946dcc6fde331a785d40d1341cc99a10ca304fd6 (diff)
downloadglibc-2aa072d395bf93bfc6aa570983911f1db40a8dac.zip
glibc-2aa072d395bf93bfc6aa570983911f1db40a8dac.tar.gz
glibc-2aa072d395bf93bfc6aa570983911f1db40a8dac.tar.bz2
hurd: initialize libpthread before starting the signal thread
We cannot rely on csu calling __pthread_initialize_minimal before posixland_init, in some cases _init gets called before that.
Diffstat (limited to 'hurd/hurdinit.c')
-rw-r--r--hurd/hurdinit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hurd/hurdinit.c b/hurd/hurdinit.c
index 06a2d3b..7faa51b 100644
--- a/hurd/hurdinit.c
+++ b/hurd/hurdinit.c
@@ -21,6 +21,7 @@
#include <unistd.h>
#include <hurd.h>
#include <hurd/port.h>
+#include <ldsodefs.h>
#include "set-hooks.h"
#include "hurdmalloc.h" /* XXX */
@@ -116,6 +117,11 @@ _hurd_libc_proc_init (char **argv)
{
if (_hurd_portarray)
{
+ /* We will start the signal thread, so we need to initialize libpthread
+ * if linked in. */
+ if (__pthread_initialize_minimal != NULL)
+ __pthread_initialize_minimal ();
+
/* Tell the proc server we exist, if it does. */
if (_hurd_portarray[INIT_PORT_PROC] != MACH_PORT_NULL)
_hurd_new_proc_init (argv, _hurd_intarray, _hurd_intarraysize);