things moved into zero range; inherit profiling from parent
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 21 Jun 1992 02:57:26 +0000 (18:57 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 21 Jun 1992 02:57:26 +0000 (18:57 -0800)
SCCS-vsn: sys/kern/kern_fork.c 7.36

usr/src/sys/kern/kern_fork.c

index 540d007..438c158 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)kern_fork.c 7.35 (Berkeley) %G%
+ *     @(#)kern_fork.c 7.36 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -151,17 +151,15 @@ again:
            (unsigned) ((caddr_t)&p2->p_endzero - (caddr_t)&p2->p_startzero));
        bcopy(&p1->p_startcopy, &p2->p_startcopy,
            (unsigned) ((caddr_t)&p2->p_endcopy - (caddr_t)&p2->p_startcopy));
            (unsigned) ((caddr_t)&p2->p_endzero - (caddr_t)&p2->p_startzero));
        bcopy(&p1->p_startcopy, &p2->p_startcopy,
            (unsigned) ((caddr_t)&p2->p_endcopy - (caddr_t)&p2->p_startcopy));
-       p2->p_wmesg = NULL;     /* XXX - should be in zero range */
-       p2->p_spare[0] = 0;     /* XXX - should be in zero range */
-       p2->p_spare[1] = 0;     /* XXX - should be in zero range */
-       p2->p_spare[2] = 0;     /* XXX - should be in zero range */
-       p2->p_spare[3] = 0;     /* XXX - should be in zero range */
 
        /*
         * Duplicate sub-structures as needed.
         * Increase reference counts on shared objects.
         * The p_stats and p_sigacts substructs are set in vm_fork.
         */
 
        /*
         * Duplicate sub-structures as needed.
         * Increase reference counts on shared objects.
         * The p_stats and p_sigacts substructs are set in vm_fork.
         */
+       p2->p_flag = SLOAD | (p1->p_flag & SHPUX);
+       if (p1->p_flag & SPROFIL)
+               startprofclock(p2);
        MALLOC(p2->p_cred, struct pcred *, sizeof(struct pcred),
            M_SUBPROC, M_WAITOK);
        bcopy(p1->p_cred, p2->p_cred, sizeof(*p2->p_cred));
        MALLOC(p2->p_cred, struct pcred *, sizeof(struct pcred),
            M_SUBPROC, M_WAITOK);
        bcopy(p1->p_cred, p2->p_cred, sizeof(*p2->p_cred));
@@ -182,7 +180,6 @@ again:
                p2->p_limit->p_refcnt++;
        }
 
                p2->p_limit->p_refcnt++;
        }
 
-       p2->p_flag = SLOAD | (p1->p_flag & SHPUX);
        if (p1->p_session->s_ttyvp != NULL && p1->p_flag & SCTTY)
                p2->p_flag |= SCTTY;
        if (isvfork)
        if (p1->p_session->s_ttyvp != NULL && p1->p_flag & SCTTY)
                p2->p_flag |= SCTTY;
        if (isvfork)
@@ -206,10 +203,6 @@ again:
        }
 #endif
 
        }
 #endif
 
-#if defined(tahoe)
-       p2->p_vmspace->p_ckey = p1->p_vmspace->p_ckey; /* XXX move this */
-#endif
-
        /*
         * This begins the section where we must prevent the parent
         * from being swapped.
        /*
         * This begins the section where we must prevent the parent
         * from being swapped.