summaryrefslogtreecommitdiff
path: root/tests/test-sigpending.lua
blob: 87258918d38fe348045cf218cd789224e33db7cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- See LICENSE file for copyright and license details.
local l = require "luxio"

s = l.newsigset()
l.sigemptyset(s)
l.sigaddset(s, l.SIGUSR1)
l.sigprocmask(l.SIG_BLOCK, s)
l.raise(l.SIGUSR1)

pending = l.sigpending()

present, errno = l.sigismember(pending, l.SIGUSR1)

if present == 1 then
    print("PASS")
else
    print("FAIL")
end