/* This function will install or confirm action for specified signal.  */
int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
/* This function will install or confirm action for specified signal.  */
int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
{
    rt_sighandler_t old = RT_NULL;
    if (!sig_valid(signum)) return -RT_ERROR;
    if (act)
        old = rt_signal_install(signum, act->sa_handler);
    else
    {
        old = rt_signal_install(signum, RT_NULL);
        rt_signal_install(signum, old);
    }
    if (oldact)
        oldact->sa_handler = old;
    return 0;
}