summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Hecht <uli@suse.de>2009-07-24 19:10:31 +0200
committerRiku Voipio <riku.voipio@iki.fi>2009-08-25 17:15:35 +0300
commite72d2cc781f335474fe07234051b64ec314714f4 (patch)
treea5533916603225cd33a12a378dddbb610553b622 /linux-user
parentlinux-user: enable getdents for > 32-bit systems (diff)
downloadqemu-kvm-e72d2cc781f335474fe07234051b64ec314714f4.tar.gz
qemu-kvm-e72d2cc781f335474fe07234051b64ec314714f4.tar.bz2
qemu-kvm-e72d2cc781f335474fe07234051b64ec314714f4.zip
linux-user: fadvise64 implementation
good enough to pass all LTP fadvise64 tests Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a7de15470..7eb09fa8d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6567,12 +6567,23 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
arg4 = temp;
}
#endif
-#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64)
+#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64) || defined(TARGET_NR_fadvise64)
#ifdef TARGET_NR_fadvise64_64
case TARGET_NR_fadvise64_64:
#endif
- /* This is a hint, so ignoring and returning success is ok. */
- ret = get_errno(0);
+#ifdef TARGET_NR_fadvise64
+ case TARGET_NR_fadvise64:
+#endif
+#ifdef TARGET_S390X
+ switch (arg4) {
+ case 4: arg4 = POSIX_FADV_NOREUSE + 1; break; /* make sure it's an invalid value */
+ case 5: arg4 = POSIX_FADV_NOREUSE + 2; break; /* ditto */
+ case 6: arg4 = POSIX_FADV_DONTNEED; break;
+ case 7: arg4 = POSIX_FADV_NOREUSE; break;
+ default: break;
+ }
+#endif
+ ret = -posix_fadvise(arg1, arg2, arg3, arg4);
break;
#endif
#ifdef TARGET_NR_madvise