mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 00:08:30 +00:00
Add posix semaphores support
There's still some bugs to work out on Windows and OpenBSD.
This commit is contained in:
parent
f52f65b2e3
commit
8111462789
36 changed files with 779 additions and 59 deletions
|
@ -17,10 +17,20 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/struct/sigset.h"
|
||||
#include "libc/errno.h"
|
||||
|
||||
/**
|
||||
* Examines and/or changes blocked signals on current thread.
|
||||
*
|
||||
* @return 0 on success, or errno on error
|
||||
*/
|
||||
int pthread_sigmask(int how, const sigset_t *set, sigset_t *old) {
|
||||
return sigprocmask(how, set, old);
|
||||
int rc, e = errno;
|
||||
if (!sigprocmask(how, set, old)) {
|
||||
rc = 0;
|
||||
} else {
|
||||
rc = errno;
|
||||
errno = e;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue