Skip to contentSkip to conversation

Add readahead syscall

PATCH In review Riku Voipio 3 participants 5 messages Sep 19, 2008 – Sep 21, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add readahead syscall

---
 linux-user/syscall.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
linux-user/syscall.c +2 -1
index cb75c94..6b38d8a 100644
@@ -5738,7 +5738,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         break;
 #ifdef TARGET_NR_readahead
     case TARGET_NR_readahead:
-        goto unimplemented;
+        ret = get_errno(readahead(arg1, arg2, arg3));
+        break;
 #endif
 #ifdef TARGET_NR_setxattr
     case TARGET_NR_setxattr:
Signature · 5 lines
1.5.6.5


-- 
"rm -rf" only sounds scary if you don't have backups
#1 lore raw
Quoted 11 lines · Riku Voipio
---
 linux-user/syscall.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
linux-user/syscall.c +0 -0
index cb75c94..6b38d8a 100644

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

Quoted 9 lines
linux-user/syscall.c +2 -1
@@ -5738,7 +5738,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         break;
 #ifdef TARGET_NR_readahead
     case TARGET_NR_readahead:
-        goto unimplemented;
+        ret = get_errno(readahead(arg1, arg2, arg3));
+        break;
 #endif
 #ifdef TARGET_NR_setxattr
     case TARGET_NR_setxattr:

Looks good for me. Added to my patchset.

Quoted 8 lines
Signature · 5 lines
1.5.6.5


-- 
"rm -rf" only sounds scary if you don't have backups
Signature · 3 lines
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.com/
#2 lore raw
In reply to Riku Voipio

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

Quoted 5 lines

#ifdef TARGET_NR_readahead
case TARGET_NR_readahead:

linux-user/syscall.c +2 -1
-        goto unimplemented;
+        ret = get_errno(readahead(arg1, arg2, arg3));
+        break;

This is wrong on 32-bit targets, and especially wrong on ARM where there are two variants.

Paul

#3 lore raw
Quoted 8 lines · Paul Brook

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

Quoted 5 lines

#ifdef TARGET_NR_readahead
case TARGET_NR_readahead:

linux-user/syscall.c +2 -1
-        goto unimplemented;
+        ret = get_errno(readahead(arg1, arg2, arg3));
+        break;

This is wrong on 32-bit targets, and especially wrong on ARM where there are two variants.

Two variants?

$ git grep readahead arch/arm/include/asm/unistd.h
arch/arm/include/asm/unistd.h:#define __NR_readahead (__NR_SYSCALL_BASE+225)
Signature · 3 lines
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.com/
#4 lore raw
Quoted 11 lines · Kirill A. Shutemov
Quoted 8 lines · Paul Brook

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

Quoted 5 lines

#ifdef TARGET_NR_readahead
case TARGET_NR_readahead:

linux-user/syscall.c +2 -1
-        goto unimplemented;
+        ret = get_errno(readahead(arg1, arg2, arg3));
+        break;

This is wrong on 32-bit targets, and especially wrong on ARM where there are two variants.

Two variants?

EABI and old-abi.

Paul