diff options
| author | dsl <dsl@NetBSD.org> | 2007-04-22 08:29:55 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2007-04-22 08:29:55 +0000 |
| commit | b8fbaf8c4be690d029da1be20006f487e2f81b17 (patch) | |
| tree | 68186d3317175dfd95f7baa39a60030c8364e661 /sys/compat/linux/common/linux_exec_elf32.c | |
| parent | 98e922db67056a5d00e1de9d956eb8f21f649172 (diff) | |
Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
- which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
search for absolute pathnames in the emulation root, if that fails it will
retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
the real root is returned instead (matching the behaviour of emul_lookup,
but being a cheap comparison here) so that programs that scan "../.."
looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
Diffstat (limited to 'sys/compat/linux/common/linux_exec_elf32.c')
| -rw-r--r-- | sys/compat/linux/common/linux_exec_elf32.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/compat/linux/common/linux_exec_elf32.c b/sys/compat/linux/common/linux_exec_elf32.c index 9031b4769b5..d4450e1842e 100644 --- a/sys/compat/linux/common/linux_exec_elf32.c +++ b/sys/compat/linux/common/linux_exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec_elf32.c,v 1.78 2007/03/04 06:01:23 christos Exp $ */ +/* $NetBSD: linux_exec_elf32.c,v 1.79 2007/04/22 08:29:57 dsl Exp $ */ /*- * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.78 2007/03/04 06:01:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.79 2007/04/22 08:29:57 dsl Exp $"); #ifndef ELFSIZE /* XXX should die */ @@ -392,8 +392,7 @@ ELFNAME2(linux,probe)(struct lwp *l, struct exec_package *epp, void *eh, } if (itp) { - if ((error = emul_find_interp(l, epp->ep_esch->es_emul->e_path, - itp))) + if ((error = emul_find_interp(l, epp, itp))) return (error); } DPRINTF(("linux_probe: returning 0\n")); |
