From: Ulrich Hecht <uli@suse.de>
To: qemu-devel@nongnu.org
Cc: riku.voipio@iki.fi
Subject: [Qemu-devel] [PATCH 1/7] linux-user: dup3, fallocate syscalls
Date: Fri, 24 Jul 2009 19:10:26 +0200 [thread overview]
Message-ID: <1248455432-12959-2-git-send-email-uli@suse.de> (raw)
In-Reply-To: <1248455432-12959-1-git-send-email-uli@suse.de>
implementations of dup3 and fallocate that are good enough to fool LTP
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
configure | 18 ++++++++++++++++++
linux-user/syscall.c | 10 ++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index 09c8443..68a18f5 100755
--- a/configure
+++ b/configure
@@ -1371,6 +1371,21 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
splice=yes
fi
+# check for fallocate
+fallocate=no
+cat > $TMPC << EOF
+#include <fcntl.h>
+
+int main(void)
+{
+ fallocate(0, 0, 0, 0);
+ return 0;
+}
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ fallocate=yes
+fi
+
# Check if tools are available to build documentation.
if test "$build_docs" = "yes" -a \( ! -x "`which texi2html 2>/dev/null`" -o ! -x "`which pod2man 2>/dev/null`" \) ; then
build_docs="no"
@@ -1720,6 +1735,9 @@ fi
if test "$splice" = "yes" ; then
echo "#define CONFIG_SPLICE 1" >> $config_host_h
fi
+if test "$fallocate" = "yes" ; then
+ echo "#define CONFIG_FALLOCATE 1" >> $config_host_h
+fi
if test "$inotify" = "yes" ; then
echo "#define CONFIG_INOTIFY 1" >> $config_host_h
fi
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ca57dd9..b03e879 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4723,6 +4723,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_dup2:
ret = get_errno(dup2(arg1, arg2));
break;
+#ifdef TARGET_NR_dup3
+ case TARGET_NR_dup3:
+ ret = get_errno(dup3(arg1, arg2, arg3));
+ break;
+#endif
#ifdef TARGET_NR_getppid /* not on alpha */
case TARGET_NR_getppid:
ret = get_errno(getppid());
@@ -6975,6 +6980,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
break;
#endif
#endif /* CONFIG_SPLICE */
+#if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate)
+ case TARGET_NR_fallocate:
+ ret = get_errno(fallocate(arg1, arg2, arg3, arg4));
+ break;
+#endif
default:
unimplemented:
gemu_log("qemu: Unsupported syscall: %d\n", num);
--
1.6.2.1
next prev parent reply other threads:[~2009-07-24 17:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 17:10 [Qemu-devel] [PATCH 0/7] linux-user syscall fixes Ulrich Hecht
2009-07-24 17:10 ` Ulrich Hecht [this message]
2009-07-24 17:10 ` [Qemu-devel] [PATCH 2/7] linux-user: fcntl fixes for LTP Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 3/7] linux-user: enable getdents for > 32-bit systems Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 4/7] linux-user: define a couple of syscalls for non-uid16 targets Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 5/7] linux-user: getpriority errno fix Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 6/7] linux-user: fadvise64 implementation Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 7/7] linux-user: zero fstat buffer to initialize nsec fields Ulrich Hecht
2009-07-25 22:37 ` [Qemu-devel] [PATCH 1/7] linux-user: dup3, fallocate syscalls Jan-Simon Möller
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=1248455432-12959-2-git-send-email-uli@suse.de \
--to=uli@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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).