linux-user: Add support for syncfs() syscall
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 <aleksandar.markovic@imgtec.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
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 1492996..14c5207 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8090,6 +8090,11 @@
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;