summaryrefslogtreecommitdiff
path: root/tests/test-sigwaitinfo.lua
blob: 242b444ec53c960b6ac3da1a485abfd16b9d57ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local l = require "luxio"

function handler()
	return
end

l.sigaction(l.SIGINT, {["sa_handler"] = handler})

s = l.newsigset()
l.sigemptyset(s)
l.sigaddset(s, l.SIGINT)
print("Press CTRL-C...")


info, errno = l.sigwaitinfo(s)

if info ~= nil and info["si_signo"] == l.SIGINT then
	print("PASS")
else
	print(("FAIL (expected sig to be %d but it is %d)"):format(l.SIGINT, info["si_signo"]))
end