[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/12] linux-user: dup3, fallocate syscalls
From: |
Ulrich Hecht |
Subject: |
[Qemu-devel] [PATCH 09/12] linux-user: dup3, fallocate syscalls |
Date: |
Wed, 21 Oct 2009 15:52:30 +0200 |
implementations of dup3 and fallocate that are good enough to fool LTP
dup3 check, fallocate check fixed
use compile_prog
Signed-off-by: Ulrich Hecht <address@hidden>
---
configure | 36 ++++++++++++++++++++++++++++++++++++
linux-user/syscall.c | 10 ++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index 64be51f..30ecd8f 100755
--- a/configure
+++ b/configure
@@ -1573,6 +1573,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 compile_prog "" "" ; 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 compile_prog "" "" ; 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 \
@@ -1954,6 +1984,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 f2a53d5..4991154 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4747,6 +4747,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(TARGET_NR_dup3) && defined(CONFIG_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());
@@ -7022,6 +7027,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 00/12] S/390 support, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 01/12] TCG "sync" op, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 02/12] S/390 disassembler fixes, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 03/12] S/390 CPU emulation, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 04/12] S/390 host build system support, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 05/12] S/390 target build system support, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 06/12] S/390 host support for TCG, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 07/12] linux-user: S/390 64-bit (s390x) support, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 08/12] linux-user: don't do locking in single-threaded processes, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 09/12] linux-user: dup3, fallocate syscalls,
Ulrich Hecht <=
- [Qemu-devel] [PATCH 10/12] linux-user: define a couple of syscalls for non-uid16 targets, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 11/12] linux-user: getpriority errno fix, Ulrich Hecht, 2009/10/21
- [Qemu-devel] [PATCH 12/12] enable CPU_QuadU for s390x, Ulrich Hecht, 2009/10/21
- Re: [Qemu-devel] [PATCH 02/12] S/390 disassembler fixes, Aurelien Jarno, 2009/10/22
[Qemu-devel] Re: [PATCH 01/12] TCG "sync" op, Aurelien Jarno, 2009/10/22