qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] linux-user: Unconditionally use pipe2() syscall


From: Laurent Vivier
Subject: Re: [PATCH] linux-user: Unconditionally use pipe2() syscall
Date: Mon, 18 Jul 2022 21:12:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

Le 18/07/2022 à 18:34, Helge Deller a écrit :
The pipe2() syscall is available on all Linux platforms since kernel
2.6.27, so use it unconditionally to emulate pipe() and pipe2().

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index dbebfa4a8b..b27a6552aa 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1586,21 +1586,12 @@ static abi_long do_ppoll(abi_long arg1, abi_long arg2, 
abi_long arg3,
  }
  #endif

-static abi_long do_pipe2(int host_pipe[], int flags)
-{
-#ifdef CONFIG_PIPE2
-    return pipe2(host_pipe, flags);
-#else
-    return -ENOSYS;
-#endif
-}
-
  static abi_long do_pipe(CPUArchState *cpu_env, abi_ulong pipedes,
                          int flags, int is_pipe2)
  {
      int host_pipe[2];
      abi_long ret;
-    ret = is_pipe2 ? do_pipe2(host_pipe, flags) : pipe(host_pipe);

It doesn't apply cleanly:

It seems this patch is applied on top of the one you want to replace (is_pipe2 
rather than flags).

Thanks,
Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]