-
-/*
- * Clear registers on exec
- */
-setregs(entry)
- u_long entry;
-{
- register int i;
- register struct proc *p = u.u_procp;
-
- /*
- * Reset caught signals. Held signals
- * remain held through p_sigmask.
- */
- while (p->p_sigcatch) {
- (void) spl6();
- i = ffs(p->p_sigcatch);
- p->p_sigcatch &= ~(1 << (i - 1));
- u.u_signal[i] = SIG_DFL;
- (void) spl0();
- }
-#ifdef notdef
- /* should pass args to init on the stack */
- for (rp = &u.u_ar0[0]; rp < &u.u_ar0[16];)
- *rp++ = 0;
-#endif
- u.u_ar0[PC] = entry + 2;
- for (i=0; i<NOFILE; i++) {
- if (u.u_pofile[i]&UF_EXCLOSE) {
- closef(u.u_ofile[i]);
- u.u_ofile[i] = NULL;
- u.u_pofile[i] = 0;
- }
- u.u_pofile[i] &= ~UF_MAPPED;
- }
-}