FreeBSD/sys/compat/cloudabi64/cloudabi64_poll.c
/* Converts a FreeBSD signal number to a CloudABI signal number. */
Converts a FreeBSD signal number to a CloudABI signal number.
Converts a FreeBSD signal number to a CloudABI signal number .
static cloudabi_signal_t
convert_signal(int sig)
{
	static const cloudabi_signal_t signals[] = {
		[SIGABRT]	= CLOUDABI_SIGABRT,
		[SIGALRM]	= CLOUDABI_SIGALRM,
		[SIGBUS]	= CLOUDABI_SIGBUS,
		[SIGCHLD]	= CLOUDABI_SIGCHLD,
		[SIGCONT]	= CLOUDABI_SIGCONT,
		[SIGFPE]	= CLOUDABI_SIGFPE,
		[SIGHUP]	= CLOUDABI_SIGHUP,
		[SIGILL]	= CLOUDABI_SIGILL,
		[SIGINT]	= CLOUDABI_SIGINT,
		[SIGKILL]	= CLOUDABI_SIGKILL,
		[SIGPIPE]	= CLOUDABI_SIGPIPE,
		[SIGQUIT]	= CLOUDABI_SIGQUIT,
		[SIGSEGV]	= CLOUDABI_SIGSEGV,
		[SIGSTOP]	= CLOUDABI_SIGSTOP,
		[SIGSYS]	= CLOUDABI_SIGSYS,
		[SIGTERM]	= CLOUDABI_SIGTERM,
		[SIGTRAP]	= CLOUDABI_SIGTRAP,
		[SIGTSTP]	= CLOUDABI_SIGTSTP,
		[SIGTTIN]	= CLOUDABI_SIGTTIN,
		[SIGTTOU]	= CLOUDABI_SIGTTOU,
		[SIGURG]	= CLOUDABI_SIGURG,
		[SIGUSR1]	= CLOUDABI_SIGUSR1,
		[SIGUSR2]	= CLOUDABI_SIGUSR2,
		[SIGVTALRM]	= CLOUDABI_SIGVTALRM,
		[SIGXCPU]	= CLOUDABI_SIGXCPU,
		[SIGXFSZ]	= CLOUDABI_SIGXFSZ,
	};
	if (sig < 0 || sig >= nitems(signals) || signals[sig] == 0)
		return (SIGABRT);
	return (signals[sig]);
}
static cloudabi_signal_t convert_signal ( int sig ) { static const cloudabi_signal_t signals [ ] = { [ SIGABRT ] = CLOUDABI_SIGABRT , [ SIGALRM ] = CLOUDABI_SIGALRM , [ SIGBUS ] = CLOUDABI_SIGBUS , [ SIGCHLD ] = CLOUDABI_SIGCHLD , [ SIGCONT ] = CLOUDABI_SIGCONT , [ SIGFPE ] = CLOUDABI_SIGFPE , [ SIGHUP ] = CLOUDABI_SIGHUP , [ SIGILL ] = CLOUDABI_SIGILL , [ SIGINT ] = CLOUDABI_SIGINT , [ SIGKILL ] = CLOUDABI_SIGKILL , [ SIGPIPE ] = CLOUDABI_SIGPIPE , [ SIGQUIT ] = CLOUDABI_SIGQUIT , [ SIGSEGV ] = CLOUDABI_SIGSEGV , [ SIGSTOP ] = CLOUDABI_SIGSTOP , [ SIGSYS ] = CLOUDABI_SIGSYS , [ SIGTERM ] = CLOUDABI_SIGTERM , [ SIGTRAP ] = CLOUDABI_SIGTRAP , [ SIGTSTP ] = CLOUDABI_SIGTSTP , [ SIGTTIN ] = CLOUDABI_SIGTTIN , [ SIGTTOU ] = CLOUDABI_SIGTTOU , [ SIGURG ] = CLOUDABI_SIGURG , [ SIGUSR1 ] = CLOUDABI_SIGUSR1 , [ SIGUSR2 ] = CLOUDABI_SIGUSR2 , [ SIGVTALRM ] = CLOUDABI_SIGVTALRM , [ SIGXCPU ] = CLOUDABI_SIGXCPU , [ SIGXFSZ ] = CLOUDABI_SIGXFSZ , } ; if ( sig < 0 || sig >= nitems ( signals ) || signals [ sig ] == 0 ) return ( SIGABRT ) ; return ( signals [ sig ] ) ; }
Converts a FreeBSD signal number to a CloudABI signal number.
Converts a FreeBSD signal number to a CloudABI signal number .
/* Convert unknown signals to SIGABRT. */