summaryrefslogtreecommitdiff
path: root/libc/signal/sigaction.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-01-22 17:43:14 +0000
committerEric Andersen <andersen@codepoet.org>2003-01-22 17:43:14 +0000
commit9febc84ad3517e6226418ca6b9280ab1f069209f (patch)
treeff81fa54fb323029b34fb516114736417a55ca3f /libc/signal/sigaction.c
parent270ae06ae88745421f99a161e837a9eea6eaf83a (diff)
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
Diffstat (limited to 'libc/signal/sigaction.c')
-rw-r--r--libc/signal/sigaction.c16
1 files changed, 14 insertions, 2 deletions
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) {