Subject: sigaction(2), sigsetops(3), and more missing in 2.11BSD (#388 - 4 of 4) Index: sys/kern_sig.c,libc/pdp/sys,... 2.11BSD Description: Sigaction(2), sigsetops(3) (sigaddset, sigdelset, ...), sigsuspend(2), sigpending(2), sigprocmask(2), ... are missing from 2.11BSD A couple programs were incorrectly specifying a 16bit mask to sigblock(2). creat(2), gethostid(2), sethostid(2) are system calls which duplicate newer means of accomplishing the same actions. The kernel still had a reference to 'gldav', a system call which was obsoleted a long time ago and which nothing in the system uses. Repeat-By: 1) Attempt to compile and run a program which contains any or all of the following: sigemptyset(&sigt); sigaddset(&sigt, SIGALRM); sigdelset(&sigt, SIGINT); sigaction(SIGALRM, &set, &oset); sigpending(&sigt); sigsuspend(&sigt); sigaltstack(&ss, &oss); less(1), sail(6) and hunt(6) used "sigblock(0)" instead of "sigblock(0L)". "open(name, O_CREAT|O_TRUNC|O_WRONLY, mode)" has been the correct way to create a file for some time now. Sysctl(2) can set and get the hostid. Thus there is no need for 3 extra system calls (creat, sethostid, gethostid). gldav(2) has been gone for a long time - it is time for the last vestiges in the kernel to go away also. 2) Observation. ;) Fix: This is update #388 and is part 4 of 4. Make sure you have parts 1, 2, and 3 (updates 385, 386 and 387) before beginning to install anything. This (#388) portion of the kit contains the second (of two) patch files. NOTE: Be certain to read the directions in part 1 (#385) about what must be done before applying the patches below -------------------------------cut here------------------------------------ *** /usr/src/sys/sys/kern_sig.c.old Sat Jan 18 22:57:29 1997 --- /usr/src/sys/sys/kern_sig.c Fri Sep 12 20:19:59 1997 *************** *** 3,14 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)kern_sig.c 1.7 (2.11BSD GTE) 1997/1/18 */ #include "param.h" #include "../machine/seg.h" - #include "systm.h" #include "user.h" #include "inode.h" --- 3,13 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)kern_sig.c 1.8 (2.11BSD GTE) 1997/8/29 */ #include "param.h" #include "../machine/seg.h" #include "systm.h" #include "user.h" #include "inode.h" *************** *** 16,35 **** #include "text.h" #include "namei.h" #include "acct.h" - #define cantmask (sigmask(SIGKILL)|sigmask(SIGCONT)|sigmask(SIGSTOP)) - #define stopsigmask (sigmask(SIGSTOP)|sigmask(SIGTSTP)| \ - sigmask(SIGTTIN)|sigmask(SIGTTOU)) - /* ! * Generalized interface signal handler. */ sigvec() { register struct a { - #ifdef pdp11 int (*sigtramp)(); - #endif pdp11 int signo; struct sigvec *nsv; struct sigvec *osv; --- 15,30 ---- #include "text.h" #include "namei.h" #include "acct.h" + #include "signalvar.h" + extern char sigprop[]; /* XXX - defined in kern_sig2.c */ /* ! * 4.3 Compatibility */ sigvec() { register struct a { int (*sigtramp)(); int signo; struct sigvec *nsv; struct sigvec *osv; *************** *** 37,55 **** struct sigvec vec; register struct sigvec *sv; register int sig; long bit; - #ifdef pdp11 /* * Save user trampoline code entry address. */ u.u_pcb.pcb_sigc = uap->sigtramp; ! #endif pdp11 ! sig = uap->signo; if (sig <= 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP) { ! u.u_error = EINVAL; ! return; } sv = &vec; if (uap->osv) { --- 32,50 ---- struct sigvec vec; register struct sigvec *sv; register int sig; + struct proc *p; long bit; + int error = 0; /* * Save user trampoline code entry address. */ u.u_pcb.pcb_sigc = uap->sigtramp; ! p = u.u_procp; sig = uap->signo; if (sig <= 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP) { ! error = EINVAL; ! goto out; } sv = &vec; if (uap->osv) { *************** *** 61,124 **** sv->sv_flags |= SV_ONSTACK; if ((u.u_sigintr & bit) != 0) sv->sv_flags |= SV_INTERRUPT; ! u.u_error = ! copyout((caddr_t)sv, (caddr_t)uap->osv, sizeof (vec)); ! if (u.u_error) ! return; } if (uap->nsv) { ! u.u_error = ! copyin((caddr_t)uap->nsv, (caddr_t)sv, sizeof (vec)); ! if (u.u_error) ! return; if (sig == SIGCONT && sv->sv_handler == SIG_IGN) { ! u.u_error = EINVAL; ! return; } ! setsigvec(sig, sv); } } ! setsigvec(sig, sv) ! int sig; ! register struct sigvec *sv; ! { ! register struct proc *p; ! register long bit; ! ! bit = sigmask(sig); ! p = u.u_procp; ! /* ! * Change setting atomically. ! */ ! (void) _splhigh(); ! u.u_signal[sig] = sv->sv_handler; ! u.u_sigmask[sig] = sv->sv_mask &~ cantmask; ! if (sv->sv_flags & SV_INTERRUPT) ! u.u_sigintr |= bit; ! else ! u.u_sigintr &= ~bit; ! if (sv->sv_flags & SV_ONSTACK) ! u.u_sigonstack |= bit; ! else ! u.u_sigonstack &= ~bit; ! if (sv->sv_handler == SIG_IGN) { ! p->p_sig &= ~bit; /* never to be seen again */ ! p->p_sigignore |= bit; ! p->p_sigcatch &= ~bit; ! } else { ! p->p_sigignore &= ~bit; ! if (sv->sv_handler == SIG_DFL) ! p->p_sigcatch &= ~bit; ! else ! p->p_sigcatch |= bit; ! } ! (void) _spl0(); ! } ! sigblock() { ! struct a { long mask; } *uap = (struct a *)u.u_ap; register struct proc *p = u.u_procp; --- 56,88 ---- sv->sv_flags |= SV_ONSTACK; if ((u.u_sigintr & bit) != 0) sv->sv_flags |= SV_INTERRUPT; ! if (p->p_flag & P_NOCLDSTOP) ! sv->sv_flags |= SA_NOCLDSTOP; ! error = copyout((caddr_t)sv, (caddr_t)uap->osv, sizeof (vec)); ! if (error) ! goto out; } if (uap->nsv) { ! error = copyin((caddr_t)uap->nsv, (caddr_t)sv, sizeof (vec)); ! if (error) ! goto out; if (sig == SIGCONT && sv->sv_handler == SIG_IGN) { ! error = EINVAL; ! goto out; } ! sv->sv_flags ^= SA_RESTART; /* opposite of SV_INTERRUPT */ ! setsigvec(sig, (struct sigaction *)sv); } + out: + return(u.u_error = error); } ! /* ! * 4.3 Compatibility ! */ sigblock() { ! register struct a { long mask; } *uap = (struct a *)u.u_ap; register struct proc *p = u.u_procp; *************** *** 125,137 **** (void) _splhigh(); u.u_r.r_long = p->p_sigmask; ! p->p_sigmask |= uap->mask &~ cantmask; (void) _spl0(); } sigsetmask() { ! struct a { long mask; } *uap = (struct a *)u.u_ap; register struct proc *p = u.u_procp; --- 89,105 ---- (void) _splhigh(); u.u_r.r_long = p->p_sigmask; ! p->p_sigmask |= uap->mask &~ sigcantmask; (void) _spl0(); + return(0); } + /* + * 4.3 Compatibility + */ sigsetmask() { ! register struct a { long mask; } *uap = (struct a *)u.u_ap; register struct proc *p = u.u_procp; *************** *** 138,147 **** (void) _splhigh(); u.u_r.r_long = p->p_sigmask; ! p->p_sigmask = uap->mask &~ cantmask; (void) _spl0(); } sigpause() { struct a { --- 106,119 ---- (void) _splhigh(); u.u_r.r_long = p->p_sigmask; ! p->p_sigmask = uap->mask &~ sigcantmask; (void) _spl0(); + return(0); } + /* + * 4.3 Compatibility + */ sigpause() { struct a { *************** *** 154,191 **** * the old mask to be restored after the * signal handler has finished. Thus, we * save it here and mark the proc structure ! * to indicate this (should be in u.). */ u.u_oldmask = p->p_sigmask; ! p->p_flag |= SOMASK; ! p->p_sigmask = uap->mask &~ cantmask; for (;;) sleep((caddr_t)&u, PSLEP); /*NOTREACHED*/ } - #undef cantmask sigstack() ! { ! register struct a { struct sigstack *nss; struct sigstack *oss; ! } *uap = (struct a *)u.u_ap; struct sigstack ss; ! if (uap->oss) { ! u.u_error = copyout((caddr_t)&u.u_sigstack, (caddr_t)uap->oss, ! sizeof (struct sigstack)); ! if (u.u_error) ! return; } - if (uap->nss) { - u.u_error = - copyin((caddr_t)uap->nss, (caddr_t)&ss, sizeof (ss)); - if (u.u_error == 0) - u.u_sigstack = ss; - } - } kill() { --- 126,170 ---- * the old mask to be restored after the * signal handler has finished. Thus, we * save it here and mark the proc structure ! * to indicate this. */ u.u_oldmask = p->p_sigmask; ! u.u_psflags |= SAS_OLDMASK; ! p->p_sigmask = uap->mask &~ sigcantmask; for (;;) sleep((caddr_t)&u, PSLEP); /*NOTREACHED*/ } + /* + * 4.3 Compatibility + */ sigstack() ! { ! register struct a ! { struct sigstack *nss; struct sigstack *oss; ! } *uap = (struct a *)u.u_ap; struct sigstack ss; + register int error = 0; ! ss.ss_sp = u.u_sigstk.ss_base; ! ss.ss_onstack = u.u_sigstk.ss_flags & SA_ONSTACK; ! if (uap->oss && (error = copyout((caddr_t)&ss, ! (caddr_t)uap->oss, sizeof (ss)))) ! goto out; ! if (uap->nss && (error = copyin((caddr_t)uap->nss, (caddr_t)&ss, ! sizeof (ss))) == 0) ! { ! u.u_sigstk.ss_base = ss.ss_sp; ! u.u_sigstk.ss_size = 0; ! u.u_sigstk.ss_flags |= (ss.ss_onstack & SA_ONSTACK); ! u.u_psflags |= SAS_ALTSTACK; ! } ! out: ! return(u.u_error = error); } kill() { *************** *** 194,201 **** int signo; } *uap = (struct a *)u.u_ap; register struct proc *p; - #ifdef pdp11 /* * BSD4.3 botches the comparison against NSIG - it's a good thing for * them psignal catches the error - however, since psignal is the --- 173,180 ---- int signo; } *uap = (struct a *)u.u_ap; register struct proc *p; + register int error = 0; /* * BSD4.3 botches the comparison against NSIG - it's a good thing for * them psignal catches the error - however, since psignal is the *************** *** 203,253 **** * parameters from the rest of the kernel, psignal shouldn't *have* * to check it's parameters for validity. If you feel differently, * feel free to clutter up the entire inner kernel with parameter ! * checks - start with psig ... */ if (uap->signo < 0 || uap->signo >= NSIG) { ! #else ! if (uap->signo < 0 || uap->signo > NSIG) { ! #endif ! u.u_error = EINVAL; ! return; } if (uap->pid > 0) { /* kill single process */ p = pfind(uap->pid); if (p == 0) { ! u.u_error = ESRCH; ! return; } - #ifdef pdp11 /* * Fix to allow a non-root process to send SIGCONT to * one of its own decendants which happens to be running ! * with a different uid. (second line of if) "#else" clause ! * contains original 4.3 code. */ if (u.u_uid && u.u_uid != p->p_uid && (uap->signo != SIGCONT || !inferior(p))) ! #else ! if (u.u_uid && u.u_uid != p->p_uid) ! #endif ! u.u_error = EPERM; else if (uap->signo) psignal(p, uap->signo); ! return; } switch (uap->pid) { case -1: /* broadcast signal */ ! u.u_error = killpg1(uap->signo, 0, 1); break; case 0: /* signal own process group */ ! u.u_error = killpg1(uap->signo, 0, 0); break; default: /* negative explicit process group */ ! u.u_error = killpg1(uap->signo, -uap->pid, 0); break; } ! return; } killpg() --- 182,225 ---- * parameters from the rest of the kernel, psignal shouldn't *have* * to check it's parameters for validity. If you feel differently, * feel free to clutter up the entire inner kernel with parameter ! * checks - start with postsig ... */ if (uap->signo < 0 || uap->signo >= NSIG) { ! error = EINVAL; ! goto out; } if (uap->pid > 0) { /* kill single process */ p = pfind(uap->pid); if (p == 0) { ! error = ESRCH; ! goto out; } /* * Fix to allow a non-root process to send SIGCONT to * one of its own decendants which happens to be running ! * with a different uid. */ if (u.u_uid && u.u_uid != p->p_uid && (uap->signo != SIGCONT || !inferior(p))) ! error = EPERM; else if (uap->signo) psignal(p, uap->signo); ! goto out; } switch (uap->pid) { case -1: /* broadcast signal */ ! error = killpg1(uap->signo, 0, 1); break; case 0: /* signal own process group */ ! error = killpg1(uap->signo, 0, 0); break; default: /* negative explicit process group */ ! error = killpg1(uap->signo, -uap->pid, 0); break; } ! out: ! return(u.u_error = error); } killpg() *************** *** 256,276 **** int pgrp; int signo; } *uap = (struct a *)u.u_ap; - #ifdef pdp11 - /* see comment in kill above */ if (uap->signo < 0 || uap->signo >= NSIG) { ! #else ! if (uap->signo < 0 || uap->signo > NSIG) { ! #endif ! u.u_error = EINVAL; ! return; } ! u.u_error = killpg1(uap->signo, uap->pgrp, 0); } - /* KILL CODE SHOULDNT KNOW ABOUT PROCESS INTERNALS !?! */ - killpg1(signo, pgrp, all) int signo, pgrp, all; { --- 228,244 ---- int pgrp; int signo; } *uap = (struct a *)u.u_ap; + register int error = 0; if (uap->signo < 0 || uap->signo >= NSIG) { ! error = EINVAL; ! goto out; } ! error = killpg1(uap->signo, uap->pgrp, 0); ! out: ! return(u.u_error = error); } killpg1(signo, pgrp, all) int signo, pgrp, all; { *************** *** 332,346 **** register int sig; { register int s; ! register int (*action)(); long mask; - #ifdef DIAGNOSTIC - /* see comment in kill above */ - if ((unsigned)sig >= NSIG) - return; - #endif mask = sigmask(sig); /* * If proc is traced, always give parent a chance. --- 300,311 ---- register int sig; { register int s; ! int (*action)(); ! int prop; long mask; mask = sigmask(sig); + prop = sigprop[sig]; /* * If proc is traced, always give parent a chance. *************** *** 361,401 **** else action = SIG_DFL; } - #ifndef pdp11 - /* This is nonsense - should simply be ripped out */ - if (sig) { - #endif - p->p_sig |= mask; - switch (sig) { ! case SIGTERM: ! if ((p->p_flag&STRC) || action != SIG_DFL) ! break; ! /* fall into ... */ ! case SIGKILL: ! if (p->p_nice > NZERO) ! p->p_nice = NZERO; ! break; ! case SIGCONT: ! p->p_sig &= ~stopsigmask; ! break; ! ! case SIGSTOP: ! case SIGTSTP: ! case SIGTTIN: ! case SIGTTOU: ! p->p_sig &= ~sigmask(SIGCONT); ! break; ! } ! #ifndef pdp11 } ! #endif /* * Defer further processing for signals which are held. */ ! if (action == SIG_HOLD) return; s = splhigh(); switch (p->p_stat) { --- 326,357 ---- else action = SIG_DFL; } ! if (p->p_nice > NZERO && action == SIG_DFL && (prop & SA_KILL) && ! (p->p_flag & STRC) == 0) ! p->p_nice = NZERO; ! if (prop & SA_CONT) ! p->p_sig &= ~stopsigmask; ! if (prop & SA_STOP) { ! /* ! * If sending a tty stop signal to a member of an orphaned ! * process group (i.e. a child of init), discard the signal ! * here if the action is default; don't stop the process ! * below if sleeping, and don't clear any pending SIGCONT. ! */ ! if (prop & SA_TTYSTOP && (p->p_pptr == &proc[1]) && ! action == SIG_DFL) ! return; ! p->p_sig &= ~contsigmask; } ! p->p_sig |= mask; ! /* * Defer further processing for signals which are held. */ ! if (action == SIG_HOLD && ((prop & SA_CONT) == 0 || p->p_stat != SSTOP)) return; s = splhigh(); switch (p->p_stat) { *************** *** 416,477 **** */ if (p->p_flag&STRC) goto run; - switch (sig) { ! case SIGSTOP: ! case SIGTSTP: ! case SIGTTIN: ! case SIGTTOU: ! /* ! * These are the signals which by default ! * stop a process. ! */ if (action != SIG_DFL) goto run; /* ! * Don't clog system with children of init ! * stopped from the keyboard. */ ! if (sig != SIGSTOP && p->p_pptr == &proc[1]) { ! psignal(p, SIGKILL); ! p->p_sig &= ~mask; ! splx(s); ! return; ! } ! /* ! * If a child in vfork(), stopping could ! * cause deadlock. ! */ ! if (p->p_flag&SVFORK) goto out; p->p_sig &= ~mask; p->p_cursig = sig; ! psignal(p->p_pptr, SIGCHLD); stop(p); goto out; ! ! case SIGIO: ! case SIGURG: ! case SIGCHLD: ! case SIGWINCH: ! /* ! * These signals are special in that they ! * don't get propogated... if the process ! * isn't interested, forget it. ! */ ! if (action != SIG_DFL) ! goto run; ! p->p_sig &= ~mask; /* take it away */ ! goto out; ! ! default: ! /* ! * All other signals cause the process to run ! */ goto run; - } /*NOTREACHED*/ - case SSTOP: /* * If traced process is already stopped, --- 372,411 ---- */ if (p->p_flag&STRC) goto run; ! /* ! * If SIGCONT is default (or ignored) and process is ! * asleep, we are finished; the process should not ! * be awakened. ! */ ! if ((prop & SA_CONT) && action == SIG_DFL) { ! p->p_sig &= ~mask; ! goto out; ! } ! /* ! * When a sleeping process receives a stop ! * signal, process immediately if possible. ! * All other (caught or default) signals ! * cause the process to run. ! */ ! if (prop & SA_STOP) { if (action != SIG_DFL) goto run; /* ! * If a child holding parent blocked, ! * stopping could cause deadlock. */ ! if (p->p_flag & SVFORK) goto out; p->p_sig &= ~mask; p->p_cursig = sig; ! if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0) ! psignal(p->p_pptr, SIGCHLD); stop(p); goto out; ! } else goto run; /*NOTREACHED*/ case SSTOP: /* * If traced process is already stopped, *************** *** 479,508 **** */ if (p->p_flag&STRC) goto out; ! switch (sig) { ! ! case SIGKILL: ! /* ! * Kill signal always sets processes running. ! */ goto run; ! ! case SIGCONT: /* ! * If the process catches SIGCONT, let it handle ! * the signal itself. If it isn't waiting on * an event, then it goes back to run state. * Otherwise, process goes back to sleep state. */ ! if (action != SIG_DFL || p->p_wchan == 0) goto run; p->p_stat = SSLEEP; goto out; ! case SIGSTOP: ! case SIGTSTP: ! case SIGTTIN: ! case SIGTTOU: /* * Already stopped, don't need to stop again. * (If we did the shell could get confused.) --- 413,449 ---- */ if (p->p_flag&STRC) goto out; ! if (sig == SIGKILL) goto run; ! if (prop & SA_CONT) { /* ! * If SIGCONT is default (or ignored), we continue the ! * process but don't leave the signal in p_siglist, as ! * it has no further action. If SIGCONT is held, we ! * continue the process and leave the signal in ! * p_siglist. If the process catches SIGCONT, let it ! * handle the signal itself. If it isn't waiting on * an event, then it goes back to run state. * Otherwise, process goes back to sleep state. + * + * XXX - 2.11BSD has to leave the SIGCONT bit in the + * mask so that the call to issig() will clear p_cursig. + * We could clear p_cursig here but since issig() will + * get called anyway when the process wakes up why not + * leave it something to do? Besides clearing p_cursig + * here felt like a kluge. */ ! #ifndef pdp11 ! if (action == SIG_DFL) ! p->p_sig &= ~mask; ! #endif ! if (action == SIG_CATCH || p->p_wchan == 0) goto run; p->p_stat = SSLEEP; goto out; + } ! if (prop & SA_STOP) { /* * Already stopped, don't need to stop again. * (If we did the shell could get confused.) *************** *** 509,527 **** */ p->p_sig &= ~mask; /* take it away */ goto out; - - default: - /* - * If process is sleeping interruptibly, then - * unstick it so that when it is continued - * it can look at the signal. - * But don't setrun the process as its not to - * be unstopped by the signal alone. - */ - if (p->p_wchan && p->p_pri > PZERO) - unsleep(p); - goto out; } /*NOTREACHED*/ default: --- 450,466 ---- */ p->p_sig &= ~mask; /* take it away */ goto out; } + + /* + * If process is sleeping interruptibly, then simulate a + * wakeup so that when it is continued, it will be made + * runnable and can look at the signal. But don't make + * the process runnable, leave it stopped. + */ + if (p->p_wchan && p->p_pri > PZERO) + unsleep(p); + goto out; /*NOTREACHED*/ default: *************** *** 530,540 **** * other than kicking ourselves if we are running. * It will either never be noticed, or noticed very soon. */ - #ifdef vax - if (p == u.u_procp && !noproc) - #include "../vax/mtpr.h" - aston(); - #endif vax goto out; } /*NOTREACHED*/ --- 469,474 ---- *************** *** 565,590 **** { register struct proc *p; register int sig; ! long sigbits, mask; p = u.u_procp; for (;;) { ! sigbits = p->p_sig &~ p->p_sigmask; ! if ((p->p_flag&STRC) == 0) ! sigbits &= ~p->p_sigignore; if (p->p_flag&SVFORK) ! sigbits &= ~stopsigmask; ! if (sigbits == 0) ! break; ! sig = ffs((long)sigbits); mask = sigmask(sig); ! p->p_sig &= ~mask; /* take the signal! */ ! p->p_cursig = sig; ! if (p->p_flag&STRC) { /* * If traced, always stop, and stay * stopped until released by the parent. */ psignal(p->p_pptr, SIGCHLD); do { stop(p); --- 499,542 ---- { register struct proc *p; register int sig; ! long mask; ! int prop; p = u.u_procp; for (;;) { ! mask = p->p_sig & ~p->p_sigmask; if (p->p_flag&SVFORK) ! mask &= ~stopsigmask; ! if (mask == 0) { ! p->p_cursig = 0; /* XXX - no current signal */ ! return(0); /* No signals to send */ ! } ! sig = ffs(mask); mask = sigmask(sig); ! prop = sigprop[sig]; ! /* ! * We should see pending but ignored signals ! * only if STRC was on when they were posted. ! */ ! if (mask & p->p_sigignore && (p->p_flag&STRC) == 0) { ! p->p_sig &= ~mask; ! continue; ! } ! if (p->p_flag&STRC && (p->p_flag & SVFORK) == 0) { /* * If traced, always stop, and stay * stopped until released by the parent. + * + * Note that we must clear the pending signal + * before we call procxmt since that routine + * might cause a fault, calling sleep and + * leading us back here again with the same signal. + * Then we would be deadlocked because the tracer + * would still be blocked on the ipc struct from + * the initial request. */ + p->p_sig &= ~mask; + p->p_cursig = sig; psignal(p->p_pptr, SIGCHLD); do { stop(p); *************** *** 592,608 **** } while (!procxmt() && p->p_flag&STRC); /* - * If the traced bit got turned off, - * then put the signal taken above back into p_sig - * and go back up to the top to rescan signals. - * This ensures that p_sig* and u_signal are consistent. - */ - if ((p->p_flag&STRC) == 0) { - p->p_sig |= mask; - continue; - } - - /* * If parent wants us to take the signal, * then it will leave it in p->p_cursig; * otherwise we just look for signals again. --- 544,549 ---- *************** *** 612,626 **** continue; /* ! * If signal is being masked put it back ! * into p_sig and look for other signals. */ mask = sigmask(sig); ! if (p->p_sigmask & mask) { ! p->p_sig |= mask; continue; ! } } switch ((int)u.u_signal[sig]) { case SIG_DFL: --- 553,576 ---- continue; /* ! * Put the new signal into p_sig. If the ! * signal is being masked, look for other signals. */ mask = sigmask(sig); ! p->p_sig |= mask; ! if (p->p_sigmask & mask) continue; ! ! /* ! * If the traced bit got turned off, go back up ! * to the top to rescan signals. This ensures ! * that p_sig* and u_signal are consistent. ! */ ! if ((p->p_flag&STRC) == 0) ! continue; ! prop = sigprop[sig]; } + switch ((int)u.u_signal[sig]) { case SIG_DFL: *************** *** 627,674 **** /* * Don't take default actions on system processes. */ ! if (p->p_ppid == 0) ! break; ! switch (sig) { ! ! case SIGTSTP: ! case SIGTTIN: ! case SIGTTOU: /* ! * Children of init aren't allowed to stop ! * on signals from the keyboard. */ ! if (p->p_pptr == &proc[1]) { ! psignal(p, SIGKILL); ! continue; ! } ! /* fall into ... */ ! ! case SIGSTOP: ! if (p->p_flag&STRC) ! continue; ! psignal(p->p_pptr, SIGCHLD); stop(p); swtch(); ! continue; ! ! case SIGCONT: ! case SIGCHLD: ! case SIGURG: ! case SIGIO: ! case SIGWINCH: /* ! * These signals are normally not ! * sent if the action is the default. */ ! continue; /* == ignore */ ! ! default: ! goto send; } /*NOTREACHED*/ - case SIG_HOLD: case SIG_IGN: /* * Masking above should prevent us --- 577,623 ---- /* * Don't take default actions on system processes. */ ! if (p->p_pid <= 1) { ! #ifdef DIAGNOSTIC /* ! * Are you sure you want to ignore SIGSEGV ! * in init? XXX */ ! printf("Process (pid %d) got signal %d\n", ! p->p_pid, sig); ! #endif ! break; ! } ! /* ! * If there is a pending stop signal to process ! * with default action, stop here, ! * then clear the signal. However, ! * if process is member of an orphaned ! * process group, ignore tty stop signals. ! */ ! if (prop & SA_STOP) { ! if (p->p_flag & STRC || ! (p->p_pptr == &proc[1] && ! prop & SA_TTYSTOP)) ! break; /* == ignore */ ! p->p_cursig = sig; ! if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0) ! psignal(p->p_pptr, SIGCHLD); stop(p); swtch(); ! break; ! } else if (prop & SA_IGNORE) { /* ! * Except for SIGCONT, shouldn't get here. ! * Default action is to ignore; drop it. */ ! break; /* == ignore */ ! } else { ! p->p_cursig = sig; /* XXX */ ! return(sig); } /*NOTREACHED*/ case SIG_IGN: /* * Masking above should prevent us *************** *** 675,704 **** * ever trying to take action on a held * or ignored signal, unless process is traced. */ ! if ((p->p_flag&STRC) == 0) printf("issig\n"); ! continue; default: /* ! * This signal has an action, let ! * psig process it. */ ! goto send; } ! /*NOTREACHED*/ } ! /* ! * Didn't find a signal to send. ! */ ! p->p_cursig = 0; ! return (0); ! ! send: ! /* ! * Let psig process the signal. ! */ ! return (sig); } /* --- 624,645 ---- * ever trying to take action on a held * or ignored signal, unless process is traced. */ ! if ((prop & SA_CONT) == 0 && ! (p->p_flag&STRC) == 0) printf("issig\n"); ! break; /* == ignore */ default: /* ! * This signal has an action, put signal in cursig ! * for postsig to process it. */ ! p->p_cursig = sig; /* XXX */ ! return(sig); } ! p->p_sig &= ~mask; /* take the signal! */ } ! /* NOTREACHED */ } /* *************** *** 720,730 **** * the current signal. * The usual sequence is: * if (issig()) ! * psig(); ! * The signal bit has already been cleared by issig, ! * and the current signal number stored in p->p_cursig. */ ! psig() { register struct proc *p = u.u_procp; register int sig = p->p_cursig; --- 661,678 ---- * the current signal. * The usual sequence is: * if (issig()) ! * postsig(); ! * The signal bit has not already been cleared by issig so that needs to be ! * done here. The current signal number stored in p->p_cursig. ! * ! * Actually the sequence is: ! * if (p->p_cursig || ISSIG()) ! * Thus not clearing p_cursig below when returning 0 causes repeated delivery of ! * the signal. The sequence probably _should_ be simply ISSIG() but who knows ! * what doing that would break. Sigh. */ ! ! postsig() { register struct proc *p = u.u_procp; register int sig = p->p_cursig; *************** *** 731,750 **** long mask = sigmask(sig), returnmask; register int (*action)(); - #ifdef DIAGNOSTIC - /* more nonsense */ - if (sig == 0) - panic("psig"); - #endif if (u.u_fpsaved == 0) { savfp(&u.u_fps); u.u_fpsaved = 1; } action = u.u_signal[sig]; if (action != SIG_DFL) { #ifdef DIAGNOSTIC if (action == SIG_IGN || (p->p_sigmask & mask)) ! panic("psig action"); #endif u.u_error = 0; /* --- 679,696 ---- long mask = sigmask(sig), returnmask; register int (*action)(); if (u.u_fpsaved == 0) { savfp(&u.u_fps); u.u_fpsaved = 1; } + + p->p_sig &= ~mask; action = u.u_signal[sig]; + if (action != SIG_DFL) { #ifdef DIAGNOSTIC if (action == SIG_IGN || (p->p_sigmask & mask)) ! panic("postsig action"); #endif u.u_error = 0; /* *************** *** 757,765 **** * after the signal processing is completed. */ (void) _splhigh(); ! if (p->p_flag & SOMASK) { returnmask = u.u_oldmask; ! p->p_flag &= ~SOMASK; } else returnmask = p->p_sigmask; p->p_sigmask |= u.u_sigmask[sig] | mask; --- 703,711 ---- * after the signal processing is completed. */ (void) _splhigh(); ! if (u.u_psflags & SAS_OLDMASK) { returnmask = u.u_oldmask; ! u.u_psflags &= ~SAS_OLDMASK; } else returnmask = p->p_sigmask; p->p_sigmask |= u.u_sigmask[sig] | mask; *************** *** 770,790 **** return; } u.u_acflag |= AXSIG; ! switch (sig) { ! ! case SIGILL: ! case SIGIOT: ! case SIGBUS: ! case SIGQUIT: ! case SIGTRAP: ! case SIGEMT: ! case SIGFPE: ! case SIGSEGV: ! case SIGSYS: u.u_arg[0] = sig; ! if (core()) ! sig += 0200; ! } exit(sig); } --- 716,727 ---- return; } u.u_acflag |= AXSIG; ! if (sigprop[sig] & SA_CORE) ! { u.u_arg[0] = sig; ! if (core()) ! sig |= 0200; ! } exit(sig); } *** /usr/src/games/sail/main.c.old Tue Jul 29 19:55:36 1997 --- /usr/src/games/sail/main.c Tue Sep 9 21:52:04 1997 *************** *** 9,15 **** "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; ! static char sccsid[] = "@(#)main.c 5.1.1 (2.11BSD) 1997/7/29"; #endif #include "externs.h" --- 9,15 ---- "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; ! static char sccsid[] = "@(#)main.c 5.1.2 (2.11BSD) 1997/9/9"; #endif #include "externs.h" *************** *** 79,81 **** --- 79,109 ---- } /*NOTREACHED*/ } + + /* + * These used to be macros in machdep.h. The macros were wrong (didn't use + * sigmask() and thus only computed 16 bit signal masks). The signal handling + * in 2.11BSD is now that of 4.4BSD and the macros were fixed (i.e. rewritten) + * and made into routines to avoid the plethora of inline 'long' operations. + */ + + void + blockalarm() + { + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGALRM); + + (void)sigprocmask(SIG_BLOCK, &set, NULL); + } + + void + unblockalarm() + { + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGALRM); + (void)sigprocmask(SIG_UNBLOCK, &set, NULL); + } *** /usr/src/games/sail/machdep.h.old Wed May 29 16:13:31 1985 --- /usr/src/games/sail/machdep.h Tue Sep 9 21:45:01 1997 *************** *** 3,21 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)machdep.h 5.1 (Berkeley) 5/29/85 */ #define LOGFILE "/usr/games/lib/saillog" /* has to match the makefile */ #define TIMEOUT 300 /* Sync() timeout in seconds */ - - /* for 4.2bsd machines */ - #define blockalarm() ((void) sigblock(1 << SIGALRM-1)) - #define unblockalarm() ((void) sigsetmask(sigblock(0) & ~(1 << SIGALRM-1))) - - /* for 2.9bsd machines (onyx) - typedef int void; - #define blockalarm() ((void) sighold(SIGALRM)) - #define unblockalarm() ((void) sigrelse(SIGALRM)) - */ --- 3,11 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)machdep.h 5.1.1 (2.11BSD) 1997/9/9 */ #define LOGFILE "/usr/games/lib/saillog" /* has to match the makefile */ #define TIMEOUT 300 /* Sync() timeout in seconds */ *** /usr/src/games/hunt/driver.c.old Sun Aug 30 16:35:12 1987 --- /usr/src/games/hunt/driver.c Tue Sep 9 22:08:40 1997 *************** *** 6,11 **** --- 6,13 ---- * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. + * + * 1997/9/9 - updated to use sigprocmask (and compute the alarm mask correctly) */ # include "hunt.h" *************** *** 49,55 **** SOCKET test; # endif INTERNET # ifdef CONSTANT_MOVE ! register int enable_alarm, disable_alarm; # endif CONSTANT_MOVE static long read_fds; --- 51,57 ---- SOCKET test; # endif INTERNET # ifdef CONSTANT_MOVE ! sigset_t alarm_sigset; # endif CONSTANT_MOVE static long read_fds; *************** *** 60,74 **** # endif INTERNET # ifdef CONSTANT_MOVE ! enable_alarm = sigblock(0); ! disable_alarm = enable_alarm | (1 << (SIGALRM - 1)); ! (void) sigsetmask(disable_alarm); (void) signal(SIGALRM, moveshots); # endif CONSTANT_MOVE while (Nplayer > 0) { # ifdef CONSTANT_MOVE ! (void) sigsetmask(enable_alarm); # endif CONSTANT_MOVE read_fds = Fds_mask; errno = 0; --- 62,76 ---- # endif INTERNET # ifdef CONSTANT_MOVE ! sigemptyset(&alarm_sigset); ! sigaddset(&alarm_sigset, SIGALRM); ! (void) sigprocmask(SIG_BLOCK, &alarm_sigset, NULL); (void) signal(SIGALRM, moveshots); # endif CONSTANT_MOVE while (Nplayer > 0) { # ifdef CONSTANT_MOVE ! (void) sigprocmask(SIG_UNBLOCK, &alarm_sigset, NULL); # endif CONSTANT_MOVE read_fds = Fds_mask; errno = 0; *************** *** 87,93 **** } Have_inp = read_fds; # ifdef CONSTANT_MOVE ! (void) sigsetmask(disable_alarm); # endif CONSTANT_MOVE # ifdef INTERNET if (read_fds & test_mask) { --- 89,95 ---- } Have_inp = read_fds; # ifdef CONSTANT_MOVE ! (void) sigprocmask(SIG_BLOCK, &alarm_sigset, NULL); # endif CONSTANT_MOVE # ifdef INTERNET if (read_fds & test_mask) { *** /usr/src/lib/libc/gen/Makefile.old Sun Jun 29 15:54:50 1997 --- /usr/src/lib/libc/gen/Makefile Sun Aug 31 00:38:08 1997 *************** *** 3,9 **** # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)Makefile 5.7.8 (2.11BSD) 1997/06/29 # # Several routines have been rewritten in assembly language for the VAX and # the PDP. If you are not running on a VAX or PDP, you should use the --- 3,9 ---- # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)Makefile 5.7.9 (2.11BSD) 1997/08/28 # # Several routines have been rewritten in assembly language for the VAX and # the PDP. If you are not running on a VAX or PDP, you should use the *************** *** 25,30 **** --- 25,31 ---- regex.c scandir.c seekdir.c setgid.c setegid.c setrgid.c setuid.c \ setmode.c \ setenv.c seteuid.c setruid.c siglist.c signal.c siginterrupt.c \ + sigsetops.c \ sleep.c strcasecmp.c strftime.c swab.c sysctl.c syslog.c system.c \ syserrlst.c \ telldir.c time.c timezone.c ttyname.c ttyslot.c ualarm.c usleep.c \ *************** *** 41,46 **** --- 42,48 ---- regex.o scandir.o seekdir.o setgid.o setegid.o setrgid.o setuid.o \ setmode.o \ setenv.o seteuid.o setruid.o siglist.o signal.o siginterrupt.o \ + sigsetops.o \ sleep.o strcasecmp.o strftime.o swab.o sysctl.o syslog.o system.o \ syserrlst.o \ telldir.o time.o timezone.o ttyname.o ttyslot.o ualarm.o usleep.o \ *** /usr/src/lib/libc/pdp/gen/setjmp.s.old Sat Jan 1 21:22:50 1994 --- /usr/src/lib/libc/pdp/gen/setjmp.s Tue Sep 9 20:55:18 1997 *************** *** 5,11 **** */ #if defined(LIBC_SCCS) && !defined(lint) ! <@(#)setjmp.s 1.4 (2.11BSD GTE) 1/1/94\0> .even #endif --- 5,11 ---- */ #if defined(LIBC_SCCS) && !defined(lint) ! <@(#)setjmp.s 1.5 (2.11BSD GTE) 1997/9/7\0> .even #endif *************** *** 27,51 **** */ #include "DEFS.h" ! .globl _sigstack, _sigblock / needed to create sigcontext .globl __ovno ENTRY(setjmp) mov r2,-(sp) / save r2 mov 4(sp),r2 / r2 = env ! sub $4.,sp / allocate sizeof(struct sigstack) ! mov sp,r0 / and get current sigstack via ! mov r0,-(sp) / sigstack(0, sp) (can't use "mov sp,-(sp)") clr -(sp) ! jsr pc,_sigstack ! add $6.,sp / toss signal stack value and ! mov (sp)+,(r2)+ / save onsigstack status of caller ! clr -(sp) / get current signal mask via ! clr -(sp) / sigblock(0L) ! jsr pc,_sigblock ! cmp (sp)+,(sp)+ ! mov r0,(r2)+ / save signal mask of caller ! mov r1,(r2)+ mov sp,(r2) / calculate caller's pre jsr pc,setjmp add $4,(r2)+ / sp as (sp + saved r2 + ret addr) mov r5,(r2)+ / save caller's frame pointer --- 27,58 ---- */ #include "DEFS.h" ! SIG_SETMASK = 3 / XXX - from signal.h ! ! .globl _sigaltstack, _sigprocmask / needed to create sigcontext .globl __ovno ENTRY(setjmp) mov r2,-(sp) / save r2 mov 4(sp),r2 / r2 = env ! sub $6.,sp / allocate sizeof(struct sigaltstack) ! mov sp,r0 / and get current sigaltstack via ! mov r0,-(sp) / sigaltstack(0, sp) (cant use "mov sp,-(sp)") clr -(sp) ! jsr pc,_sigaltstack ! add $8.,sp / toss 0, &oss, ss_sp, ss_size, ! mov (sp)+,(r2)+ / save ss_flags of caller ! ! sub $4,sp / sizeof (sigset_t) - oset ! mov sp,r0 / can't use mov sp,-(sp) ! mov r0,-(sp) / 'oset' ! clr -(sp) / 'set' ! mov $SIG_SETMASK,-(sp) / 'how' ! jsr pc,_sigprocmask / sigprocmask(SIG_SETMASK, NULL, &oset) ! add $6,sp / toss how, set, &oset ! mov (sp)+,(r2)+ / oset(hi) to env ! mov (sp)+,(r2)+ / oset(lo) to env ! mov sp,(r2) / calculate caller's pre jsr pc,setjmp add $4,(r2)+ / sp as (sp + saved r2 + ret addr) mov r5,(r2)+ / save caller's frame pointer *** /usr/src/lib/libc/pdp/sys/Makefile.old Sun Dec 24 14:39:43 1995 --- /usr/src/lib/libc/pdp/sys/Makefile Tue Sep 9 19:47:00 1997 *************** *** 1,6 **** # Placed in the public domain - 1995/05/06 # ! # @(#)Makefile 1.2 (2.11BSD) 1995/12/24 CPP= /lib/cpp LD= /bin/ld --- 1,6 ---- # Placed in the public domain - 1995/05/06 # ! # @(#)Makefile 1.3 (2.11BSD) 1997/9/9 CPP= /lib/cpp LD= /bin/ld *************** *** 11,29 **** # source files associated with them. PDPSRCS= _exit.s brk.s execl.s execle.s execv.s fork.s pipe.s ptrace.s sbrk.s \ ! sigreturn.s sigvec.s vfork.s PDPOBJS= _exit.o brk.o execl.o execle.o execv.o fork.o pipe.o ptrace.o sbrk.o \ ! sigreturn.o sigvec.o vfork.o # these are generated with a second argument to SYSCALL of 'norm'. Have to # split into more than one list because 'make' only permits 80 "lefts". NORM1= __sysctl.o accept.o access.o acct.o adjtime.o bind.o chdir.o chflags.o \ ! chmod.o chown.o chroot.o close.o connect.o creat.o dup.o dup2.o \ execve.o fchdir.o fchflags.o fchmod.o fchown.o fcntl.o flock.o fstat.o \ fsync.o ftruncate.o getdtablesize.o getgroups.o getitimer.o \ ! gethostname.o getsockname.o sethostid.o sethostname.o \ getpeername.o getpriority.o getrlimit.o getrusage.o getsockopt.o \ gettimeofday.o ioctl.o kill.o killpg.o link.o listen.o lstat.o mkdir.o --- 11,29 ---- # source files associated with them. PDPSRCS= _exit.s brk.s execl.s execle.s execv.s fork.s pipe.s ptrace.s sbrk.s \ ! sigaction.s sigreturn.s vfork.s PDPOBJS= _exit.o brk.o execl.o execle.o execv.o fork.o pipe.o ptrace.o sbrk.o \ ! sigaction.o sigreturn.o vfork.o # these are generated with a second argument to SYSCALL of 'norm'. Have to # split into more than one list because 'make' only permits 80 "lefts". NORM1= __sysctl.o accept.o access.o acct.o adjtime.o bind.o chdir.o chflags.o \ ! chmod.o chown.o chroot.o close.o connect.o dup.o dup2.o \ execve.o fchdir.o fchflags.o fchmod.o fchown.o fcntl.o flock.o fstat.o \ fsync.o ftruncate.o getdtablesize.o getgroups.o getitimer.o \ ! gethostname.o getsockname.o sethostname.o \ getpeername.o getpriority.o getrlimit.o getrusage.o getsockopt.o \ gettimeofday.o ioctl.o kill.o killpg.o link.o listen.o lstat.o mkdir.o *************** *** 31,37 **** recv.o recvfrom.o recvmsg.o rename.o rmdir.o select.o send.o sendmsg.o \ sendto.o setgroups.o setitimer.o setpgrp.o setpriority.o setquota.o \ setregid.o setreuid.o setrlimit.o setsockopt.o settimeofday.o \ ! shutdown.o sigstack.o socket.o socketpair.o stat.o symlink.o \ statfs.o fstatfs.o getfsstat.o \ truncate.o umount.o unlink.o utimes.o wait4.o write.o writev.o --- 31,38 ---- recv.o recvfrom.o recvmsg.o rename.o rmdir.o select.o send.o sendmsg.o \ sendto.o setgroups.o setitimer.o setpgrp.o setpriority.o setquota.o \ setregid.o setreuid.o setrlimit.o setsockopt.o settimeofday.o \ ! shutdown.o sigaltstack.o socket.o socketpair.o stat.o symlink.o \ ! sigprocmask.o sigstack.o \ statfs.o fstatfs.o getfsstat.o \ truncate.o umount.o unlink.o utimes.o wait4.o write.o writev.o *************** *** 41,52 **** # these are generated with a second argument to SYSCALL of 'error' ! ERROR= sigpause.o # these are generated with a second argument to SYSCALL of 'noerror' ! NOERROR= getgid.o getegid.o gethostid.o getpagesize.o getpgrp.o getpid.o \ ! getppid.o getuid.o geteuid.o profil.o sigblock.o sigsetmask.o sync.o \ umask.o vhangup.o OBJS= ${PDPOBJS} ${NORM1} ${NORM2} ${LONG} ${ERROR} ${NOERROR} --- 42,53 ---- # these are generated with a second argument to SYSCALL of 'error' ! ERROR= sigsuspend.o # these are generated with a second argument to SYSCALL of 'noerror' ! NOERROR= getgid.o getegid.o getpagesize.o getpgrp.o getpid.o \ ! getppid.o getuid.o geteuid.o profil.o sigpending.o sync.o \ umask.o vhangup.o OBJS= ${PDPOBJS} ${NORM1} ${NORM2} ${LONG} ${ERROR} ${NOERROR} *** /usr/src/lib/libc/compat-4.1/pause.c.old Fri Feb 19 14:11:10 1988 --- /usr/src/lib/libc/compat-4.1/pause.c Tue Sep 9 22:14:42 1997 *************** *** 5,19 **** */ #if defined(LIBC_SCCS) && !defined(lint) ! static char sccsid[] = "@(#)pause.c 5.2 (Berkeley) 3/9/86"; #endif LIBC_SCCS and not lint /* * Backwards compatible pause. */ pause() { ! long sigblock(); ! sigpause(sigblock(0L)); } --- 5,22 ---- */ #if defined(LIBC_SCCS) && !defined(lint) ! static char sccsid[] = "@(#)pause.c 5.2.1 (2.11BSD) 1997/9/9"; #endif LIBC_SCCS and not lint + #include + /* * Backwards compatible pause. */ pause() { ! sigset_t set; ! sigemptyset(&set); ! sigsuspend(&set); } *** /usr/src/lib/libc/Makefile.old Mon Feb 19 21:26:21 1996 --- /usr/src/lib/libc/Makefile Thu Aug 28 13:31:47 1997 *************** *** 3,9 **** # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)Makefile 4.19.1 (2.11BSD) 1996/1/12 # # The system has two monitoring schemes, utilizing either ``prof'' # or ``gprof''. DFLMON determines the default profiler; mon.o --- 3,9 ---- # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)Makefile 4.19.2 (2.11BSD) 1997/8/28 # # The system has two monitoring schemes, utilizing either ``prof'' # or ``gprof''. DFLMON determines the default profiler; mon.o *************** *** 48,54 **** DFLMON= mon.o MACHINE=pdp DEFS= ! COMPAT= compat-4.1 compat-sys5 ALL= gen inet net ns stdio stdlib string ${MACHINE} ${COMPAT} TAGSFILE=tags --- 48,54 ---- DFLMON= mon.o MACHINE=pdp DEFS= ! COMPAT= compat-4.1 compat-sys5 compat-43 ALL= gen inet net ns stdio stdlib string ${MACHINE} ${COMPAT} TAGSFILE=tags *** /usr/src/local/less/signal.c.old Mon Jul 9 18:12:09 1990 --- /usr/src/local/less/signal.c Tue Sep 9 22:24:17 1997 *************** *** 113,119 **** * (This can be the case if we are reading; see comment above.) * So we ask the silly system for permission to do so. */ ! sigsetmask(0); #endif kill(getpid(), SIGTSTP); /* --- 113,119 ---- * (This can be the case if we are reading; see comment above.) * So we ask the silly system for permission to do so. */ ! sigsetmask(0L); #endif kill(getpid(), SIGTSTP); /* *** /usr/src/man/man2/sigblock.2.old Tue Jan 27 02:58:57 1987 --- /usr/src/man/man2/sigblock.2 Tue Sep 2 21:05:53 1997 *************** *** 2,10 **** .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigblock.2 6.3 (Berkeley) 5/14/86 .\" ! .TH SIGBLOCK 2 "May 14, 1986" .UC 5 .SH NAME sigblock \- block signals --- 2,10 ---- .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigblock.2 6.3.1 (2.11BSD) 97/9/2 .\" ! .TH SIGBLOCK 2 "September 2, 1997" .UC 5 .SH NAME sigblock \- block signals *************** *** 12,25 **** .nf .B #include ! .B omask = sigblock(mask); ! .B long omask, mask; ! .B mask = sigmask(signum) ! .B long mask; ! .B int signum; .SH DESCRIPTION ! .I Sigblock causes the signals specified in .I mask to be added to the set of signals currently --- 12,28 ---- .nf .B #include ! \fIomask\fP = \fBsigblock\fP(\fImask\fP); ! long \fIomask, mask\fP; ! \fImask\fP = \fBsigmask\fP(\fIsignum\fP) ! long \fImask\fP; ! int \fIsignum\fP; .SH DESCRIPTION ! .B This interface is made obsolete by: ! sigprocmask(2). ! .PP ! .B Sigblock causes the signals specified in .I mask to be added to the set of signals currently *************** *** 28,34 **** corresponding bit in .I mask is a 1; the macro ! .I sigmask is provided to construct the mask for a given .IR signum . .PP --- 31,37 ---- corresponding bit in .I mask is a 1; the macro ! .B sigmask is provided to construct the mask for a given .IR signum . .PP *************** *** 38,41 **** .SH "RETURN VALUE The previous set of masked signals is returned. .SH "SEE ALSO" ! kill(2), sigvec(2), sigsetmask(2) --- 41,47 ---- .SH "RETURN VALUE The previous set of masked signals is returned. .SH "SEE ALSO" ! kill(2), sigprocmask(2), sigaction(2), sigsetmask(2), sigsetops(2) ! .SH "HISTORY" ! The \fBsigblock\fP function call appeared in 4.2BSD and has been ! deprecated. *** /usr/src/man/man2/Makefile.old Thu Jan 25 23:30:14 1996 --- /usr/src/man/man2/Makefile Wed Sep 3 20:47:00 1997 *************** *** 14,20 **** # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. # ! # @(#)Makefile 2.6 (2.11BSD GTE) 1996/1/26 # MDIR= /usr/man/cat2 SRCS= accept.2 access.2 acct.2 adjtime.2 bind.2 brk.2 chdir.2 chmod.2 \ --- 14,20 ---- # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. # ! # @(#)Makefile 2.7 (2.11BSD GTE) 1997/9/3 # MDIR= /usr/man/cat2 SRCS= accept.2 access.2 acct.2 adjtime.2 bind.2 brk.2 chdir.2 chmod.2 \ *************** *** 30,35 **** --- 30,36 ---- pipe.2 profil.2 ptrace.2 quota.2 read.2 readlink.2 reboot.2 \ recv.2 rename.2 rmdir.2 select.2 send.2 setgroups.2 setpgrp.2 \ setquota.2 setregid.2 setreuid.2 shutdown.2 sigblock.2 sigpause.2 \ + sigaction.2 sigaltstack.2 sigpending.2 sigprocmask.2 sigsuspend.2 \ sigreturn.2 sigsetmask.2 sigstack.2 sigvec.2 socket.2 socketpair.2 \ stat.2 statfs.2 swapon.2 symlink.2 sync.2 syscall.2 truncate.2 ucall.2 \ umask.2 unlink.2 utimes.2 vfork.2 vhangup.2 wait.2 write.2 *************** *** 46,51 **** --- 47,53 ---- pipe.0 profil.0 ptrace.0 quota.0 read.0 readlink.0 reboot.0 \ recv.0 rename.0 rmdir.0 select.0 send.0 setgroups.0 setpgrp.0 \ setquota.0 setregid.0 setreuid.0 shutdown.0 sigblock.0 sigpause.0 \ + sigaction.0 sigaltstack.0 sigpending.0 sigprocmask.0 sigsuspend.0 \ sigreturn.0 sigsetmask.0 sigstack.0 sigvec.0 socket.0 socketpair.0 \ stat.0 statfs.0 swapon.0 symlink.0 sync.0 syscall.0 truncate.0 ucall.0 \ umask.0 unlink.0 utimes.0 vfork.0 vhangup.0 wait.0 write.0 *** /usr/src/man/man2/sigpause.2.old Tue Jan 27 03:19:33 1987 --- /usr/src/man/man2/sigpause.2 Tue Sep 2 21:03:00 1997 *************** *** 2,21 **** .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigpause.2 6.2 (Berkeley) 5/15/86 .\" ! .TH SIGPAUSE 2 "May 15, 1986" .UC 4 .SH NAME sigpause \- atomically release blocked signals and wait for interrupt .SH SYNOPSIS ! .ft B ! sigpause(sigmask) .br ! long sigmask; ! .ft R .SH DESCRIPTION ! .I Sigpause assigns .I sigmask to the set of masked signals --- 2,22 ---- .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigpause.2 6.2.1 (2.11BSD) 97/9/2 .\" ! .TH SIGPAUSE 2 "September 2, 1997" .UC 4 .SH NAME sigpause \- atomically release blocked signals and wait for interrupt .SH SYNOPSIS ! \fBsigpause\fP(\fIsigmask\fP) .br ! long \fIsigmask\fP; .SH DESCRIPTION ! .B This interface is made obsolete by: ! sigsuspend(2). ! .PP ! .B Sigpause() assigns .I sigmask to the set of masked signals *************** *** 24,41 **** .I Sigmask is usually 0L to indicate that no signals are now to be blocked. ! .I Sigpause always terminates by being interrupted, returning \-1 with .I errno set to EINTR. - .PP - In normal usage, a signal is blocked using - .IR sigblock (2), - to begin a critical section, variables modified on the occurrence - of the signal are examined to determine that there is no work - to be done, and the process pauses awaiting work by using - .I sigpause - with the mask returned by - .IR sigblock . .SH SEE ALSO ! sigblock(2), sigvec(2) --- 25,38 ---- .I Sigmask is usually 0L to indicate that no signals are now to be blocked. ! .B Sigpause always terminates by being interrupted, returning \-1 with .I errno set to EINTR. .SH SEE ALSO ! sigsuspend(2), kill(2), sigaction(2), sigprocmask(2), sigblock(2), ! sigvec(2) ! .SH HISTORY ! The ! .B sigpause ! function call appeared in 4.2BSD and has been deprecated. *** /usr/src/man/man2/sigsetmask.2.old Tue Jan 27 02:58:57 1987 --- /usr/src/man/man2/sigsetmask.2 Wed Sep 3 20:56:31 1997 *************** *** 2,10 **** .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigsetmask.2 6.3 (Berkeley) 5/14/86 .\" ! .TH SIGSETMASK 2 "May 14, 1986" .UC 5 .SH NAME sigsetmask \- set current signal mask --- 2,10 ---- .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigsetmask.2 6.3.1 (2.11BSD) 97/9/3 .\" ! .TH SIGSETMASK 2 "September 3, 1997" .UC 5 .SH NAME sigsetmask \- set current signal mask *************** *** 19,24 **** --- 19,27 ---- .B long mask; .B int signum; .SH DESCRIPTION + .B This interface is made obsolete by: + .sigprocmask(2). + .sp .I Sigsetmask sets the current signal mask (those signals that are blocked from delivery). *************** *** 37,39 **** --- 40,46 ---- The previous set of masked signals is returned. .SH "SEE ALSO" kill(2), sigvec(2), sigblock(2), sigpause(2) + .SH HISTORY + The + .B sigsetmask + function call appeared in 4.2BSD and has been deprecated. *** /usr/src/man/man2/sigvec.2.old Wed Feb 4 17:56:40 1987 --- /usr/src/man/man2/sigvec.2 Wed Sep 3 21:02:25 1997 *************** *** 2,10 **** .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigvec.2 6.3 (Berkeley) 1/8/86 .\" ! .TH SIGVEC 2 "January 8, 1986" .UC 4 .ie t .ds d \(dg .el .ds d \z'|+' --- 2,10 ---- .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigvec.2 6.3.1 (2.11BSD) 97/9/3 .\" ! .TH SIGVEC 2 "September 3, 1997" .UC 4 .ie t .ds d \(dg .el .ds d \z'|+' *************** *** 27,32 **** --- 27,35 ---- .B struct sigvec *vec, *ovec; .fi .SH DESCRIPTION + .B This interface has been made obsolete by: + sigaction(2). + .sp The system defines a set of signals that may be delivered to a process. Signal delivery resembles the occurence of a hardware interrupt: the signal is blocked from further occurrence, the current process *** /usr/src/man/man2/sigstack.2.old Sun Dec 14 15:07:06 1986 --- /usr/src/man/man2/sigstack.2 Wed Sep 3 21:00:38 1997 *************** *** 2,10 **** .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigstack.2 6.2 (Berkeley) 6/30/85 .\" ! .TH SIGSTACK 2 "June 30, 1985" .UC 5 .SH NAME sigstack \- set and/or get signal stack context --- 2,10 ---- .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)sigstack.2 6.2.1 (2.11BSD) 97/9/3 .\" ! .TH SIGSTACK 2 "September 3, 1997" .UC 5 .SH NAME sigstack \- set and/or get signal stack context *************** *** 20,25 **** --- 20,28 ---- .B sigstack(ss, oss); .B struct sigstack *ss, *oss; .SH DESCRIPTION + .B This interface has been made obsolete by: + sigaltstack(2). + .sp .I Sigstack allows users to define an alternate stack on which signals are to be processed. If *************** *** 63,65 **** --- 66,72 ---- address space. .SH "SEE ALSO" sigvec(2), setjmp(3) + .SH HISTORY + The + .B sigstack + function call appeared in 4.2BSD and has been deprecated. *** /usr/src/man/man3/Makefile.old Tue Jul 29 20:26:19 1997 --- /usr/src/man/man3/Makefile Sun Sep 7 18:09:27 1997 *************** *** 14,20 **** # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. # ! # @(#)Makefile 5.4.12 (2.11BSD) 1997/7/29 # MDIR= /usr/man/cat3 SRCS1= abort.3 abs.3 alarm.3 asinh.3 assert.3 atof.3 bstring.3 byteorder.3 \ --- 14,20 ---- # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. # ! # @(#)Makefile 5.4.13 (2.11BSD) 1997/9/3 # MDIR= /usr/man/cat3 SRCS1= abort.3 abs.3 alarm.3 asinh.3 assert.3 atof.3 bstring.3 byteorder.3 \ *************** *** 32,38 **** qsort.3 rand.3 random.3 rcmd.3 regex.3 resolver.3 rexec.3 scandir.3 \ scanf.3 setbuf.3 setjmp.3 setuid.3 siginterrupt.3 signal.3 sin.3 \ sinh.3 sleep.3 sqrt.3 stdio.3 strftime.3 string.3 strtok.3 stty.3 \ ! setmode.3 \ strcspn.3 strpbrk.3 strsep.3 strspn.3 strtol.3 strtoul.3 strstr.3 \ swab.3 sysctl.3 syslog.3 \ system.3 termcap.3 time.3 times.3 ttyname.3 ualarm.3 uname.3 ungetc.3 \ --- 32,38 ---- qsort.3 rand.3 random.3 rcmd.3 regex.3 resolver.3 rexec.3 scandir.3 \ scanf.3 setbuf.3 setjmp.3 setuid.3 siginterrupt.3 signal.3 sin.3 \ sinh.3 sleep.3 sqrt.3 stdio.3 strftime.3 string.3 strtok.3 stty.3 \ ! setmode.3 sigsetops.3 \ strcspn.3 strpbrk.3 strsep.3 strspn.3 strtol.3 strtoul.3 strstr.3 \ swab.3 sysctl.3 syslog.3 \ system.3 termcap.3 time.3 times.3 ttyname.3 ualarm.3 uname.3 ungetc.3 \ *************** *** 53,59 **** qsort.0 rand.0 random.0 rcmd.0 regex.0 resolver.0 rexec.0 scandir.0 \ scanf.0 setbuf.0 setjmp.0 setuid.0 siginterrupt.0 signal.0 sin.0 \ sinh.0 sleep.0 sqrt.0 stdio.0 strftime.0 string.0 strtok.0 stty.0 \ ! setmode.0 \ strcspn.0 strpbrk.0 strsep.0 strspn.0 strtol.0 strtoul.0 strstr.0 \ swab.0 sysctl.0 syslog.0 \ system.0 termcap.0 time.0 times.0 ttyname.0 ualarm.0 uname.0 ungetc.0 \ --- 53,59 ---- qsort.0 rand.0 random.0 rcmd.0 regex.0 resolver.0 rexec.0 scandir.0 \ scanf.0 setbuf.0 setjmp.0 setuid.0 siginterrupt.0 signal.0 sin.0 \ sinh.0 sleep.0 sqrt.0 stdio.0 strftime.0 string.0 strtok.0 stty.0 \ ! setmode.0 sigsetops.0 \ strcspn.0 strpbrk.0 strsep.0 strspn.0 strtol.0 strtoul.0 strstr.0 \ swab.0 sysctl.0 syslog.0 \ system.0 termcap.0 time.0 times.0 ttyname.0 ualarm.0 uname.0 ungetc.0 \ *************** *** 86,92 **** sprintf.0 vfprintf.0 vprintf.0 vsprintf.0 alphasort.0 bcmp.0 bcopy.0 \ bzero.0 clearerr.0 feof.0 fflush.0 ffs.0 fileno.0 fprintf.0 gamma.0 \ getdiskbyname.0 isatty.0 moncontrol.0 monstartup.0 setbuffer.0 \ ! setlinebuf.0 setvbuf.o sys_siglist.0 ttyslot.0 endfsent.0 endgrent.0 \ endpwent.0 getfsfile.0 getfsspec.0 getfstype.0 getgrgid.0 REMO3= getgrnam.0 getpwnam.0 getpwuid.0 setfsent.0 setgrent.0 setpwent.0 \ --- 86,92 ---- sprintf.0 vfprintf.0 vprintf.0 vsprintf.0 alphasort.0 bcmp.0 bcopy.0 \ bzero.0 clearerr.0 feof.0 fflush.0 ffs.0 fileno.0 fprintf.0 gamma.0 \ getdiskbyname.0 isatty.0 moncontrol.0 monstartup.0 setbuffer.0 \ ! setlinebuf.0 setvbuf.0 sys_siglist.0 ttyslot.0 endfsent.0 endgrent.0 \ endpwent.0 getfsfile.0 getfsspec.0 getfstype.0 getgrgid.0 REMO3= getgrnam.0 getpwnam.0 getpwuid.0 setfsent.0 setgrent.0 setpwent.0 \ *************** *** 101,108 **** memset.0 strchr.0 strrchr.0 tmpnam.0 tmpfile.0 \ tempnam.0 getmode.0 ! REMO4= verr.0 errx.0 verrx.0 warn.0 warnx.0 vwarnx.0 .SUFFIXES: .3 .0 .3.0: --- 101,110 ---- memset.0 strchr.0 strrchr.0 tmpnam.0 tmpfile.0 \ tempnam.0 getmode.0 ! REMO4= verr.0 errx.0 verrx.0 warn.0 warnx.0 vwarnx.0 + REMO5 = sigaddset.0 sigdelset.0 sigemptyset.0 sigfillset.0 sigismember.0 + .SUFFIXES: .3 .0 .3.0: *************** *** 136,141 **** --- 138,150 ---- for i in ${REMO4}; do \ ln ${DESTDIR}/${MDIR}/err.0 ${DESTDIR}${MDIR}/$$i; \ done + for i in ${REMO5}; do \ + rm -f ${DESTDIR}${MDIR}/$$i; \ + done + for i in ${REMO5}; do \ + ln ${DESTDIR}/${MDIR}/sigsetops.0 ${DESTDIR}${MDIR}/$$i; \ + done + ln ${DESTDIR}${MDIR}/end.0 ${DESTDIR}${MDIR}/edata.0 ln ${DESTDIR}${MDIR}/end.0 ${DESTDIR}${MDIR}/etext.0 ln ${DESTDIR}${MDIR}/j0.0 ${DESTDIR}${MDIR}/j1.0 *** /usr/src/new/crash/crashsubs.c.old Fri Mar 28 21:13:13 1997 --- /usr/src/new/crash/crashsubs.c Tue Sep 2 21:57:00 1997 *************** *** 1,6 **** --- 1,9 ---- /* * U N I X 2 . 9 B S D C R A S H A N A L Y Z E R S U B S * + * The proc structure flags cleaned up. This program still doesn't run + * (or compile) under the current system. 1997/9/2 + * * All the tty delay bits went away. 1997/3/28 * * 'LCASE' and 'LTILDE' went away. Some day this program should be *************** *** 572,578 **** procflg(flgs) int *flgs; { ! #define PROC_FLAGS "\0\1SLOAD\2SSYS\3SLOCK\4SSWAP\5STRC\6SWTED\7SULOCK\10SOMASK\11SVFORK\12SVFPRINT\13SVFDONE\14STIMO\15SDETACH\16SOUSIG\17SSEL" printb((u_long) *flgs, PROC_FLAGS); } --- 575,581 ---- procflg(flgs) int *flgs; { ! #define PROC_FLAGS "\0\1SLOAD\2SSYS\3SLOCK\4SSWAP\5STRC\6SWTED\7SULOCK\11SVFORK\12SVFPRNT\13SVFDONE\15SDETACH\16P_NOCLDSTOP\17SSEL" printb((u_long) *flgs, PROC_FLAGS); } *** /usr/src/share/adb/u.old Sat Jan 18 22:01:47 1997 --- /usr/src/share/adb/u Wed Sep 3 21:07:47 1997 *************** *** 16,22 **** +/"ov_offst"n16un"nseg"ndn64+ +/"sigmask"n32Dn +/"sigonstack"16t"sigintr"16t"oldmask"n3Xn"code"ndn ! +/"onstack"8t"sigsp"nodn +/"ofile"n30on"pofile"n30bn +/"lastfile"ndn +/"cdir"8t"rdir"n2on --- 16,22 ---- +/"ov_offst"n16un"nseg"ndn64+ +/"sigmask"n32Dn +/"sigonstack"16t"sigintr"16t"oldmask"n3Xn"code"ndn ! +/"psflags"8t"sigaltstack"n+bodon +/"ofile"n30on"pofile"n30bn +/"lastfile"ndn +/"cdir"8t"rdir"n2on *************** *** 32,34 **** --- 32,35 ---- +/"rlimits"n12D +/"quota"non +/"nc_off"16t"nc_inum"8t"nc_dev"nDubbn + +/"login"16tsn *** /usr/src/share/lint/llib-lc.old Thu Jul 11 19:32:55 1996 --- /usr/src/share/lint/llib-lc Fri Aug 29 14:54:04 1997 *************** *** 1,4 **** ! /* @(#)llib-lc 1.44 (2.11BSD GTE) 1996/7/10 */ /* LINTLIBRARY */ --- 1,4 ---- ! /* @(#)llib-lc 1.45 (2.11BSD GTE) 1997/8/29 */ /* LINTLIBRARY */ *************** *** 152,170 **** int shutdown( s, h ){ return 0;} int (*signal(c, f))() int (*f)(); { return(f); } int sigvec(c, f, m) struct sigvec *f, *m; { return 0; } long sigblock(m) long m; { return (m); } long sigsetmask(m) long m; { return (m); } sigpause(m) long m; { ; } int sigreturn(scp) struct sigcontext *scp; { return -1; } int sigstack(ss, oss) struct sigstack *ss, *oss; { return 0 ; } int socket( a, t, p) {return 1;} int socketpair( d, t, p, s ) int s[2]; { return 0; } int stat(s, b) char *s; struct stat *b; { return(0); } int statfs(s, b) char *s; struct statfs *b; { return(0); } - #ifdef notdef - char * stk( a ) char * a; { return a; } - char * sstk( a ) int a; { return (char *)0; } - #endif int swapon( s ) char *s; { return 0;} int symlink( t, f) char *t, *f; { return 0;} sync(){;} --- 152,172 ---- int shutdown( s, h ){ return 0;} int (*signal(c, f))() int (*f)(); { return(f); } int sigvec(c, f, m) struct sigvec *f, *m; { return 0; } + int sigaction(c, f, m) int c; struct sigaction *f, *m; { return 0;} + int sigaltstack(f,m) struct sigaltstack *f, *m; { return 0;} long sigblock(m) long m; { return (m); } + int siginterrupt(sig, flag) { return 0; } + int sigprocmask(c, f, m) int c; sigset_t *f, *m; { return 0;} + int sigpending(f) sigset_t *f; { return 0;} long sigsetmask(m) long m; { return (m); } sigpause(m) long m; { ; } int sigreturn(scp) struct sigcontext *scp; { return -1; } int sigstack(ss, oss) struct sigstack *ss, *oss; { return 0 ; } + int sigsuspend(f) sigset_t *f; { return 0;} int socket( a, t, p) {return 1;} int socketpair( d, t, p, s ) int s[2]; { return 0; } int stat(s, b) char *s; struct stat *b; { return(0); } int statfs(s, b) char *s; struct statfs *b; { return(0); } int swapon( s ) char *s; { return 0;} int symlink( t, f) char *t, *f; { return 0;} sync(){;} *************** *** 373,380 **** setttyent() { ; } int setuid(u) uid_t u; { return(0); } setusershell() { ; } ! int siginterrupt(sig, flag) { return 0; } ! sleep(i) unsigned i; {} int srand(s){ return s; } int strcasecmp(a, b) char *a, *b; { return(1); } int strncasecmp(a, b, n) char *a, *b; { return (1); } --- 375,381 ---- setttyent() { ; } int setuid(u) uid_t u; { return(0); } setusershell() { ; } ! int sleep(i) unsigned i; {} int srand(s){ return s; } int strcasecmp(a, b) char *a, *b; { return(1); } int strncasecmp(a, b, n) char *a, *b; { return (1); } *************** *** 461,466 **** --- 462,468 ---- setbuf( f, b ) FILE *f; char *b; {;} setbuffer( f, b, s ) FILE *f; char *b; {;} setlinebuf( f ) FILE *f; {;} + setvbuf(f, b, m, s) FILE *f; char *b; int m; size_t s; { return 0;} /* VARARGS2 */ int sprintf( s, f ) char *s, *f; { return(1);} /* VARARGS2 */ *** /usr/src/usr.sbin/pstat/pstat.c.old Sun Jan 19 17:16:14 1997 --- /usr/src/usr.sbin/pstat/pstat.c Fri Sep 12 19:25:53 1997 *************** *** 9,15 **** "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; ! static char sccsid[] = "@(#)pstat.c 5.8.3 (2.11BSD GTE) 1997/1/19"; #endif /* --- 9,15 ---- "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; ! static char sccsid[] = "@(#)pstat.c 5.8.4 (2.11BSD GTE) 1997/9/1"; #endif /* *************** *** 383,395 **** return; } printf("%d/%d processes\n", np, nproc); ! printf(" LOC S F PRI SIG UID SLP TIM CPU NI PGRP PID PPID ADDR SADDR DADDR SIZE WCHAN LINK TEXTP\n"); for (pp=xproc; pp<&xproc[nproc]; pp++) { if (pp->p_stat==0 && allflg==0) continue; printf("%7.1o", aproc + (pp - xproc)*sizeof (*pp)); printf(" %2d", pp->p_stat); ! printf(" %7.1o", pp->p_flag); printf(" %3d", pp->p_pri); printf(" %8.1lx", pp->p_sig); printf(" %5u", pp->p_uid); --- 383,395 ---- return; } printf("%d/%d processes\n", np, nproc); ! printf(" LOC S F PRI SIG UID SLP TIM CPU NI PGRP PID PPID ADDR SADDR DADDR SIZE WCHAN LINK TEXTP SIGM\n"); for (pp=xproc; pp<&xproc[nproc]; pp++) { if (pp->p_stat==0 && allflg==0) continue; printf("%7.1o", aproc + (pp - xproc)*sizeof (*pp)); printf(" %2d", pp->p_stat); ! printf(" %7.1x", pp->p_flag); printf(" %3d", pp->p_pri); printf(" %8.1lx", pp->p_sig); printf(" %5u", pp->p_uid); *************** *** 407,412 **** --- 407,413 ---- printf(" %7.1o", pp->p_wchan); printf(" %7.1o", pp->p_link); printf(" %7.1o", pp->p_textp); + printf(" %8.1lx", pp->p_sigmask); printf("\n"); } free(xproc); *************** *** 610,616 **** printf("sigintr\t%.1lo\n", U.u_sigintr); printf("oldmask\t%.1lo\n", U.u_oldmask); printf("code\t%u\n", U.u_code); ! printf("onstack\t%d %.1o\n", U.u_onstack, U.u_sigsp); printf("ofile"); for (i = 0; i < NOFILE; i++) { --- 611,619 ---- printf("sigintr\t%.1lo\n", U.u_sigintr); printf("oldmask\t%.1lo\n", U.u_oldmask); printf("code\t%u\n", U.u_code); ! printf("psflags\t%d\n", U.u_psflags); ! printf("ss_base\t%.1o ss_size %.1o ss_flags %.1o\n", ! U.u_sigstk.ss_base, U.u_sigstk.ss_size, U.u_sigstk.ss_flags); printf("ofile"); for (i = 0; i < NOFILE; i++) { *************** *** 672,677 **** --- 675,681 ---- printf("ncache\t%ld %u %d,%d\n", U.u_ncache.nc_prevoffset, U.u_ncache.nc_inumber, major(U.u_ncache.nc_dev), minor(U.u_ncache.nc_dev)); + printf("login\t%*s\n", MAXLOGNAME, U.u_login); } oatoi(s) *** /usr/src/usr.sbin/pstat/pstat.8.old Sun Nov 17 20:19:06 1996 --- /usr/src/usr.sbin/pstat/pstat.8 Tue Sep 2 21:36:19 1997 *************** *** 2,10 **** .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)pstat.8 6.3.1 (2.11BSD) 1996/11/17 .\" ! .TH PSTAT 8 "November 17, 1996" .UC 4 .SH NAME pstat \- print system facts --- 2,10 ---- .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)pstat.8 6.3.2 (2.11BSD) 1997/9/2 .\" ! .TH PSTAT 8 "September 2, 1997" .UC 4 .SH NAME pstat \- print system facts *************** *** 164,219 **** .IP 0001 9n loaded .IP 0002 ! the scheduler process .IP 0004 locked for swap out .IP 0008 ! swapped out .IP 0010 traced .IP 0020 used in tracing ! . \".IP 000040 ! . \"locked in by ! . \".IR lock (2). ! .IP 0080 ! in page-wait .IP 0100 ! prevented from swapping during ! .IR fork (2) .IP 0200 ! will restore old mask after taking signal .IP 0400 ! exiting ! .IP 0800 ! doing physical I/O (bio.c) .IP 1000 ! process resulted from a ! .IR vfork (2) ! which is not yet complete .IP 2000 ! another flag for ! .IR vfork (2) .IP 4000 ! process has no virtual memory, as it is a parent in the context of ! .IR vfork (2) ! .IP 8000 ! process is demand paging data pages from its text inode. ! .IP 10000 ! process using sequential VM patterns ! .IP 20000 ! process using random VM patterns ! .IP 100000 ! using old 4.1-compatible signal semantics ! .IP 200000 ! process needs profiling tick ! .IP 400000 ! process is scanning descriptors during select ! .IP 1000000 ! process page tables have changed .RE - .IP POIP - number of pages currently being pushed out from this process. .IP PRI Scheduling priority, see .IR setpriority (2). --- 164,194 ---- .IP 0001 9n loaded .IP 0002 ! system process (swapper) .IP 0004 locked for swap out .IP 0008 ! swap save area .IP 0010 traced .IP 0020 used in tracing ! .IP 0040 ! user settable lock in core .IP 0100 ! process resulted from ! .IR vfork (2) .IP 0200 ! parent in vfork, waiting for child .IP 0400 ! parent has released child in vfork .IP 1000 ! detached inherited by init .IP 2000 ! no SIGCHLD signal to parent .IP 4000 ! selecting; wakeup/waiting danger .RE .IP PRI Scheduling priority, see .IR setpriority (2). *** /VERSION.old Mon Aug 11 21:20:47 1997 --- /VERSION Thu Sep 11 21:14:27 1997 *************** *** 1,5 **** ! Current Patch Level: 383 ! Date: August 11, 1997 2.11 BSD ============ --- 1,5 ---- ! Current Patch Level: 388 ! Date: September 12, 1997 2.11 BSD ============