From: Jorrit Herder Date: Tue, 26 Jul 2005 12:49:35 +0000 (+0000) Subject: Updated F4 dump at IS to include send masks. X-Git-Tag: v3.1.0~544 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.named-checkzone.html?a=commitdiff_plain;h=3d0b9140f2a4d6d6678b0d39e1e7999c7e361709;p=minix.git Updated F4 dump at IS to include send masks. Removed unused constant from fproc.h Changed signal behaviour at PM (work in progress) --- diff --git a/servers/Makefile b/servers/Makefile index 45598b4fb..fadeba6a8 100644 --- a/servers/Makefile +++ b/servers/Makefile @@ -16,6 +16,7 @@ build: all all install depend clean: cd ./pm && $(MAKE) $@ cd ./fs && $(MAKE) $@ + cd ./sm && $(MAKE) $@ cd ./is && $(MAKE) $@ cd ./init && $(MAKE) $@ cd ./inet && $(MAKE) $@ diff --git a/servers/fs/fproc.h b/servers/fs/fproc.h index 1751eb3eb..7747aa35b 100644 --- a/servers/fs/fproc.h +++ b/servers/fs/fproc.h @@ -30,7 +30,6 @@ EXTERN struct fproc { #define NOT_REVIVING 0 /* process is not being revived */ #define REVIVING 1 /* process is being revived from suspension */ #define PID_FREE 0 /* process slot free */ -#define PID_SERVER (-1) /* process has become a server */ /* Check is process number is acceptable - includes system processes. */ #define isokprocnr(n) ((unsigned)((n)+NR_TASKS) < NR_PROCS + NR_TASKS) diff --git a/servers/fs/misc.c b/servers/fs/misc.c index 78a209918..b34027880 100644 --- a/servers/fs/misc.c +++ b/servers/fs/misc.c @@ -369,7 +369,7 @@ PUBLIC int do_exit() } } - /* Truly exiting, or becoming a server? */ + /* Mark slot as free. */ fp->fp_pid = PID_FREE; return(OK); } diff --git a/servers/is/dmp_kernel.c b/servers/is/dmp_kernel.c index bd7ead419..82692d3ca 100644 --- a/servers/is/dmp_kernel.c +++ b/servers/is/dmp_kernel.c @@ -310,6 +310,7 @@ PUBLIC void privileges_dmp() register struct proc *rp; static struct proc *oldrp = BEG_PROC_ADDR; register struct priv *sp; + static char send_mask[NR_SYS_PROCS + 1 + NR_SYS_PROCS/8]; int r, i,j, n = 0; /* First obtain a fresh copy of the current process and system table. */ @@ -322,7 +323,7 @@ PUBLIC void privileges_dmp() return; } - printf("\n--nr-id-name--- -flags- -sc-\n"); + printf("\n--nr-id-name--- -flags- -sc- -send mask-\n"); for (rp = oldrp; rp < END_PROC_ADDR; rp++) { if (isemptyp(rp)) continue; @@ -336,11 +337,17 @@ PUBLIC void privileges_dmp() if (r == -1 && ! (rp->p_rts_flags & SLOT_FREE)) { sp = &priv[USER_PRIV_ID]; } - printf("(%02u) %-7.7s 0x%02x %02.2u", + printf("(%02u) %-7.7s 0x%02x %02.2u ", sp->s_id, rp->p_name, sp->s_flags, sp->s_call_mask ); - printf("\n"); + for (i=j=0; i < NR_SYS_PROCS; i++, j++) { + send_mask[j] = get_sys_bit(sp->s_send_mask, i) ? '1' : '0'; + if (i % 8 == 7) send_mask[++j] = ' '; + } + send_mask[j] = '\0'; + + printf(" %s \n", send_mask); } if (rp == END_PROC_ADDR) rp = BEG_PROC_ADDR; else printf("--more--\r"); oldrp = rp; diff --git a/servers/is/is.c b/servers/is/is.c index 052564522..a57c4784d 100644 --- a/servers/is/is.c +++ b/servers/is/is.c @@ -51,6 +51,7 @@ PUBLIC void main(void) case SYS_EVENT: sigset = (sigset_t) m_in.NOTIFY_ARG; if (sigismember(&sigset, SIGTERM)) { + exit(3); /* nothing to do on shutdown */ } if (sigismember(&sigset, SIGKSTOP)) { diff --git a/servers/pm/forkexit.c b/servers/pm/forkexit.c index 43976542e..a8c9713a0 100644 --- a/servers/pm/forkexit.c +++ b/servers/pm/forkexit.c @@ -137,7 +137,6 @@ int exit_status; /* the process' exit status (for parent) */ clock_t t[5]; proc_nr = (int) (rmp - mproc); /* get process slot number */ - DEBUG(proc_nr == PRINTER, printf("PM: printer about to die ...\n")); /* Remember a session leader's process group. */ procgrp = (rmp->mp_pid == mp->mp_procgrp) ? mp->mp_procgrp : 0; @@ -152,7 +151,6 @@ int exit_status; /* the process' exit status (for parent) */ p_mp->mp_child_stime += t[1] + rmp->mp_child_stime; /* add system time */ /* Tell the kernel and FS that the process is no longer runnable. */ - DEBUG(proc_nr == PRINTER, printf("PM: telling FS and kernel about xit...\n")); tell_fs(EXIT, proc_nr, 0, 0); /* file system can free the proc slot */ sys_exit(proc_nr); @@ -173,16 +171,12 @@ int exit_status; /* the process' exit status (for parent) */ pidarg = p_mp->mp_wpid; /* who's being waited for? */ parent_waiting = p_mp->mp_flags & WAITING; - DEBUG(proc_nr == PRINTER, printf("PM: parent waiting %d, for %d...\n", parent_waiting, pidarg)); - right_child = /* child meets one of the 3 tests? */ (pidarg == -1 || pidarg == rmp->mp_pid || -pidarg == rmp->mp_procgrp); if (parent_waiting && right_child) { - DEBUG(proc_nr == PRINTER, printf("PM: parent waiting, release slot...\n")); cleanup(rmp); /* tell parent and release child slot */ } else { - DEBUG(proc_nr == PRINTER, printf("PM: parent not waiting, zombify ...\n")); rmp->mp_flags = IN_USE|ZOMBIE; /* parent not waiting, zombify child */ sig_proc(p_mp, SIGCHLD); /* send parent a "child died" signal */ } diff --git a/servers/pm/main.c b/servers/pm/main.c index 17696a668..3b591488e 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -200,14 +200,14 @@ PRIVATE void pm_init() rmp->mp_pid = INIT_PID; rmp->mp_parent = PM_PROC_NR; rmp->mp_flags |= IN_USE; - sigemptyset(&rmp->mp_ignore); rmp->mp_nice = 0; + sigemptyset(&rmp->mp_ignore); } else { /* system process */ rmp->mp_pid = get_free_pid(); - rmp->mp_parent = INIT_PROC_NR; + rmp->mp_parent = SM_PROC_NR; rmp->mp_flags |= IN_USE | DONT_SWAP | PRIV_PROC; - sigfillset(&rmp->mp_ignore); + sigfillset(&rmp->mp_ignore); } sigemptyset(&rmp->mp_sigmask); sigemptyset(&rmp->mp_catch); @@ -230,8 +230,10 @@ PRIVATE void pm_init() } /* PM is somewhat special. Override some details. */ - mproc[PM_PROC_NR].mp_pid = PM_PID; - mproc[PM_PROC_NR].mp_parent = PM_PROC_NR; + sigfillset(&mproc[PM_PROC_NR].mp_ignore); /* guard against signals */ + mproc[PM_PROC_NR].mp_pid = PM_PID; /* magically override pid */ + mproc[PM_PROC_NR].mp_parent = PM_PROC_NR; /* PM doesn't have parent */ + /* Tell FS that no more system processes follow and synchronize. */ mess.PR_PROC_NR = NONE; diff --git a/servers/pm/signal.c b/servers/pm/signal.c index 18b3cef2c..10cafe830 100644 --- a/servers/pm/signal.c +++ b/servers/pm/signal.c @@ -405,7 +405,7 @@ int signo; /* signal to send to process (1 to _NSIG) */ slot = (int) (rmp - mproc); if ((rmp->mp_flags & (IN_USE | ZOMBIE)) != IN_USE) { printf("PM: signal %d sent to %s process %d\n", - (rmp->mp_flags & ZOMBIE) ? "zombie" : "dead", signo, slot); + signo, (rmp->mp_flags & ZOMBIE) ? "zombie" : "dead", slot); panic(__FILE__,"", NO_NUM); } if ((rmp->mp_flags & TRACED) && signo != SIGKILL) {