summary refs log tree commit diff stats
path: root/bsd-user/main.c
diff options
context:
space:
mode:
authorDoug Rabson <dfr@rabson.org>2022-12-08 14:21:52 +0000
committerWarner Losh <imp@bsdimp.com>2024-07-23 10:50:54 -0600
commite6e102b972c5228d9d50b3208b83b025ccfd1455 (patch)
tree1ee4a827d481bb8fa265ce4184295a4e42b3b141 /bsd-user/main.c
parentce6c541dcb8aff5ca6f02bb64b0d6b6753becab4 (diff)
downloadfocaccia-qemu-e6e102b972c5228d9d50b3208b83b025ccfd1455.tar.gz
focaccia-qemu-e6e102b972c5228d9d50b3208b83b025ccfd1455.zip
bsd-user: Simplify the implementation of execve
This removes the logic which prepends the emulator to each call to
execve and fexecve. This is not necessary with the existing
imgact_binmisc support and it avoids the need to install the emulator
binary into jail environments when using 'binmiscctl --pre-open'.

Signed-off-by: Doug Rabson <dfr@rabson.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'bsd-user/main.c')
-rw-r--r--bsd-user/main.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/bsd-user/main.c b/bsd-user/main.c
index dcad266c2c..82e94a0316 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -90,7 +90,6 @@ unsigned long reserved_va;
 
 const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
 const char *qemu_uname_release;
-char qemu_proc_pathname[PATH_MAX];  /* full path to exeutable */
 
 unsigned long target_maxtsiz = TARGET_MAXTSIZ;   /* max text size */
 unsigned long target_dfldsiz = TARGET_DFLDSIZ;   /* initial data size limit */
@@ -247,22 +246,6 @@ adjust_ssize(void)
     setrlimit(RLIMIT_STACK, &rl);
 }
 
-static void save_proc_pathname(char *argv0)
-{
-    int mib[4];
-    size_t len;
-
-    mib[0] = CTL_KERN;
-    mib[1] = KERN_PROC;
-    mib[2] = KERN_PROC_PATHNAME;
-    mib[3] = -1;
-
-    len = sizeof(qemu_proc_pathname);
-    if (sysctl(mib, 4, qemu_proc_pathname, &len, NULL, 0)) {
-        perror("sysctl");
-    }
-}
-
 int main(int argc, char **argv)
 {
     const char *filename;
@@ -292,7 +275,6 @@ int main(int argc, char **argv)
         usage();
     }
 
-    save_proc_pathname(argv[0]);
 
     error_init(argv[0]);
     module_call_init(MODULE_INIT_TRACE);