summaryrefslogtreecommitdiff
path: root/tests/compile/libc_signal.pyx
diff options
context:
space:
mode:
authorLisandro Dalcin <dalcinl@gmail.com>2010-03-16 16:58:52 -0300
committerLisandro Dalcin <dalcinl@gmail.com>2010-03-16 16:58:52 -0300
commitcd7ea555fff100161e2a5839b70b794469b23cea (patch)
treec2a8f05a48d977b3c47bb5d12c1f77f5dd146128 /tests/compile/libc_signal.pyx
parent0bc3d7b7b1d544ddad5c5cc73d270d6dfe41a93b (diff)
downloadcython-cd7ea555fff100161e2a5839b70b794469b23cea.tar.gz
some .pxd for C99 on Cython/Includes/libc (incomplete, many tests missing)
--HG-- extra : rebase_source : d9445f29b6d417ef02c53f7f9b490843de81501c
Diffstat (limited to 'tests/compile/libc_signal.pyx')
-rw-r--r--tests/compile/libc_signal.pyx17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/compile/libc_signal.pyx b/tests/compile/libc_signal.pyx
new file mode 100644
index 000000000..523359e96
--- /dev/null
+++ b/tests/compile/libc_signal.pyx
@@ -0,0 +1,17 @@
+from libc.signal cimport *
+
+cdef void sighdl(int signum) nogil:
+ pass
+
+cdef sighandler_t h
+
+h = signal(SIGABRT, sighdl)
+if h == SIG_ERR: pass
+h = signal(SIGABRT, SIG_IGN)
+if h == SIG_ERR: pass
+h = signal(SIGABRT, SIG_DFL)
+if h == SIG_ERR: pass
+
+h = signal(SIGABRT, SIG_IGN)
+cdef int e = raise_(SIGABRT)
+h = signal(SIGABRT, h)