From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF5K4-0000pg-3d for qemu-devel@nongnu.org; Mon, 20 Jun 2016 15:57:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF5Jz-0007cv-Ng for qemu-devel@nongnu.org; Mon, 20 Jun 2016 15:57:26 -0400 Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]:35518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF5Jz-0007cr-Ix for qemu-devel@nongnu.org; Mon, 20 Jun 2016 15:57:23 -0400 Received: by mail-io0-x232.google.com with SMTP id f30so132021841ioj.2 for ; Mon, 20 Jun 2016 12:57:23 -0700 (PDT) References: <1465932382-28645-1-git-send-email-joel.holdsworth@vcatechnology.com> <1465932382-28645-4-git-send-email-joel.holdsworth@vcatechnology.com> <44f0f73f-3630-5047-1d31-d7dff8a842c4@vivier.eu> From: Joel Holdsworth Message-ID: <57684AA2.20503@vcatechnology.com> Date: Mon, 20 Jun 2016 20:57:22 +0100 MIME-Version: 1.0 In-Reply-To: <44f0f73f-3630-5047-1d31-d7dff8a842c4@vivier.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 3/4] linux-user: pass elf interpreter prefix in execve List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org Cc: riku.voipio@iki.fi, Vasileios.Kalintiris@imgtec.com On 15/06/16 21:06, Laurent Vivier wrote: > More details: why do we need this? > > Add your Signed-off-by. > > Le 14/06/2016 à 21:26, Joel Holdsworth a écrit : >> --- >> linux-user/syscall.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/linux-user/syscall.c b/linux-user/syscall.c >> index 440986e..1513f0f 100644 >> --- a/linux-user/syscall.c >> +++ b/linux-user/syscall.c >> @@ -6667,7 +6667,7 @@ static abi_long qemu_execve(char *filename, char *argv[], >> char *i_arg = NULL, *i_name = NULL; >> char **qemu_argp, **argp; >> int i, j; >> - size_t qemu_argc = 3, argc, host_envc, envpc; >> + size_t qemu_argc = 5, argc, host_envc, envpc; >> int fd, ret; >> char *cp; >> size_t def_envc = 0, undef_envc = 0; >> @@ -6782,6 +6782,8 @@ static abi_long qemu_execve(char *filename, char *argv[], >> >> /* set up the qemu arguments */ >> *argp++ = strdup(qemu_execve_path); >> + *argp++ = strdup("-L"); >> + *argp++ = strdup(path("/")); > why "/"? > > You should propagate the one from the parent (if != NULL). path("/") seems to be the easiest way to get access to 'static struct pathelem *base' in util/path.c, which is set from the parent's -L in init_paths.