summaryrefslogtreecommitdiff
path: root/lib/libc_r/uthread/uthread_kill.c
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2002-10-30 19:11:57 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2002-10-30 19:11:57 +0000
commit5b3d505b4e254da05bc3ffa547a6e9f65798bf3d (patch)
tree0ceb12589bb4b87bde661f6909649e57f1b16c15 /lib/libc_r/uthread/uthread_kill.c
parent2051a2b3c5d4ccdbc313073e0e948ca64da5d8e7 (diff)
signal handling changes. This corrects several signal
handling errors in the threads library. Most of the libc_r regression tests are now ok. thread specific kill semantics are still not correct. No negative comments after posting to tech@ a week or so ago. siginfo test fails on sparc64 due to sparc64 oddity.
Diffstat (limited to 'lib/libc_r/uthread/uthread_kill.c')
-rw-r--r--lib/libc_r/uthread/uthread_kill.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/libc_r/uthread/uthread_kill.c b/lib/libc_r/uthread/uthread_kill.c
index 172d3817513..59d78b80ebf 100644
--- a/lib/libc_r/uthread/uthread_kill.c
+++ b/lib/libc_r/uthread/uthread_kill.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_kill.c,v 1.7 1999/11/25 07:01:37 d Exp $ */
+/* $OpenBSD: uthread_kill.c,v 1.8 2002/10/30 19:11:56 marc Exp $ */
/*
* Copyright (c) 1997 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -38,6 +38,12 @@
#include <pthread.h>
#include "pthread_private.h"
+/*
+ * XXX THIS IS WRONG! The signal has to either come through the OS to
+ * get the proper siginfo, context, etc., or we need to gen up a
+ * siginfo (assuming needed). Signal reset and other semantics
+ * also need to be obeyed.
+ */
int
pthread_kill(pthread_t pthread, int sig)
{
@@ -75,7 +81,6 @@ pthread_kill(pthread_t pthread, int sig)
/* Return the signal number: */
pthread->signo = sig;
}
- /* Increment the pending signal count: */
sigaddset(&pthread->sigpend,sig);
break;
@@ -88,7 +93,6 @@ pthread_kill(pthread_t pthread, int sig)
/* Return the signal number: */
pthread->signo = sig;
} else
- /* Increment the pending signal count. */
sigaddset(&pthread->sigpend,sig);
break;
@@ -111,7 +115,6 @@ pthread_kill(pthread_t pthread, int sig)
/* Return the signal number: */
pthread->signo = sig;
} else {
- /* Increment the pending signal count: */
sigaddset(&pthread->sigpend,sig);
}
break;
@@ -144,7 +147,7 @@ pthread_kill(pthread_t pthread, int sig)
/*
* Dispatch the signal via the custom signal
- * handler:
+ * handler: ;;; what about SA_SIGINFO???
*/
(*(_thread_sigact[sig - 1].sa_handler))(sig);