From 3ba7b3831f91dc7a297446458efd811fbe46d3dc Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 27 Oct 2004 07:48:08 +0000 Subject: * sysdeps/mach/hurd/i386/tls.h (HURD_TLS_DESC_DECL): New macro. (_hurd_tls_init): Use it. (_hurd_tls_fork): New function. * sysdeps/mach/hurd/fork.c (__fork) [USE_TLS]: Call it. --- sysdeps/mach/hurd/fork.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sysdeps/mach/hurd/fork.c') diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c index c3f8a1a..8728596 100644 --- a/sysdeps/mach/hurd/fork.c +++ b/sysdeps/mach/hurd/fork.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994,95,96,97,99,2001,02 Free Software Foundation, Inc. +/* Copyright (C) 1994,95,96,97,99,2001,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 @@ -26,6 +26,7 @@ #include "set-hooks.h" #include #include "hurdmalloc.h" /* XXX */ +#include #undef __fork @@ -529,6 +530,13 @@ __fork (void) /* Set the child user thread up to return 1 from the setjmp above. */ _hurd_longjmp_thread_state (&state, env, 1); + +#if USE_TLS + /* Do special thread setup for TLS if needed. */ + if (err = _hurd_tls_fork (thread, &state)) + LOSE; +#endif + if (err = __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR, (natural_t *) &state, statecount)) LOSE; -- cgit v1.1