Source-Changes-HG archive

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

[src/trunk]: src/sys pass pointer to used exec_package to emulation-specific ...



details:   https://anonhg.NetBSD.org/src/rev/00722c5b436a
branches:  trunk
changeset: 499313:00722c5b436a
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Thu Nov 16 20:04:33 2000 +0000

description:
pass pointer to used exec_package to emulation-specific exec hook -
emulation code may make decisions based on e.g. exec format

diffstat:

 sys/kern/kern_exec.c |  8 ++++++--
 sys/sys/proc.h       |  4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r 593d34e895a5 -r 00722c5b436a sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Thu Nov 16 19:25:40 2000 +0000
+++ b/sys/kern/kern_exec.c      Thu Nov 16 20:04:33 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exec.c,v 1.122 2000/11/07 12:41:52 jdolecek Exp $ */
+/*     $NetBSD: kern_exec.c,v 1.123 2000/11/16 20:04:33 jdolecek Exp $ */
 
 /*-
  * Copyright (C) 1993, 1994, 1996 Christopher G. Demetriou
@@ -541,8 +541,12 @@
        if (p->p_emul && p->p_emul->e_proc_exit && p->p_emul != pack.ep_emul)
                (*p->p_emul->e_proc_exit)(p);
 
+       /*
+        * Call exec hook. Emulation code may NOT store reference to anything
+        * from &pack.
+        */
         if (pack.ep_emul->e_proc_exec)
-                (*pack.ep_emul->e_proc_exec)(p);
+                (*pack.ep_emul->e_proc_exec)(p, &pack);
 
        /* update p_emul, the old value is no longer needed */
        p->p_emul = pack.ep_emul;
diff -r 593d34e895a5 -r 00722c5b436a sys/sys/proc.h
--- a/sys/sys/proc.h    Thu Nov 16 19:25:40 2000 +0000
+++ b/sys/sys/proc.h    Thu Nov 16 20:04:33 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.107 2000/11/13 21:32:19 jdolecek Exp $      */
+/*     $NetBSD: proc.h,v 1.108 2000/11/16 20:04:33 jdolecek Exp $      */
 
 /*-
  * Copyright (c) 1986, 1989, 1991, 1993
@@ -105,7 +105,7 @@
        char    *e_esigcode;            /* End of sigcode */
 
        /* Per-process hooks */
-       void    (*e_proc_exec) __P((struct proc *));
+       void    (*e_proc_exec) __P((struct proc *, struct exec_package *));
        void    (*e_proc_fork) __P((struct proc *p, struct proc *parent));
        void    (*e_proc_exit) __P((struct proc *));
 };



Home | Main Index | Thread Index | Old Index