]> Git Repo - qemu.git/blobdiff - linux-user/syscall.c
Teach usermode emulation how to lie about uname -r.
[qemu.git] / linux-user / syscall.c
index 2b132477f07db20d47d7dfbe3134ebf3f5ca19da..4afc6d888c5a244769433b2aec58461dc6f280d1 100644 (file)
@@ -1618,12 +1618,17 @@ int do_fork(CPUState *env, unsigned int flags, unsigned long newsp)
             for (i = 7; i < 32; i++)
                 new_env->gpr[i] = 0;
         }
+#elif defined(TARGET_SH4)
+       if (!newsp)
+         newsp = env->gregs[15];
+       new_env->gregs[15] = newsp;
+       /* XXXXX */
 #else
 #error unsupported target CPU
 #endif
         new_env->opaque = ts;
 #ifdef __ia64__
-        ret = clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
+        ret = __clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
 #else
        ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
 #endif
@@ -2145,7 +2150,10 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
         goto unimplemented;
 
     case TARGET_NR_acct:
-        goto unimplemented;
+        p = lock_user_string(arg1);
+        ret = get_errno(acct(path(p)));
+        unlock_user(p, arg1, 0);
+        break;
     case TARGET_NR_umount2:
         p = lock_user_string(arg1);
         ret = get_errno(umount2(p, arg2));
@@ -2853,6 +2861,9 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
                 /* Overrite the native machine name with whatever is being
                    emulated. */
                 strcpy (buf->machine, UNAME_MACHINE);
+                /* Allow the user to override the reported release.  */
+                if (qemu_uname_release && *qemu_uname_release)
+                  strcpy (buf->release, qemu_uname_release);
             }
             unlock_user_struct(buf, arg1, 1);
         }
@@ -3547,7 +3558,12 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
 #endif
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
-        goto unimplemented;
+        /* A straight passthrough may not be safe because qemu sometimes
+           turns private flie-backed mappings into anonymous mappings.
+           This will break MADV_DONTNEED.
+           This is a hint, so ignoring and returning success is ok.  */
+        ret = get_errno(0);
+        break;
 #endif
 #if TARGET_LONG_BITS == 32
     case TARGET_NR_fcntl64:
This page took 0.025423 seconds and 4 git commands to generate.