blob: aadc5719ca10f5ada7a218a00eede17b8c7d21a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
-- See LICENSE file for copyright and license details.
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
|