1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-08 09:49:58 +00:00
janet/examples/sigaction.janet

12 lines
307 B
Plaintext

(defn action []
(print "cleanup")
(os/exit 1))
(defn main [_]
# Set the interrupt-interpreter argument to `true` to allow
# interrupting the busy loop `(forever)`. By default, will not
# interrupt the interpreter.
(os/sigaction :term action true)
(os/sigaction :int action true)
(forever))