BarryServer : Git

All the code for all my projects
// BarryServer : Git / OrionLibC / blob / ad9b6af63f1fdfcf3556c9b2fc670f72cdc60ab4 / signal / signal.c

// Related

OrionLibC

Barry Updating libc for pipes and signals ad9b6af (2 years, 2 months ago)
#include <sys/syscall.h>
#include <signal.h>
#include <errno.h>

/* Send a signal to a process */
sighandler_t
signal(int signum, sighandler_t handler)
{
	sighandler_t ret;
	asm volatile("int $0x80" : "=a" (ret) : "0" (SYSCALL_SIGNAL),
	             "c" (2), "S" (&signum));
	if ((int) ret >= 0)
		return ret;
	errno = -((int) ret);
	return SIG_ERR;
}