From 5c42a31b9bd19b92ed433f06a90ea139aa99f923 Mon Sep 17 00:00:00 2001 From: Justice Suh Date: Tue, 2 Jul 2019 16:13:23 -0400 Subject: [PATCH] os: capture signals --- vlib/os/os.v | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vlib/os/os.v b/vlib/os/os.v index 902be9b9ed..6725a3491f 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -53,9 +53,14 @@ import const ( SEEK_SET SEEK_END SA_SIGINFO - SIGSEGV S_IFMT S_IFDIR + SIGABRT + SIGFPE + SIGILL + SIGINT + SIGSEGV + SIGTERM ) struct C.stat { @@ -587,6 +592,10 @@ $else { } } +pub fn signal(signum int, handler voidptr) { + C.signal(signum, handler) +} + fn log(s string) { }