shithub: scc

ref: f55a034c33fd1a5b6b35f78abeef23741cb6f65f
dir: /src/libc/arch/posix/signal.c/

View raw version
#include <stddef.h>
#include <signal.h>
#include <sys.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;
}