aboutsummaryrefslogtreecommitdiffstats
path: root/tests/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/signal.c')
-rw-r--r--tests/signal.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/signal.c b/tests/signal.c
new file mode 100644
index 0000000..e4862cd
--- /dev/null
+++ b/tests/signal.c
@@ -0,0 +1,18 @@
+#include <signal.h>
+#include <unistd.h>
+
+static void
+interrupt()
+{
+ write(-2, "xyzzy\n", 6);
+}
+
+int
+main(void)
+{
+ signal(SIGINT, interrupt);
+ kill(getpid(), SIGINT);
+ usleep(100000U);
+ write(-1, "qwerty\n", 7);
+ return 0;
+}