summaryrefslogtreecommitdiff
path: root/tests/test-sigwait.lua
diff options
context:
space:
mode:
authorRichard Ipsum <richardipsum@vx21.xyz>2019-10-04 23:28:49 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-10-06 09:22:07 +0100
commit4c42af5fd9b2bb8cc2c37c71314b8c443cf80392 (patch)
treec3993b270ccdfa757ba310c42da0ae7c5b9d9351 /tests/test-sigwait.lua
parentedeef019e8ad8b60f0547a854dc7763f98ff4c40 (diff)
downloadluxio-4c42af5fd9b2bb8cc2c37c71314b8c443cf80392.tar.bz2
Add sigpending, sigsuspend, sigwait, sigwaitinfo, sigtimedwait and raise
Diffstat (limited to 'tests/test-sigwait.lua')
-rw-r--r--tests/test-sigwait.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test-sigwait.lua b/tests/test-sigwait.lua
new file mode 100644
index 0000000..bbd2378
--- /dev/null
+++ b/tests/test-sigwait.lua
@@ -0,0 +1,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...")
+
+
+sig, errno = l.sigwait(s, l.SIGINT)
+
+if sig == l.SIGINT then
+ print("PASS")
+else
+ print(("FAIL (expected sig to be %d but it is %d)"):format(l.SIGINT, sig))
+end