Commit 248366894044f564ce56ac6340882bde17d24ec7

Authored by pbrook
1 parent d4b8f039

Implement acct and pretend to implement madvise.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1819 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 10 additions and 2 deletions
linux-user/syscall.c
... ... @@ -2145,7 +2145,10 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
2145 2145 goto unimplemented;
2146 2146  
2147 2147 case TARGET_NR_acct:
2148   - goto unimplemented;
  2148 + p = lock_user_string(arg1);
  2149 + ret = get_errno(acct(path(p)));
  2150 + unlock_user(p, arg1, 0);
  2151 + break;
2149 2152 case TARGET_NR_umount2:
2150 2153 p = lock_user_string(arg1);
2151 2154 ret = get_errno(umount2(p, arg2));
... ... @@ -3547,7 +3550,12 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
3547 3550 #endif
3548 3551 #ifdef TARGET_NR_madvise
3549 3552 case TARGET_NR_madvise:
3550   - goto unimplemented;
  3553 + /* A straight passthrough may not be safe because qemu sometimes
  3554 + turns private flie-backed mappings into anonymous mappings.
  3555 + This will break MADV_DONTNEED.
  3556 + This is a hint, so ignoring and returning success is ok. */
  3557 + ret = get_errno(0);
  3558 + break;
3551 3559 #endif
3552 3560 #if TARGET_LONG_BITS == 32
3553 3561 case TARGET_NR_fcntl64:
... ...