X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/eb251af8672e033f29322253f136e09c76f2b0a3..bc34fd00d2e81fbc890bb2060ed6693454a230bf:/lunaix-os/kernel/signal.c diff --git a/lunaix-os/kernel/signal.c b/lunaix-os/kernel/signal.c index cb47e8d..5f0c868 100644 --- a/lunaix-os/kernel/signal.c +++ b/lunaix-os/kernel/signal.c @@ -99,7 +99,7 @@ int signal_send(pid_t pid, int signum) { if (signum < 0 || signum >= _SIG_NUM) { - __current->k_status = LXINVL; + __current->k_status = EINVAL; return -1; } @@ -116,7 +116,7 @@ signal_send(pid_t pid, int signum) } else { // TODO: send to all process. // But I don't want to support it yet. - __current->k_status = LXINVL; + __current->k_status = EINVAL; return -1; } @@ -130,7 +130,7 @@ send_grp: send_single: if (PROC_TERMINATED(proc->state)) { - __current->k_status = LXINVL; + __current->k_status = EINVAL; return -1; } __SIGSET(proc->sig_pending, signum); @@ -188,11 +188,10 @@ __do_pause() { __current->flags |= PROC_FINPAUSE; - __SYSCALL_INTERRUPTIBLE({ - while ((__current->flags & PROC_FINPAUSE)) { - sched_yield(); - } - }) + while ((__current->flags & PROC_FINPAUSE)) { + sched_yieldk(); + } + __current->k_status = EINTR; }