Commit 29e619b1e8b1b79255009451e26c1bdbd9338fa6
1 parent
6f28fb86
uname + sysctl fix (Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1065 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
14 additions
and
1 deletions
linux-user/syscall.c
| @@ -2392,6 +2392,17 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2392,6 +2392,17 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2392 | break; | 2392 | break; |
| 2393 | case TARGET_NR_uname: | 2393 | case TARGET_NR_uname: |
| 2394 | /* no need to transcode because we use the linux syscall */ | 2394 | /* no need to transcode because we use the linux syscall */ |
| 2395 | + { | ||
| 2396 | + struct new_utsname * buf; | ||
| 2397 | + | ||
| 2398 | + buf = (struct new_utsname *)arg1; | ||
| 2399 | + ret = get_errno(sys_uname(buf)); | ||
| 2400 | + if (!is_error(ret)) { | ||
| 2401 | + /* Overrite the native machine name with whatever is being | ||
| 2402 | + emulated. */ | ||
| 2403 | + strcpy (buf->machine, UNAME_MACHINE); | ||
| 2404 | + } | ||
| 2405 | + } | ||
| 2395 | ret = get_errno(sys_uname((struct new_utsname *)arg1)); | 2406 | ret = get_errno(sys_uname((struct new_utsname *)arg1)); |
| 2396 | break; | 2407 | break; |
| 2397 | #ifdef TARGET_I386 | 2408 | #ifdef TARGET_I386 |
| @@ -2600,7 +2611,9 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | @@ -2600,7 +2611,9 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
| 2600 | ret = get_errno(fdatasync(arg1)); | 2611 | ret = get_errno(fdatasync(arg1)); |
| 2601 | break; | 2612 | break; |
| 2602 | case TARGET_NR__sysctl: | 2613 | case TARGET_NR__sysctl: |
| 2603 | - goto unimplemented; | 2614 | + /* We don't implement this, but ENODIR is always a safe |
| 2615 | + return value. */ | ||
| 2616 | + return -ENOTDIR; | ||
| 2604 | case TARGET_NR_sched_setparam: | 2617 | case TARGET_NR_sched_setparam: |
| 2605 | { | 2618 | { |
| 2606 | struct sched_param *target_schp = (void *)arg2; | 2619 | struct sched_param *target_schp = (void *)arg2; |