diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-01 12:34:45 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-01 12:34:45 -0800 |
commit | 2b534217bf1fb1cfd38f26d1e7f23af262ae2eac (patch) | |
tree | 520261f9bc62f41bdcbb8960a848c5374c2df538 | |
parent | b42a90360ab918019e1824a1fd43966638a6faba (diff) |
sig* functions
-rw-r--r-- | src/library.js | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/library.js b/src/library.js index eb7c4beb..159c7087 100644 --- a/src/library.js +++ b/src/library.js @@ -6063,18 +6063,26 @@ LibraryManager.library = { }, sigemptyset: function(set) { // int sigemptyset(sigset_t *set); - // TODO: Implement for real; don't hardcode offsets. - {{{ makeSetValue('set', '0', '0', 'i32') }}} - {{{ makeSetValue('set', '4', '0', 'i32') }}} - {{{ makeSetValue('set', '8', '0', 'i32') }}} - {{{ makeSetValue('set', '12', '0', 'i32') }}} + {{{ makeSetValue('set', '0', '0', 'i32') }}}; return 0; }, - sigfillset: 'sigemptyset', - sigdelset: 'sigemptyset', + sigfillset: function(set) { + {{{ makeSetValue('set', '0', '-1>>>0', 'i32') }}}; + return 0; + }, + sigaddset: function(set, signum) { + {{{ makeSetValue('set', '0', makeGetValue('set', '0', 'i32') + '| (1 << (signum-1))', 'i32') }}}; + return 0; + }, + sigdelset: function(set, signum) { + {{{ makeSetValue('set', '0', makeGetValue('set', '0', 'i32') + '& (~(1 << (signum-1)))', 'i32') }}}; + return 0; + }, + sigismember: function(set, signum) { + return {{{ makeGetValue('set', '0', 'i32') }}} & (1 << (signum-1)); + }, sigaction: function(set) { - // int sigemptyset(sigset_t *set); - // TODO: Implement for real. + // TODO: return 0; }, sigprocmask: 'sigaction', |