Deleted Added
sdiff udiff text old ( 35509 ) new ( 38539 )
full compact
1/*
2 * Copyright (c) 1997 John Birrell <jb@cimlogic.com.au>.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 25 unchanged lines hidden (view full) ---

34#include <errno.h>
35#ifdef _THREAD_SAFE
36#include <pthread.h>
37#include "pthread_private.h"
38
39int
40sigwait(const sigset_t * set, int *sig)
41{
42 int ret;
43 int status;
44 sigset_t oset;
45
46 /* Save the current sigmal mask: */
47 oset = _thread_run->sigmask;
48
49 /* Combine the caller's mask with the current one: */
50 _thread_run->sigmask |= *set;
51
52 /* Wait for a signal: */
53 _thread_kern_sched_state(PS_SIGWAIT, __FILE__, __LINE__);
54
55 /* Return the signal number to the caller: */
56 *sig = _thread_run->signo;
57
58 /* Restore the signal mask: */
59 _thread_run->sigmask = oset;
60
61 /* Return the completion status: */
62 return (ret);
63}
64#endif