qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Oliver Smith <ollieparanoid@bitmessage.ch>,
	qemu-devel@nongnu.org, peter.maydell@linaro.org
Cc: zhuoweizhang@yahoo.com
Subject: Re: [Qemu-devel] [PATCH] syscall: fix special case of write(fd, NULL, 0)
Date: Thu, 15 Feb 2018 09:50:20 +0100	[thread overview]
Message-ID: <3fbe94a4-a378-b0ee-b504-fad5d3de630c@vivier.eu> (raw)
In-Reply-To: <faca1d54-8c99-cece-b427-b994307516dd@bitmessage.ch>

Le 15/02/2018 à 00:33, Oliver Smith a écrit :
> Hello there,
> 
> I'm a little late to the party. But what is necessary to get this
> upstreamed, and how can I help?
> 
> PS: Sorry if I picked the wrong e-mail addresses, I wasn't subscribed to
> the ML at that point and used the addresses I could find for the people
> who answered to the original thread here:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg08073.html

According to comments in the ML thread, you need to:

- update the patch to call write() with NULL and 0, something like:

--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7912,6 +7912,10 @@ abi_long do_syscall(void *cpu_env, int num,
abi_long arg1,
         }
         break;
     case TARGET_NR_write:
+        if (arg2 == 0 && arg3 == 0) {
+            ret = get_errno(safe_write(arg1, NULL, 0));
+            break;
+        }
         if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
             goto efault;
         if (fd_trans_target_to_host_data(arg1)) {

- change TARGET_NR_read to do the same

- check if we need to do the same for pread64/pwrite64

Thanks,
Laurent

  reply	other threads:[~2018-02-15  8:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 23:33 [Qemu-devel] [PATCH] syscall: fix special case of write(fd, NULL, 0) Oliver Smith
2018-02-15  8:50 ` Laurent Vivier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-09-29 16:50 zhuoweizhang
2017-09-29 19:14 ` Laurent Vivier
2017-09-29 19:49   ` Peter Maydell
2017-09-29 23:33   ` Carlo Arenas
2017-09-29 23:38     ` Peter Maydell

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=3fbe94a4-a378-b0ee-b504-fad5d3de630c@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=ollieparanoid@bitmessage.ch \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhuoweizhang@yahoo.com \
    /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).