mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 16:58:30 +00:00
Make improvements
- Add GetCpuCount() API to redbean - Add unix.gmtime() API to redbean - Add unix.readlink() API to redbean - Add unix.localtime() API to redbean - Perfect the new redbean UNIX module APIs - Integrate with Linux clock_gettime() vDSO - Run Lua garbage collector when malloc() fails - Fix another regression quirk with linenoise repl - Fix GetProgramExecutableName() for systemwide installs - Fix a build flake with test/libc/mem/test.mk SRCS list
This commit is contained in:
parent
860ea18a87
commit
d57b81aac7
51 changed files with 3096 additions and 1395 deletions
|
@ -22,13 +22,14 @@
|
|||
/**
|
||||
* Adds signal to set.
|
||||
*
|
||||
* @return true, false, or -1 w/ errno
|
||||
* @return 0 on success, or -1 w/ errno
|
||||
* @raises EINVAL if `1 ≤ sig ≤ NSIG` isn't the case
|
||||
* @asyncsignalsafe
|
||||
*/
|
||||
int sigaddset(sigset_t *set, int sig) {
|
||||
unsigned i = sig - 1;
|
||||
if (i < sizeof(set->__bits) * 8) {
|
||||
set->__bits[i >> 6] |= 1ull << (i & 63);
|
||||
_Static_assert(sizeof(set->__bits[0]) * CHAR_BIT == 64, "");
|
||||
if (1 <= sig && sig <= NSIG) {
|
||||
set->__bits[(sig - 1) >> 6] |= 1ull << ((sig - 1) & 63);
|
||||
return 0;
|
||||
} else {
|
||||
return einval();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue