Skip to contentSkip to conversation

Add fadvise64 stubs

PATCH New Riku Voipio 3 participants 7 messages Sep 19, 2008 – Oct 1, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add fadvise64 stubs

Since these are only hints, we happily fake them for now to make applications not barf on ENOSYS.

---
 linux-user/syscall.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
linux-user/syscall.c +12 -0
index 4cde5e8..8e6e735 100644
@@ -5576,6 +5576,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_mincore:
         goto unimplemented;
 #endif
+#ifdef TARGET_NR_fadvise64_64
+     case TARGET_NR_fadvise64_64:
+        /* This is a hint, so ignoring and returning success is ok.  */
+        ret = get_errno(0);
+        break;
+#endif
+#ifdef TARGET_NR_arm_fadvise64_64
+     case TARGET_NR_arm_fadvise64_64:
+        /* This is a hint, so ignoring and returning success is ok.  */
+        ret = get_errno(0);
+        break;
+#endif
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
         /* A straight passthrough may not be safe because qemu sometimes
Signature · 5 lines
1.5.6.5


-- 
"rm -rf" only sounds scary if you don't have backups
#1 lore raw

PATCH 1/1 Add fadvise64 stubs

Since these are only hints, we happily fake them for now to make applications not barf on ENOSYS.

---
 linux-user/syscall.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
linux-user/syscall.c +19 -0
index 56b4138..74e4998 100644
@@ -5509,6 +5509,25 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_mincore:
         goto unimplemented;
 #endif
+#ifdef TARGET_NR_arm_fadvise64_64
+    case TARGET_NR_arm_fadvise64_64:
+	{
+		/*
+		 * arm_fadvise64_64 looks like fadvise64_64 but
+		 * with different argument order
+		 */
+		abi_long temp;
+		temp = arg3;
+		arg3 = arg4;
+		arg4 = temp;
+	}
+#endif
+#ifdef TARGET_NR_fadvise64_64
+    case TARGET_NR_fadvise64_64:
+        /* This is a hint, so ignoring and returning success is ok.  */
+	ret = get_errno(0);
+	break;
+#endif
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
         /* A straight passthrough may not be safe because qemu sometimes
Signature · 1 line
1.5.6.5.GIT
#2 lore raw
Quoted 29 lines · Kirill A. Shutemov

Since these are only hints, we happily fake them for now to make applications not barf on ENOSYS.

---
 linux-user/syscall.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
linux-user/syscall.c +12 -0
index 56b4138..74e4998 100644
@@ -5509,6 +5509,25 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_mincore:
         goto unimplemented;
 #endif
+#ifdef TARGET_NR_arm_fadvise64_64
+    case TARGET_NR_arm_fadvise64_64:
+	{
+		/*
+		 * arm_fadvise64_64 looks like fadvise64_64 but
+		 * with different argument order
+		 */
+		abi_long temp;
+		temp = arg3;
+		arg3 = arg4;
+		arg4 = temp;
+	}

linux-user/syscall.c abi_long do_syscall(void *cpu_env, int num, abi_long arg1, · line 5533

Quoted 10 lines
linux-user/syscall.c +7 -0
+#endif
+#ifdef TARGET_NR_fadvise64_64
+    case TARGET_NR_fadvise64_64:
+        /* This is a hint, so ignoring and returning success is ok.  */
+	ret = get_errno(0);
+	break;
+#endif
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
         /* A straight passthrough may not be safe because qemu sometimes

Mmmh, what happens if TARGET_NR_arm_fadvise64_64 is set but TARGET_NR_fadvise64_64 isn't :)

Signature · 1 line
"rm -rf" only sounds scary if you don't have backups
#3 lore raw
Quoted 35 lines · Riku Voipio
Quoted 34 lines · Kirill A. Shutemov

Since these are only hints, we happily fake them for now to make applications not barf on ENOSYS.

---
 linux-user/syscall.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
linux-user/syscall.c +17 -0
index 56b4138..74e4998 100644
@@ -5509,6 +5509,25 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_mincore:
         goto unimplemented;
 #endif
+#ifdef TARGET_NR_arm_fadvise64_64
+    case TARGET_NR_arm_fadvise64_64:
+	{
+		/*
+		 * arm_fadvise64_64 looks like fadvise64_64 but
+		 * with different argument order
+		 */
+		abi_long temp;
+		temp = arg3;
+		arg3 = arg4;
+		arg4 = temp;
+	}
+#endif
+#ifdef TARGET_NR_fadvise64_64
+    case TARGET_NR_fadvise64_64:
+        /* This is a hint, so ignoring and returning success is ok.  */
+	ret = get_errno(0);
Quoted 8 lines

linux-user/syscall.c abi_long do_syscall(void *cpu_env, int num, abi_long arg1, · line 5533

Quoted 5 lines
linux-user/syscall.c +2 -0
+	break;
+#endif
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
         /* A straight passthrough may not be safe because qemu sometimes

Mmmh, what happens if TARGET_NR_arm_fadvise64_64 is set but TARGET_NR_fadvise64_64 isn't :)

Oops... I'll fix it.

Signature · 3 lines
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.com/
#4 lore raw

PATCH 1/1 Add fadvise64 stubs

In reply to Riku Voipio

Since these are only hints, we happily fake them for now to make applications not barf on ENOSYS.

---
 linux-user/syscall.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
linux-user/syscall.c +21 -0
index 489f632..f9aab47 100644
@@ -5572,6 +5572,27 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_mincore:
         goto unimplemented;
 #endif
+#ifdef TARGET_NR_arm_fadvise64_64
+    case TARGET_NR_arm_fadvise64_64:
+	{
+		/*
+		 * arm_fadvise64_64 looks like fadvise64_64 but
+		 * with different argument order
+		 */
+		abi_long temp;
+		temp = arg3;
+		arg3 = arg4;
+		arg4 = temp;
+	}
+#endif
+#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64)
+#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);
+	break;
+#endif
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
         /* A straight passthrough may not be safe because qemu sometimes
Signature · 1 line
1.5.6.5.GIT
#5 lore raw
Quoted 5 lines · Kirill A. Shutemov

Since these are only hints, we happily fake them for now to make applications not barf on ENOSYS.

Ack.

Quoted 38 lines
---
 linux-user/syscall.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
linux-user/syscall.c +21 -0
index 489f632..f9aab47 100644
@@ -5572,6 +5572,27 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_mincore:
         goto unimplemented;
 #endif
+#ifdef TARGET_NR_arm_fadvise64_64
+    case TARGET_NR_arm_fadvise64_64:
+	{
+		/*
+		 * arm_fadvise64_64 looks like fadvise64_64 but
+		 * with different argument order
+		 */
+		abi_long temp;
+		temp = arg3;
+		arg3 = arg4;
+		arg4 = temp;
+	}
+#endif
+#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64)
+#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);
+	break;
+#endif
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
         /* A straight passthrough may not be safe because qemu sometimes
Signature · 1 line
1.5.6.5.GIT
Signature · 1 line
"rm -rf" only sounds scary if you don't have backups
#6 lore raw
In reply to Kirill A. Shutemov
Quoted 2 lines · Kirill A. Shutemov

Since these are only hints, we happily fake them for now to make applications not barf on ENOSYS.

Applied, thanks.

Quoted 44 lines
---
 linux-user/syscall.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
linux-user/syscall.c +21 -0
index 489f632..f9aab47 100644
@@ -5572,6 +5572,27 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_mincore:
         goto unimplemented;
 #endif
+#ifdef TARGET_NR_arm_fadvise64_64
+    case TARGET_NR_arm_fadvise64_64:
+	{
+		/*
+		 * arm_fadvise64_64 looks like fadvise64_64 but
+		 * with different argument order
+		 */
+		abi_long temp;
+		temp = arg3;
+		arg3 = arg4;
+		arg4 = temp;
+	}
+#endif
+#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64)
+#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);
+	break;
+#endif
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
         /* A straight passthrough may not be safe because qemu sometimes
Signature · 1 line
1.5.6.5.GIT
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net