summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_syscalls.c
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2004-03-27 15:05:28 +0000
committermtm <mtm@FreeBSD.org>2004-03-27 15:05:28 +0000
commit1368ee7bbe8fe12cc3198ba6d3b60c72aba57b4c (patch)
tree59962a1a1997ce2f27f3837a246291555fd466ff /lib/libthr/thread/thr_syscalls.c
parent9481d0539ded5c181074110b4561003edab1a015 (diff)
downloadFreeBSD-src-1368ee7bbe8fe12cc3198ba6d3b60c72aba57b4c.zip
FreeBSD-src-1368ee7bbe8fe12cc3198ba6d3b60c72aba57b4c.tar.gz
o Since we're not using signals for thread synchronization anymore,
sigprocmask no longer needs to be wrapped. o raise(3) is applied to the calling thread in a threaded program. o In the sigaction wrapper reference the correct structure. o Don't treat SIGTHR especially anymore (infact it won't exist in a little while).
Diffstat (limited to 'lib/libthr/thread/thr_syscalls.c')
-rw-r--r--lib/libthr/thread/thr_syscalls.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_syscalls.c b/lib/libthr/thread/thr_syscalls.c
index badd7cb..2d83ab5 100644
--- a/lib/libthr/thread/thr_syscalls.c
+++ b/lib/libthr/thread/thr_syscalls.c
@@ -272,6 +272,21 @@ pselect(int count, fd_set *rfds, fd_set *wfds, fd_set *efds,
return (ret);
}
+__weak_reference(_raise, raise);
+
+int
+_raise(int sig)
+{
+ int error;
+
+ error = pthread_kill(pthread_self(), sig);
+ if (error != 0) {
+ errno = error;
+ error = -1;
+ }
+ return (error);
+}
+
__weak_reference(_read, read);
ssize_t
@@ -324,13 +339,11 @@ _sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
struct sigaction oldact, wrapperact;
int error;
- /* Detect invalid signals. Signal SIGTHR is silently ignored */
+ /* Detect invalid signals. */
if (sig < 1 || sig > NSIG) {
errno = EINVAL;
return (-1);
}
- if (sig == SIGTHR)
- return (0);
/*
* If act is not NULL the library's signal wrapper is passed into the
@@ -348,7 +361,7 @@ _sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
tmpact->sa_handler != SIG_IGN) {
bcopy((const void *)tmpact, (void *)&wrapperact,
sizeof(struct sigaction));
- tmpact->sa_flags &= SA_SIGINFO;
+ wrapperact.sa_flags |= SA_SIGINFO;
wrapperact.sa_sigaction = &_thread_sig_wrapper;
tmpact = &wrapperact;
}
OpenPOWER on IntegriCloud