Add mincore syscall
PATCH 1/1 Add mincore syscall
Signed-off-by Riku Voipio <[email protected]>
--- linux-user/syscall.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-)
linux-user/syscall.c +13 -1
@@ -5574,7 +5574,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, goto unimplemented;#ifdef TARGET_NR_mincorecase TARGET_NR_mincore: - goto unimplemented; + { +void *a; + ret = -TARGET_EFAULT ; +if (!(a =lock_user (VERIFY_READ , arg1,arg2,0 ))) + goto efault; +if (!(p =lock_user_string (arg3))) + goto mincore_fail; + ret =get_errno (mincore (a, arg2, p)); +unlock_user (p, arg3, ret); + mincore_fail: +unlock_user (a, arg1,0 ); + } +break ;#endif #ifdef TARGET_NR_fadvise64_64case TARGET_NR_fadvise64_64:
Signature · 5 lines
1.5.6.5 -- "rm -rf" only sounds scary if you don't have backups
Quoted 21 lines · Riku Voipio
Signed-off-by Riku Voipio <[email protected]>--- linux-user/syscall.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-)linux-user/syscall.c +6
-1@@ -5574,7 +5574,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, goto unimplemented;#ifdef TARGET_NR_mincorecase TARGET_NR_mincore: - goto unimplemented; + { +void *a; + ret = -TARGET_EFAULT ; +if (!(a =lock_user (VERIFY_READ , arg1,arg2,0 ))) + goto efault; +if (!(p =lock_user_string (arg3)))
linux-user/syscall.c abi_long do_syscall(void *cpu_env, int num, abi_long arg1, · line 5592
Quoted 10 lines
linux-user/syscall.c +7
-0+ goto mincore_fail; + ret =get_errno (mincore (a, arg2, p)); +unlock_user (p, arg3, ret); + mincore_fail: + unlock_user(a, arg1, 0); + } +break ;#endif #ifdef TARGET_NR_fadvise64_64case TARGET_NR_fadvise64_64:
Looks good for me. Added to my patchset.
Signature · 3 lines
Regards, Kirill A. Shutemov + Belarus, Minsk + ALT Linux Team, http://www.altlinux.com/
Aurelien Jarno
AppliedApplied, thanks.
Quoted 40 lines · Riku Voipio
Signed-off-by Riku Voipio <[email protected]>--- linux-user/syscall.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-)linux-user/syscall.c +13
-1@@ -5574,7 +5574,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, goto unimplemented;#ifdef TARGET_NR_mincorecase TARGET_NR_mincore: - goto unimplemented; + { +void *a; + ret = -TARGET_EFAULT ; +if (!(a =lock_user (VERIFY_READ , arg1,arg2,0 ))) + goto efault; +if (!(p =lock_user_string (arg3))) + goto mincore_fail; + ret =get_errno (mincore (a, arg2, p)); +unlock_user (p, arg3, ret); + mincore_fail: +unlock_user (a, arg1,0 ); + } +break ;#endif #ifdef TARGET_NR_fadvise64_64case TARGET_NR_fadvise64_64:Signature · 5 lines
1.5.6.5 -- "rm -rf" only sounds scary if you don't have backups
Signature · 4 lines
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net