ref: 57a4ce1ffd76c45dcf107415a5ee4ea33ed54c66
dir: /lib/c/target/posix/signal.c/
#include <stddef.h> #include <signal.h> #include <sys.h> #include "../../syscall.h" #undef signal void (*signal(int signum, void (*func)(int)))(int) { struct sigaction sa = { .sa_handler = func, }; if (_sigaction(signum, &sa, &sa) < 0) return SIG_ERR; return sa.sa_handler; }