Source-Changes-HG archive

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

[src/trunk]: src/sys add e_path (emulation path) to struct emul, which replac...



details:   https://anonhg.NetBSD.org/src/rev/51f83a3b1b64
branches:  trunk
changeset: 499887:51f83a3b1b64
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri Dec 01 12:28:30 2000 +0000

description:
add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now

diffstat:

 sys/compat/aout/aout_exec.c                   |   4 +-
 sys/compat/aout/aout_misc.c                   |  94 +++++++++++++-------------
 sys/compat/aout/aout_util.h                   |  58 ----------------
 sys/compat/common/compat_util.h               |  10 +-
 sys/compat/freebsd/freebsd_exec.c             |   7 +-
 sys/compat/freebsd/freebsd_file.c             |  76 ++++++++++-----------
 sys/compat/freebsd/freebsd_ioctl.c            |   4 +-
 sys/compat/freebsd/freebsd_misc.c             |   4 +-
 sys/compat/freebsd/freebsd_ptrace.c           |   4 +-
 sys/compat/freebsd/freebsd_util.h             |  88 -------------------------
 sys/compat/hpux/hpux_exec.c                   |   8 +-
 sys/compat/hpux/hpux_file.c                   |  40 +++++-----
 sys/compat/hpux/hpux_util.h                   |  10 +--
 sys/compat/ibcs2/ibcs2_exec.c                 |  10 +-
 sys/compat/ibcs2/ibcs2_fcntl.c                |  12 +-
 sys/compat/ibcs2/ibcs2_misc.c                 |  32 ++++----
 sys/compat/ibcs2/ibcs2_stat.c                 |  10 +-
 sys/compat/ibcs2/ibcs2_util.h                 |  16 ++--
 sys/compat/linux/common/linux_exec.c          |   7 +-
 sys/compat/linux/common/linux_exec_aout.c     |   4 +-
 sys/compat/linux/common/linux_exec_elf32.c    |   5 +-
 sys/compat/linux/common/linux_file.c          |  38 +++++-----
 sys/compat/linux/common/linux_misc.c          |   4 +-
 sys/compat/linux/common/linux_misc_notalpha.c |   4 +-
 sys/compat/linux/common/linux_util.h          |  10 +--
 sys/compat/netbsd32/netbsd32.h                |   8 +--
 sys/compat/netbsd32/netbsd32_compat_12.c      |   6 +-
 sys/compat/netbsd32/netbsd32_compat_43.c      |   8 +-
 sys/compat/netbsd32/netbsd32_exec.c           |   6 +-
 sys/compat/netbsd32/netbsd32_netbsd.c         |  16 ++--
 sys/compat/osf1/osf1_cvt.c                    |   4 +-
 sys/compat/osf1/osf1_exec.c                   |   7 +-
 sys/compat/osf1/osf1_file.c                   |  24 +++---
 sys/compat/osf1/osf1_misc.c                   |   6 +-
 sys/compat/osf1/osf1_mount.c                  |   4 +-
 sys/compat/osf1/osf1_signal.c                 |   4 +-
 sys/compat/osf1/osf1_socket.c                 |   4 +-
 sys/compat/osf1/osf1_util.h                   |  16 ----
 sys/compat/pecoff/pecoff_exec.c               |  13 +--
 sys/compat/pecoff/pecoff_util.h               |  10 +--
 sys/compat/sunos/sunos_exec.c                 |   4 +-
 sys/compat/sunos/sunos_ioctl.c                |   4 +-
 sys/compat/sunos/sunos_misc.c                 |  24 +++---
 sys/compat/sunos/sunos_util.h                 |  79 ----------------------
 sys/compat/svr4/svr4_exec.c                   |   7 +-
 sys/compat/svr4/svr4_fcntl.c                  |  10 +-
 sys/compat/svr4/svr4_misc.c                   |  12 +-
 sys/compat/svr4/svr4_stat.c                   |  20 ++--
 sys/compat/svr4/svr4_util.h                   |  10 +--
 sys/compat/ultrix/ultrix_misc.c               |   3 +-
 sys/compat/ultrix/ultrix_pathname.c           |  25 +++---
 sys/compat/ultrix/ultrix_util.h               |  79 ----------------------
 sys/kern/kern_exec.c                          |   3 +-
 sys/sys/proc.h                                |  11 ++-
 54 files changed, 314 insertions(+), 672 deletions(-)

diffs (truncated from 3030 to 300 lines):

diff -r 8213ea37ad54 -r 51f83a3b1b64 sys/compat/aout/aout_exec.c
--- a/sys/compat/aout/aout_exec.c       Fri Dec 01 12:03:27 2000 +0000
+++ b/sys/compat/aout/aout_exec.c       Fri Dec 01 12:28:30 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aout_exec.c,v 1.4 2000/11/21 00:37:52 jdolecek Exp $   */
+/*     $NetBSD: aout_exec.c,v 1.5 2000/12/01 12:28:31 jdolecek Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -46,7 +46,6 @@
 
 #include <compat/aout/aout_syscall.h>
  
-const char aout_emul_path[] = "/emul/aout";
 extern struct sysent aout_sysent[];
 #ifdef SYSCALL_DEBUG
 extern const char * const aout_syscallnames[];
@@ -56,6 +55,7 @@
 
 struct emul emul_netbsd_aout = {
        "netbsd",
+       "/emul/aout",
        NULL,
        sendsig,
        AOUT_SYS_syscall,
diff -r 8213ea37ad54 -r 51f83a3b1b64 sys/compat/aout/aout_misc.c
--- a/sys/compat/aout/aout_misc.c       Fri Dec 01 12:03:27 2000 +0000
+++ b/sys/compat/aout/aout_misc.c       Fri Dec 01 12:28:30 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aout_misc.c,v 1.3 1999/03/15 23:50:07 thorpej Exp $    */
+/*     $NetBSD: aout_misc.c,v 1.4 2000/12/01 12:28:31 jdolecek Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
 #include <sys/syscall.h>
 #include <sys/syscallargs.h>
 
-#include <compat/aout/aout_util.h>
+#include <compat/common/compat_util.h>
 #include <compat/aout/aout_syscall.h>
 #include <compat/aout/aout_syscallargs.h>
 
@@ -69,10 +69,10 @@
 
 #if 0
        if (SCARG(uap, flags) & O_CREAT)
-               AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+               CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
        else 
 #endif
-               AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+               CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_open(p, v, retval);
 }
@@ -88,7 +88,7 @@
        struct aout_sys_creat_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+       CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
 #endif
 
        return compat_43_sys_creat(p, v, retval);
@@ -104,9 +104,9 @@
        struct aout_sys_link_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 #if 0
-       AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, link));
+       CHECK_ALT_CREAT(p, &sg, SCARG(uap, link));
 #endif
 
        return sys_link(p, v, retval);
@@ -122,7 +122,7 @@
        struct aout_sys_unlink_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_unlink(p, v, retval);
 }
@@ -137,7 +137,7 @@
        struct aout_sys_chdir_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_chdir(p, v, retval);
 }
@@ -153,7 +153,7 @@
        struct aout_sys_mknod_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+       CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
 #endif
 
        return sys_mknod(p, v, retval);
@@ -169,7 +169,7 @@
        struct aout_sys_chmod_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_chmod(p, v, retval);
 }
@@ -184,7 +184,7 @@
        struct aout_sys_chown_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_chown(p, v, retval);
 }
@@ -204,7 +204,7 @@
        struct aout_sys_mount_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 #endif
 
        return sys_mount(p, v, retval);
@@ -220,7 +220,7 @@
        struct aout_sys_unmount_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_unmount(p, v, retval);
 }
@@ -235,7 +235,7 @@
        struct aout_sys_access_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_access(p, v, retval);
 }
@@ -250,7 +250,7 @@
        struct aout_sys_chflags_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_chflags(p, v, retval);
 }
@@ -265,7 +265,7 @@
        struct aout_compat_43_sys_stat_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return compat_43_sys_stat(p, v, retval);
 }
@@ -280,7 +280,7 @@
        struct aout_compat_43_sys_lstat_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return compat_43_sys_lstat(p, v, retval);
 }
@@ -296,7 +296,7 @@
        struct aout_sys_ktrace_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, fname));
+       CHECK_ALT_CREAT(p, &sg, SCARG(uap, fname));
 #endif
 
        return sys_ktrace(p, v, retval);
@@ -314,7 +314,7 @@
        struct aout_sys_acct_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+       CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
 #endif
 
        return sys_acct(p, v, retval);
@@ -330,7 +330,7 @@
        struct aout_sys_revoke_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_revoke(p, v, retval);
 }
@@ -345,9 +345,9 @@
        struct aout_sys_symlink_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 #if 0
-       AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, link));
+       CHECK_ALT_CREAT(p, &sg, SCARG(uap, link));
 #endif
 
        return sys_symlink(p, v, retval);
@@ -363,7 +363,7 @@
        struct aout_sys_readlink_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_readlink(p, v, retval);
 }
@@ -378,7 +378,7 @@
        struct aout_sys_execve_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_execve(p, v, retval);
 }
@@ -393,7 +393,7 @@
        struct aout_sys_chroot_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_chroot(p, v, retval);
 }
@@ -408,9 +408,9 @@
        struct aout_sys_rename_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, from));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, from));
 #if 0
-       AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, to));
+       CHECK_ALT_CREAT(p, &sg, SCARG(uap, to));
 #endif
 
        return sys_rename(p, v, retval);
@@ -426,7 +426,7 @@
        struct aout_compat_43_sys_truncate_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return compat_43_sys_truncate(p, v, retval);
 }
@@ -442,7 +442,7 @@
        struct aout_sys_mkfifo_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+       CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
 #endif
 
        return sys_mkfifo(p, v, retval);
@@ -459,7 +459,7 @@
        struct aout_sys_mkdir_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+       CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
 #endif
 
        return sys_mkdir(p, v, retval);
@@ -475,7 +475,7 @@
        struct aout_sys_rmdir_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_rmdir(p, v, retval);
 }
@@ -490,7 +490,7 @@
        struct aout_sys_utimes_args *uap = v;
        caddr_t sg = stackgap_init(p->p_emul);
 
-       AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+       CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        return sys_utimes(p, v, retval);
 }
@@ -506,7 +506,7 @@



Home | Main Index | Thread Index | Old Index