summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authorbje <bje>1999-02-10 19:58:23 +0000
committerbje <bje>1999-02-10 19:58:23 +0000
commit2b1de79fdb83a3f941796204a19d6d99644b21e4 (patch)
treeb43224b36175c57a06a0c455350c605f56462f30 /signal.c
parenta3393261a13b52773dc1cd234a4e898e8065ecd0 (diff)
Reword description.pre-compiled-090898
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/signal.c b/signal.c
index 9fd222b..1deb38b 100644
--- a/signal.c
+++ b/signal.c
@@ -2,17 +2,14 @@
* signal.c
*
* Description:
- * POSIX thread-aware signal functions.
+ * Thread-aware signal functions.
*/
-#include <errno.h>
-
#include "pthread.h"
#include "implement.h"
-#if HAVE_SIGSET_T
int
-pthread_sigmask(int how, sigset_t const *set, sigset_t *oset)
+pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
{
pthread_t thread = pthread_self();
@@ -36,18 +33,18 @@ pthread_sigmask(int how, sigset_t const *set, sigset_t *oset)
/* Copy the old mask before modifying it. */
if (oset != NULL)
{
- memcpy(oset, &(thread->sigmask), sizeof(sigset_t));
+ memcpy(oset, &(thread->attr.sigmask), sizeof(sigset_t));
}
if (set != NULL)
{
- unsigned int i;
+ int i;
/* FIXME: this code assumes that sigmask is an even multiple of
the size of a long integer. */
- unsigned long *src = (unsigned long const *) set;
- unsigned long *dest = (unsigned long *) &(thread->sigmask);
+ unsigned long *src = (long *) set;
+ unsigned long *dest = &(thread->attr.sigmask);
switch (how)
{
@@ -55,22 +52,21 @@ pthread_sigmask(int how, sigset_t const *set, sigset_t *oset)
for (i = 0; i < (sizeof(sigset_t) / sizeof(unsigned long)); i++)
{
/* OR the bit field longword-wise. */
- *dest++ |= *src++;
+ *src++ |= *dest++;
}
break;
case SIG_UNBLOCK:
for (i = 0; i < (sizeof(sigset_t) / sizeof(unsigned long)); i++)
{
/* XOR the bitfield longword-wise. */
- *dest++ ^= *src++;
+ *src++ ^= *dest++;
}
case SIG_SETMASK:
/* Replace the whole sigmask. */
- memcpy(&(thread->sigmask), set, sizeof(sigset_t));
+ memcpy(&(thread->attr.sigmask), set, sizeof(sigset_t));
break;
}
}
return 0;
}
-#endif /* HAVE_SIGSET_T */