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.20-92-g327ae25
- From: roland at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 17 Oct 2014 20:50:08 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.20-92-g327ae25
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 327ae2570744dabf7f065a6b529d16cc22438603 (commit)
from b0643088bc7387e04cf53dcf7331d02f7fa62c72 (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=327ae2570744dabf7f065a6b529d16cc22438603
commit 327ae2570744dabf7f065a6b529d16cc22438603
Author: Roland McGrath <roland@hack.frob.com>
Date: Fri Oct 17 13:40:46 2014 -0700
NPTL: Conditionalize more uses of SIGCANCEL and SIGSETXID.
diff --git a/ChangeLog b/ChangeLog
index 502bd42..51f07f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2014-10-17 Roland McGrath <roland@hack.frob.com>
+ * nptl/nptl-init.c (sighandler_setxid, __xidcmd): Make definitions
+ conditional on [SIGSETXID].
+ (sigcancel_handler): Make definition conditional on [SIGCANCEL].
+ (__pthread_initialize_minimal_internal): Set up SIGCANCEL only if it
+ is defined. Likewise for SIGSETXID.
+ * nptl/allocatestack.c (setxid_mark_thread, setxid_unmark_thread):
+ Conditionalize definitions on [SIGSETXID].
+ (setxid_signal_thread, __nptl_setxid_error, __nptl_setxid): Likewise.
+ * nptl/pthread_create.c (start_thread): Conditionalize SIGCANCEL
+ unblocking on [SIGCANCEL].
+
* nptl/nptl-init.c (__nptl_set_robust): Conditionalize body on
[__NR_set_robust_list].
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index d95ffe9..b19d9b3 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -978,6 +978,7 @@ __find_thread_by_id (pid_t tid)
#endif
+#ifdef SIGSETXID
static void
internal_function
setxid_mark_thread (struct xid_command *cmdp, struct pthread *t)
@@ -1185,6 +1186,8 @@ __nptl_setxid (struct xid_command *cmdp)
lll_unlock (stack_cache_lock, LLL_PRIVATE);
return result;
}
+#endif /* SIGSETXID. */
+
static inline void __attribute__((always_inline))
init_one_static_tls (struct pthread *curp, struct link_map *map)
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 44223a7..d8154c4 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -170,6 +170,7 @@ __nptl_set_robust (struct pthread *self)
}
+#ifdef SIGCANCEL
/* For asynchronous cancellation we use a signal. This is the handler. */
static void
sigcancel_handler (int sig, siginfo_t *si, void *ctx)
@@ -221,8 +222,10 @@ sigcancel_handler (int sig, siginfo_t *si, void *ctx)
oldval = curval;
}
}
+#endif
+#ifdef SIGSETXID
struct xid_command *__xidcmd attribute_hidden;
/* We use the SIGSETXID signal in the setuid, setgid, etc. implementations to
@@ -273,6 +276,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
if (atomic_decrement_val (&__xidcmd->cntr) == 0)
lll_futex_wake (&__xidcmd->cntr, 1, LLL_PRIVATE);
}
+#endif
/* When using __thread for this, we do it in libc so as not
@@ -372,29 +376,38 @@ __pthread_initialize_minimal_internal (void)
had to set __nptl_initial_report_events. Propagate its setting. */
THREAD_SETMEM (pd, report_events, __nptl_initial_report_events);
+#if defined SIGCANCEL || defined SIGSETXID
+ struct sigaction sa;
+ __sigemptyset (&sa.sa_mask);
+
+# ifdef SIGCANCEL
/* Install the cancellation signal handler. If for some reason we
cannot install the handler we do not abort. Maybe we should, but
it is only asynchronous cancellation which is affected. */
- struct sigaction sa;
sa.sa_sigaction = sigcancel_handler;
sa.sa_flags = SA_SIGINFO;
- __sigemptyset (&sa.sa_mask);
-
(void) __libc_sigaction (SIGCANCEL, &sa, NULL);
+# endif
+# ifdef SIGSETXID
/* Install the handle to change the threads' uid/gid. */
sa.sa_sigaction = sighandler_setxid;
sa.sa_flags = SA_SIGINFO | SA_RESTART;
-
(void) __libc_sigaction (SIGSETXID, &sa, NULL);
+# endif
/* The parent process might have left the signals blocked. Just in
case, unblock it. We reuse the signal mask in the sigaction
structure. It is already cleared. */
+# ifdef SIGCANCEL
__sigaddset (&sa.sa_mask, SIGCANCEL);
+# endif
+# ifdef SIGSETXID
__sigaddset (&sa.sa_mask, SIGSETXID);
+# endif
(void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &sa.sa_mask,
NULL, _NSIG / 8);
+#endif
/* Get the size of the static and alignment requirements for the TLS
block. */
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index b9af010..0055634 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -263,6 +263,7 @@ start_thread (void *arg)
}
#endif
+#ifdef SIGCANCEL
/* If the parent was running cancellation handlers while creating
the thread the new thread inherited the signal mask. Reset the
cancellation signal mask. */
@@ -275,6 +276,7 @@ start_thread (void *arg)
(void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &mask,
NULL, _NSIG / 8);
}
+#endif
/* This is where the try/finally block should be created. For
compilers without that support we do use setjmp. */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 11 +++++++++++
nptl/allocatestack.c | 3 +++
nptl/nptl-init.c | 21 +++++++++++++++++----
nptl/pthread_create.c | 2 ++
4 files changed, 33 insertions(+), 4 deletions(-)
hooks/post-receive
--
GNU C Library master sources