Skip to content

Commit 1ee2b9b

Browse files
committed
Provide own definitions for sigaction(2) etc.
The definitions from posix/signal.pxd were broken before Cython 0.24: cython/cython@ced17f8 Fixes: afl.pyx:130:36: Cannot assign type 'sighandler_t' to 'void *(*)(int)'
1 parent 188a074 commit 1ee2b9b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Diff for: afl.pyx

+15-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,21 @@ from libc.stddef cimport size_t
4848
from libc.stdint cimport uint32_t
4949
from libc.stdlib cimport getenv
5050
from libc.string cimport strlen
51-
from posix.signal cimport sigaction, sigaction_t, sigemptyset
51+
52+
cdef extern from 'signal.h':
53+
# We could use definitions from posix/signal.pxd,
54+
# but these were broken before Cython 0.24.
55+
ctypedef struct siginfo_t:
56+
pass
57+
ctypedef struct sigset_t:
58+
pass
59+
cdef struct sigaction_t 'sigaction':
60+
void sa_handler(int)
61+
void sa_sigaction(int, siginfo_t *, void *)
62+
sigset_t sa_mask
63+
int sa_flags
64+
int sigaction(int, const sigaction_t *, sigaction_t *)
65+
int sigemptyset(sigset_t *)
5266

5367
cdef extern from 'sys/shm.h':
5468
unsigned char *shmat(int shmid, void *shmaddr, int shmflg)

0 commit comments

Comments
 (0)