blob: 9c497605ec6df958f373826c861bba3c21b2395c (
plain) (
tree)
|
|
/* See LICENSE file for copyright and license details. */
#include "common.h"
#include "generated/signals.c"
enum libsyscalls_error
libsyscalls_get_signals(enum libsyscalls_os os, enum libsyscalls_arch arch,
const struct libsyscalls_named_number **signals_out, size_t *num_signals_out)
{
const struct libsyscalls_named_number *discard_signals;
size_t discard_num_signals;
if (!signals_out) signals_out = &discard_signals;
if (!num_signals_out) num_signals_out = &discard_num_signals;
#define CASE(UPPERCASE, LOWERCASE)\
case LIBSYSCALLS_OS_##UPPERCASE:\
return get_##LOWERCASE##_signals(arch, signals_out, num_signals_out)
switch ((int)os) {
LIST_OSES(CASE, ;);
/* if OS is known but does not have named numerical signal,
* get_##LOWERCASE##_signals shall return LIBSYSCALLS_E_NOSIGNALS */
default:
return LIBSYSCALLS_E_OSNOSUP;
}
#undef CASE
}
|