Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Do syscall_intern after p_traceflag has been copied...



details:   https://anonhg.NetBSD.org/src/rev/e9e70f2f61b6
branches:  trunk
changeset: 501973:e9e70f2f61b6
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Tue Jan 09 23:36:50 2001 +0000

description:
Do syscall_intern after p_traceflag has been copied to the new
process (if it is inherited), so that ktrace continues to work
properly on the child.

diffstat:

 sys/kern/kern_fork.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r f619e0e64ec9 -r e9e70f2f61b6 sys/kern/kern_fork.c
--- a/sys/kern/kern_fork.c      Tue Jan 09 23:29:22 2001 +0000
+++ b/sys/kern/kern_fork.c      Tue Jan 09 23:36:50 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_fork.c,v 1.82 2000/12/31 17:43:41 ad Exp $        */
+/*     $NetBSD: kern_fork.c,v 1.83 2001/01/09 23:36:50 fvdl Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -198,9 +198,7 @@
         */
        p2->p_flag = P_INMEM | (p1->p_flag & P_SUGID);
        p2->p_emul = p1->p_emul;
-#ifdef __HAVE_SYSCALL_INTERN
-       (*p2->p_emul->e_syscall_intern)(p2);
-#endif
+
        if (p1->p_flag & P_PROFIL)
                startprofclock(p2);
        p2->p_cred = pool_get(&pcred_pool, PR_WAITOK);
@@ -253,12 +251,17 @@
         * Copy traceflag and tracefile if enabled.
         * If not inherited, these were zeroed above.
         */
-       if (p1->p_traceflag&KTRFAC_INHERIT) {
+       if (p1->p_traceflag & KTRFAC_INHERIT) {
                p2->p_traceflag = p1->p_traceflag;
                if ((p2->p_tracep = p1->p_tracep) != NULL)
                        ktradref(p2);
        }
 #endif
+
+#ifdef __HAVE_SYSCALL_INTERN
+       (*p2->p_emul->e_syscall_intern)(p2);
+#endif
+
        scheduler_fork_hook(p1, p2);
 
        /*



Home | Main Index | Thread Index | Old Index