bsd-user: implement path searching

Use the PATH to find the executable given a bare argument. We need to do
this so we can implement mixing native and emulated binaries (e.g.,
execing a x86 native binary from an emulated arm binary to optimize
parts of the build). By finding the binary, we will know how to exec it.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Warner Losh 2021-04-29 19:34:34 -06:00
parent 223005f058
commit 1b50ff64a5
2 changed files with 37 additions and 2 deletions

View file

@ -124,7 +124,8 @@ struct bsd_binprm {
int argc, envc;
char **argv;
char **envp;
char *filename; /* Name of binary */
char *filename; /* (Given) Name of binary */
char *fullpath; /* Full path of binary */
};
void do_init_thread(struct target_pt_regs *regs, struct image_info *infop);