]> Git Repo - qemu.git/commitdiff
pread/pwrite syscalls - use page_unprotect_range() in vital cases to avoid problems...
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 14 May 2003 19:01:56 +0000 (19:01 +0000)
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 14 May 2003 19:01:56 +0000 (19:01 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@164 c046a42c-6fe2-441c-8c8c-71466251a162

linux-user/syscall.c

index ac7a11192b80c9c045e2017ab4fd4e9ebfcf063d..34599d0f0911600ee5a6b70b4e8c4e6b164b65be 100644 (file)
@@ -1137,6 +1137,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
         ret = 0; /* avoid warning */
         break;
     case TARGET_NR_read:
+        page_unprotect_range((void *)arg2, arg3);
         ret = get_errno(read(arg1, (void *)arg2, arg3));
         break;
     case TARGET_NR_write:
@@ -2191,9 +2192,12 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
     case TARGET_NR_prctl:
         goto unimplemented;
     case TARGET_NR_pread:
-        goto unimplemented;
+        page_unprotect_range((void *)arg2, arg3);
+        ret = get_errno(pread(arg1, (void *)arg2, arg3, arg4));
+        break;
     case TARGET_NR_pwrite:
-        goto unimplemented;
+        ret = get_errno(pwrite(arg1, (void *)arg2, arg3, arg4));
+        break;
     case TARGET_NR_chown:
         ret = get_errno(chown((const char *)arg1, arg2, arg3));
         break;
This page took 0.031374 seconds and 4 git commands to generate.