/* This function will examines, changes, or examines and changes the signal mask of the calling thread. 
SIG_SETMASK The set of blocked signals is set to the argument set. */
int sigprocmask(int how, const sigset_t *set, sigset_t *oset)
/* This function will examines, changes, or examines and changes the signal mask of the calling thread. 
SIG_SETMASK The set of blocked signals is set to the argument set. */
int sigprocmask(int how, const sigset_t *set, sigset_t *oset)
{
    rt_base_t level;
    rt_thread_t tid;
    tid = rt_thread_self();
    level = rt_hw_interrupt_disable();
    if (oset) *oset = tid->sig_mask;
    if (set)
    {
        switch(how)
        {
        case SIG_BLOCK:
            tid->sig_mask |= *set;
            break;
        case SIG_UNBLOCK:
            tid->sig_mask &= ~*set;
            break;
        case SIG_SETMASK:
            tid->sig_mask =  *set;
            break;
        default:
            break;
        }
    }
    rt_hw_interrupt_enable(level);
    return 0;
}