[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/5] implementations of dup3 and fallocate that are
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PATCH 1/5] implementations of dup3 and fallocate that are good enough to fool LTP |
Date: |
Fri, 16 Oct 2009 17:02:27 +0300 |
From: Ulrich Hecht <address@hidden>
updated fallocate check to new configure, added dup3 check as suggested
by Jan-Simon Möller.
Riku: updated to apply to current git.
Signed-off-by: Ulrich Hecht <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
configure | 36 ++++++++++++++++++++++++++++++++++++
linux-user/syscall.c | 10 ++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index ca6d45c..3df9d07 100755
--- a/configure
+++ b/configure
@@ -1569,6 +1569,36 @@ if compile_prog "" "" ; then
eventfd=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 for dup3
+dup3=no
+cat > $TMPC << EOF
+#include <unistd.h>
+
+int main(void)
+{
+ dup3(0, 0, 0);
+ return 0;
+}
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ dup3=yes
+fi
+
# Check if tools are available to build documentation.
if test "$docs" != "no" ; then
if test -x "`which texi2html 2>/dev/null`" -a \
@@ -1950,6 +1980,12 @@ fi
if test "$eventfd" = "yes" ; then
echo "CONFIG_EVENTFD=y" >> $config_host_mak
fi
+if test "$fallocate" = "yes" ; then
+ echo "CONFIG_FALLOCATE=y" >> $config_host_mak
+fi
+if test "$dup3" = "yes" ; then
+ echo "CONFIG_DUP3=y" >> $config_host_mak
+fi
if test "$inotify" = "yes" ; then
echo "CONFIG_INOTIFY=y" >> $config_host_mak
fi
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index bf06d14..d07c381 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4746,6 +4746,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
arg1,
case TARGET_NR_dup2:
ret = get_errno(dup2(arg1, arg2));
break;
+#if defined(CONFIG_DUP3) && defined(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());
@@ -7013,6 +7018,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
arg1,
break;
#endif
#endif /* CONFIG_EVENTFD */
+#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
- [Qemu-devel] [PATCH 0/5] linux-user updates., riku . voipio, 2009/10/16
- [Qemu-devel] [PATCH 3/5] linux-user: fix ppc target_stat64 st_blocks layout, riku . voipio, 2009/10/16
- [Qemu-devel] [PATCH 1/5] implementations of dup3 and fallocate that are good enough to fool LTP,
riku . voipio <=
- [Qemu-devel] [PATCH 4/5] linux-user: don't zero a buffer twice, riku . voipio, 2009/10/16
- [Qemu-devel] [PATCH 2/5] linux-user: getpriority errno fix, riku . voipio, 2009/10/16
- [Qemu-devel] [PATCH 5/5] linux-user: Update ARM hwcaps, riku . voipio, 2009/10/16
- Re: [Qemu-devel] [PATCH 0/5] linux-user updates., Edgar E. Iglesias, 2009/10/17