[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 15/22] linux-user: Add support for syncfs() syscal
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL v2 15/22] linux-user: Add support for syncfs() syscall |
Date: |
Tue, 18 Oct 2016 16:21:43 +0300 |
From: Aleksandar Markovic <address@hidden>
This patch implements Qemu user mode syncfs() syscall support. Syscall
syncfs() syncs the filesystem containing file determined by the open
file descriptor passed as the argument to syncfs().
The implementation consists of a straightforward invocation of host's
syncfs(). Configure and strace support is included as well.
Signed-off-by: Aleksandar Markovic <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
configure | 18 ++++++++++++++++++
linux-user/strace.list | 2 +-
linux-user/syscall.c | 5 +++++
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 1ce3d00..d3dafcb 100755
--- a/configure
+++ b/configure
@@ -3926,6 +3926,21 @@ if compile_prog "" "" ; then
clock_adjtime=yes
fi
+# syncfs probe
+syncfs=no
+cat > $TMPC <<EOF
+#include <unistd.h>
+
+int main(void)
+{
+ return syncfs(0);
+}
+EOF
+syncfs=no
+if compile_prog "" "" ; then
+ syncfs=yes
+fi
+
# Check if tools are available to build documentation.
if test "$docs" != "no" ; then
if has makeinfo && has pod2man; then
@@ -5214,6 +5229,9 @@ fi
if test "$clock_adjtime" = "yes" ; then
echo "CONFIG_CLOCK_ADJTIME=y" >> $config_host_mak
fi
+if test "$syncfs" = "yes" ; then
+ echo "CONFIG_SYNCFS=y" >> $config_host_mak
+fi
if test "$inotify" = "yes" ; then
echo "CONFIG_INOTIFY=y" >> $config_host_mak
fi
diff --git a/linux-user/strace.list b/linux-user/strace.list
index dcd3812..3b1282e 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -1459,7 +1459,7 @@
{ TARGET_NR_sync, "sync" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_syncfs
-{ TARGET_NR_syncfs, "syncfs" , NULL, NULL, NULL },
+{ TARGET_NR_syncfs, "syncfs" , "%s(%d)", NULL, NULL },
#endif
#ifdef TARGET_NR_syscall
{ TARGET_NR_syscall, "syscall" , NULL, NULL, NULL },
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 28d2b8e..d85a0b5 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8091,6 +8091,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
arg1,
sync();
ret = 0;
break;
+#if defined(TARGET_NR_syncfs) && defined(CONFIG_SYNCFS)
+ case TARGET_NR_syncfs:
+ ret = get_errno(syncfs(arg1));
+ break;
+#endif
case TARGET_NR_kill:
ret = get_errno(safe_kill(arg1, target_to_host_signal(arg2)));
break;
--
2.1.4
- [Qemu-devel] [PULL v2 11/22] linux-user: Don't use alloca() for epoll_wait's epoll event array, (continued)
- [Qemu-devel] [PULL v2 11/22] linux-user: Don't use alloca() for epoll_wait's epoll event array, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 08/22] linux-user: sparc64: Use correct target SHMLBA in shmat(), riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 12/22] linux-user: use libc wrapper instead of direct mremap syscall, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 13/22] linux-user: Fix definition of target_sigevent for 32-bit guests, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 09/22] linux-user: add kcmp() syscall, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 16/22] linux-user: Update mips_syscall_args[] array in main.c, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 06/22] linux-user: Fix syslog() syscall support, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 10/22] linux-user: add RTA_PRIORITY in netlink, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 14/22] linux-user: Add support for clock_adjtime() syscall, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 19/22] linux-user: Fix fadvise64() syscall support for Mips32, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 15/22] linux-user: Add support for syncfs() syscall,
riku . voipio <=
- [Qemu-devel] [PULL v2 17/22] linux-user: Update ioctls definitions for Mips32, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 18/22] linux-user: Redirect termbits.h for Mips64 to termbits.h for Mips32, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 22/22] linux-user: disable unicore32 linux-user build, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 20/22] linux-user: added support for preadv() system call., riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 21/22] linux-user: added support for pwritev() system call., riku . voipio, 2016/10/18
- Re: [Qemu-devel] [PULL v2 00/22] linux-user changes, Peter Maydell, 2016/10/18