Re: [PATCH v3 2/8] linux-user: Add "safe" parameter to do_guest_openat()

2023-06-06 Thread Richard Henderson
On 6/6/23 12:29, Ilya Leoshkevich wrote: The only concrete objection I have is the change of API, which could be fixed with return get_errno(openat(...)). I believe both openat() and safe_openat() return -1 on error and set errno, or am I missing something? Oops, no, bad memory on my part --

Re: [PATCH v3 2/8] linux-user: Add "safe" parameter to do_guest_openat()

2023-06-06 Thread Ilya Leoshkevich
On Tue, 2023-06-06 at 11:24 -0700, Richard Henderson wrote: > On 6/6/23 06:27, Ilya Leoshkevich wrote: > > @@ -8518,7 +8522,11 @@ int do_guest_openat(CPUArchState *cpu_env, > > int dirfd, const char *pathname, > >   return fd; > >   } > >   > > -    return safe_openat(dirfd,

Re: [PATCH v3 2/8] linux-user: Add "safe" parameter to do_guest_openat()

2023-06-06 Thread Richard Henderson
On 6/6/23 06:27, Ilya Leoshkevich wrote: @@ -8518,7 +8522,11 @@ int do_guest_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, return fd; } -return safe_openat(dirfd, path(pathname), flags, mode); +if (safe) { +return safe_openat(dirfd,

[PATCH v3 2/8] linux-user: Add "safe" parameter to do_guest_openat()

2023-06-06 Thread Ilya Leoshkevich
gdbstub cannot meaningfully handle QEMU_ERESTARTSYS, and it doesn't need to. Add a parameter to do_guest_openat() that makes it use openat() instead of safe_openat(), so that it becomes usable from gdbstub. Signed-off-by: Ilya Leoshkevich --- linux-user/qemu.h| 2 +- linux-user/syscall.c |