From: Cristiano Giuffrida Date: Wed, 31 Mar 2010 08:55:12 +0000 (+0000) Subject: Move kernel signal SIGKNDELAY to system signal SIGSNDELAY and fix broken ptrace. X-Git-Tag: v3.1.7~187 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=d8b42a755d3359c993f356b14dab95e33277c30e;p=minix.git Move kernel signal SIGKNDELAY to system signal SIGSNDELAY and fix broken ptrace. --- diff --git a/include/signal.h b/include/signal.h index eed41180f..c4976ee80 100644 --- a/include/signal.h +++ b/include/signal.h @@ -67,15 +67,22 @@ typedef unsigned long sigset_t; * The order here determines the order signals are processed by system * processes in user-space. Higher-priority signals should be first. */ -#define SIGKPF 26 /* kernel page fault request pending */ -#define SIGKMEM 27 /* kernel memory request pending */ -#define SIGKMESS 28 /* new kernel message */ -#define SIGKSIGSM 29 /* kernel signal pending for signal manager */ -#define SIGKSIG 30 /* kernel signal pending */ -#define SIGKNDELAY 31 /* end of delay for signal delivery */ +/* Signals delivered by a signal manager. */ +#define SIGSNDELAY 26 /* end of delay for signal delivery */ + +#define SIGS_FIRST SIGHUP /* first system signal */ +#define SIGS_LAST SIGSNDELAY /* last system signal */ +#define IS_SIGS(signo) (signo>=SIGS_FIRST && signo<=SIGS_LAST) + +/* Signals delivered by the kernel. */ +#define SIGKPF 27 /* kernel page fault request pending */ +#define SIGKMEM 28 /* kernel memory request pending */ +#define SIGKMESS 29 /* new kernel message */ +#define SIGKSIGSM 30 /* kernel signal pending for signal manager */ +#define SIGKSIG 31 /* kernel signal pending */ #define SIGK_FIRST SIGKPF /* first kernel signal */ -#define SIGK_LAST SIGKNDELAY /* last kernel signal */ +#define SIGK_LAST SIGKSIG /* last kernel signal */ #define IS_SIGK(signo) (signo>=SIGK_FIRST && signo<=SIGK_LAST) /* Termination signals for Minix system processes. */ diff --git a/kernel/system.c b/kernel/system.c index 8c20dc469..e0344bd75 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -401,7 +401,7 @@ PUBLIC void sig_delay_done(struct proc *rp) rp->p_misc_flags &= ~MF_SIG_DELAY; - cause_sig(proc_nr(rp), SIGKNDELAY); + cause_sig(proc_nr(rp), SIGSNDELAY); } #if _MINIX_CHIP == _CHIP_INTEL diff --git a/kernel/system/do_runctl.c b/kernel/system/do_runctl.c index fb0a70558..e1da8b5d8 100644 --- a/kernel/system/do_runctl.c +++ b/kernel/system/do_runctl.c @@ -19,7 +19,7 @@ PUBLIC int do_runctl(struct proc * caller, message * m_ptr) /* Control a process's RTS_PROC_STOP flag. Used for process management. * If the process is queued sending a message or stopped for system call * tracing, and the RC_DELAY request flag is given, set MF_SIG_DELAY instead - * of RTS_PROC_STOP, and send a SIGKNDELAY signal later when the process is done + * of RTS_PROC_STOP, and send a SIGSNDELAY signal later when the process is done * sending (ending the delay). Used by PM for safe signal delivery. */ int proc_nr, action, flags, delayed; diff --git a/lib/libsys/sef_signal.c b/lib/libsys/sef_signal.c index 9d88938d9..76a23d907 100644 --- a/lib/libsys/sef_signal.c +++ b/lib/libsys/sef_signal.c @@ -42,7 +42,7 @@ PRIVATE void process_sigmgr_signals(void) } else { /* Process every signal in the signal set. */ r = OK; - for(signo = 1; signo < _NSIG; signo++) { + for (signo = SIGS_FIRST; signo <= SIGS_LAST; signo++) { if(sigismember(&sigset, signo)) { /* Let the callback code process the signal. */ r = sef_cbs.sef_cb_signal_manager(target, signo); @@ -70,7 +70,7 @@ PRIVATE void process_sigmgr_self_signals(sigset_t sigset) /* A signal manager has pending signals for itself. Process them. */ int signo; - for(signo = 1; signo < _NSIG; signo++) { + for (signo = SIGS_FIRST; signo <= SIGS_LAST; signo++) { if(sigismember(&sigset, signo)) { /* Let the callback code process the signal. */ sef_cbs.sef_cb_signal_handler(signo); diff --git a/servers/pm/signal.c b/servers/pm/signal.c index 125566436..84b0cafe5 100644 --- a/servers/pm/signal.c +++ b/servers/pm/signal.c @@ -256,14 +256,14 @@ int signo; } check_sig(id, signo, TRUE /* ksig */); - /* If SIGKNDELAY is set, an earlier sys_stop() failed because the process was + /* If SIGSNDELAY is set, an earlier sys_stop() failed because the process was * still sending, and the kernel hereby tells us that the process is now done * with that. We can now try to resume what we planned to do in the first * place: set up a signal handler. However, the process's message may have * been a call to PM, in which case the process may have changed any of its * signal settings. The process may also have forked, exited etcetera. */ - if (signo == SIGKNDELAY && (rmp->mp_flags & DELAY_CALL)) { + if (signo == SIGSNDELAY && (rmp->mp_flags & DELAY_CALL)) { rmp->mp_flags &= ~DELAY_CALL; if (rmp->mp_flags & (FS_CALL | PM_SIG_PENDING)) @@ -639,7 +639,7 @@ struct mproc *rmp; /* which process */ r = sys_delay_stop(rmp->mp_endpoint); /* If the process is still busy sending a message, the kernel will give - * us EBUSY now and send a SIGKNDELAY to the process as soon as sending + * us EBUSY now and send a SIGSNDELAY to the process as soon as sending * is done. */ if (r == EBUSY) {