qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Helge Deller <deller@gmx.de>,
	qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PATCH v2 2/3] linux-user: Fix accept4(SOCK_NONBLOCK) syscall
Date: Sat, 8 Jul 2023 07:40:25 +0100	[thread overview]
Message-ID: <b62134eb-773c-3b97-f310-dd04a45ddaee@linaro.org> (raw)
In-Reply-To: <20230708054249.10245-3-deller@gmx.de>

On 7/8/23 06:42, Helge Deller wrote:
> The Linux accept4() syscall allows two flags only: SOCK_NONBLOCK and
> SOCK_CLOEXEC, and returns -EINVAL if any other bits have been set.
> 
> Change the qemu implementation accordingly, which means we can not use
> the fcntl_flags_tbl[] translation table which allows too many other
> values.
> 
> Beside the correction in behaviour, this actually fixes the accept4()
> emulation for hppa, mips and alpha targets for which SOCK_NONBLOCK is
> different than TARGET_SOCK_NONBLOCK (aka O_NONBLOCK).
> 
> The fix can be verified with the testcase of the debian lwt package,
> which hangs forever in a read() syscall without this patch.
> 
> Signed-off-by: Helge Deller<deller@gmx.de>
> ---
>   linux-user/syscall.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


  reply	other threads:[~2023-07-08  6:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-08  5:42 [PATCH v2 0/3] linux-user: Fix fcntl64() and accept4() for 32-bit targets Helge Deller
2023-07-08  5:42 ` [PATCH v2 1/3] linux-user: Fix fcntl() and fcntl64() to return O_LARGEFILE " Helge Deller
2023-07-08  6:39   ` Richard Henderson
2023-07-08  5:42 ` [PATCH v2 2/3] linux-user: Fix accept4(SOCK_NONBLOCK) syscall Helge Deller
2023-07-08  6:40   ` Richard Henderson [this message]
2023-07-09 18:03   ` Michael Tokarev
2023-07-08  5:42 ` [PATCH v2 3/3] linux-user: Improve strace output of pread64() and pwrite64() Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b62134eb-773c-3b97-f310-dd04a45ddaee@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=deller@gmx.de \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).