32e37f2492
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/vmware@1952 6952d904-891a-0410-993b-d76249ca496b
47 lines
1.5 KiB
Diff
47 lines
1.5 KiB
Diff
From 51e609fc6a4a6ff29cd463babfe14032aea18254 Mon Sep 17 00:00:00 2001
|
|
From: Ulrich Hecht <uli@suse.de>
|
|
Date: Thu, 23 Jul 2009 14:56:59 +0200
|
|
Subject: [PATCH 31/33] linux-user: fadvise64 implementation
|
|
|
|
good enough to pass all LTP fadvise64 tests
|
|
|
|
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
|
---
|
|
linux-user/syscall.c | 17 ++++++++++++++---
|
|
1 files changed, 14 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
|
index 30fb4ab..c4b7001 100644
|
|
--- a/linux-user/syscall.c
|
|
+++ b/linux-user/syscall.c
|
|
@@ -6680,12 +6680,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
|
|
--
|
|
1.6.2.1
|
|
|