From: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
To: qemu-devel@nongnu.org
Cc: zhuoweizhang@yahoo.com, laurent@vivier.eu,
peter.maydell@linaro.com,
"Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Subject: [Qemu-devel] [PATCH] linux-user: fix special case pwrite64 with count = 0
Date: Sat, 30 Sep 2017 17:34:42 -0700 [thread overview]
Message-ID: <20171001003442.26211-1-carenas@gmail.com> (raw)
building on the work from Zhuowei Zhang for making write return 0 instead
of -1 when called with: write(fd, NULL, 0)
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
linux-user/syscall.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9b6364a266..89e883f187 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -10509,6 +10509,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
arg4 = arg5;
arg5 = arg6;
}
+ if (arg2 == 0 && arg3 == 0) {
+ ret = get_errno(pwrite64(arg1, NULL, arg3, target_offset64(arg4, arg5)));
+ break;
+ }
if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
goto efault;
ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5)));
--
2.14.2
reply other threads:[~2017-10-01 0:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20171001003442.26211-1-carenas@gmail.com \
--to=carenas@gmail.com \
--cc=laurent@vivier.eu \
--cc=peter.maydell@linaro.com \
--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).