From 9febc84ad3517e6226418ca6b9280ab1f069209f Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 22 Jan 2003 17:43:14 +0000 Subject: Update sigaction syscall names to act more like glibc. Fix the x86 sigaction implementation such that gdb can actually debug signal handlers. Gdb behaves much better now, for example, on multi-threaded apps. -Erik --- libc/signal/sigaction.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'libc/signal') diff --git a/libc/signal/sigaction.c b/libc/signal/sigaction.c index 96e3d938d..eb6b43a49 100644 --- a/libc/signal/sigaction.c +++ b/libc/signal/sigaction.c @@ -32,6 +32,12 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa int result; struct kernel_sigaction kact, koact; +#ifdef SIGCANCEL + if (sig == SIGCANCEL) { + __set_errno (EINVAL); + return -1; + } +#endif if (act) { kact.k_sa_handler = act->sa_handler; memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask)); @@ -43,7 +49,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - result = __rt_sigaction(sig, act ? __ptrvalue (&kact) : NULL, + result = __syscall_rt_sigaction(sig, act ? __ptrvalue (&kact) : NULL, oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); if (oact && result >= 0) { @@ -67,6 +73,12 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa int result; struct old_kernel_sigaction kact, koact; +#ifdef SIGCANCEL + if (sig == SIGCANCEL) { + __set_errno (EINVAL); + return -1; + } +#endif if (act) { kact.k_sa_handler = act->sa_handler; kact.sa_mask = act->sa_mask.__val[0]; @@ -75,7 +87,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa kact.sa_restorer = act->sa_restorer; # endif } - result = __sigaction(sig, act ? __ptrvalue (&kact) : NULL, + result = __syscall_sigaction(sig, act ? __ptrvalue (&kact) : NULL, oact ? __ptrvalue (&koact) : NULL); if (oact && result >= 0) { -- cgit v1.2.3