This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.27.9000-210-g34e6a86
- From: sthibaul at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 17 Mar 2018 21:53:25 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.27.9000-210-g34e6a86
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 34e6a8694d9dd80558150f8542359b93c6c57e44 (commit)
from f8baf2a2242029600beb213d3f042e7c0482e502 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=34e6a8694d9dd80558150f8542359b93c6c57e44
commit 34e6a8694d9dd80558150f8542359b93c6c57e44
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sat Mar 17 22:50:09 2018 +0100
hurd: Fix getting signal thread stack layout for fork
* hurd/hurdsig.c: Include <pthread.h>.
(_hurdsig_init): Call pthread_getattr_np and pthread_attr_getstack to
get the signal thread stack layout.
diff --git a/ChangeLog b/ChangeLog
index 175bcaf..7f4721b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-03-17 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * hurd/hurdsig.c: Include <pthread.h>.
+ (_hurdsig_init): Call pthread_getattr_np and pthread_attr_getstack to
+ get the signal thread stack layout.
+
2018-03-16 Samuel Thibault <samuel.thibault@ens-lyon.org>
* sysdeps/generic/thread_state.h (MACHINE_NEW_THREAD_STATE_FLAVOR):
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index 4f5bb9a..198546f 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <cthreads.h> /* For `struct mutex'. */
+#include <pthread.h>
#include <mach.h>
#include <mach/thread_switch.h>
@@ -1297,7 +1298,24 @@ _hurdsig_init (const int *intarray, size_t intarraysize)
values all zero so they'll be ignored. */
#pragma weak cthread_fork
#pragma weak cthread_detach
- cthread_detach (cthread_fork ((cthread_fn_t) &_hurd_msgport_receive, 0));
+#pragma weak pthread_getattr_np
+#pragma weak pthread_attr_getstack
+ cthread_t thread = cthread_fork ((cthread_fn_t) &_hurd_msgport_receive,
+ 0);
+ cthread_detach (thread);
+
+ if (pthread_getattr_np)
+ {
+ /* Record signal thread stack layout for fork() */
+ pthread_attr_t attr;
+ void *addr;
+ size_t size;
+
+ pthread_getattr_np ((pthread_t) thread, &attr);
+ pthread_attr_getstack (&attr, &addr, &size);
+ __hurd_sigthread_stack_base = (uintptr_t) addr;
+ __hurd_sigthread_stack_end = __hurd_sigthread_stack_base + size;
+ }
/* XXX We need the thread port for the signal thread further on
in this thread (see hurdfault.c:_hurdsigfault_init).
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
hurd/hurdsig.c | 20 +++++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletions(-)
hooks/post-receive
--
GNU C Library master sources