summaryrefslogtreecommitdiffstats
path: root/meta/packages/qemu/qemu-0.9.0+cvs20070613/32_syscall_sysctl.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/qemu/qemu-0.9.0+cvs20070613/32_syscall_sysctl.patch')
-rw-r--r--meta/packages/qemu/qemu-0.9.0+cvs20070613/32_syscall_sysctl.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/meta/packages/qemu/qemu-0.9.0+cvs20070613/32_syscall_sysctl.patch b/meta/packages/qemu/qemu-0.9.0+cvs20070613/32_syscall_sysctl.patch
new file mode 100644
index 0000000000..d175cf96ba
--- /dev/null
+++ b/meta/packages/qemu/qemu-0.9.0+cvs20070613/32_syscall_sysctl.patch
@@ -0,0 +1,56 @@
1#DPATCHLEVEL=0
2---
3# linux-user/syscall.c | 33 ++++++++++++++++++++++++++++++---
4# 1 file changed, 30 insertions(+), 3 deletions(-)
5#
6Index: linux-user/syscall.c
7===================================================================
8--- linux-user/syscall.c.orig 2007-06-13 11:51:54.000000000 +0100
9+++ linux-user/syscall.c 2007-06-13 11:52:17.000000000 +0100
10@@ -52,6 +52,7 @@
11 //#include <sys/user.h>
12 #include <netinet/ip.h>
13 #include <netinet/tcp.h>
14+#include <sys/sysctl.h>
15
16 #define termios host_termios
17 #define winsize host_winsize
18@@ -3912,9 +3913,35 @@ long do_syscall(void *cpu_env, int num,
19 break;
20 #endif
21 case TARGET_NR__sysctl:
22- /* We don't implement this, but ENODIR is always a safe
23- return value. */
24- return -ENOTDIR;
25+ {
26+ struct __sysctl_args *args = (struct __sysctl_args *) arg1;
27+ int *name_target, *name, nlen, *oldlenp, oldlen, newlen, i;
28+ void *oldval, *newval;
29+
30+ name_target = (int *) tswapl((long) args->name);
31+ nlen = tswapl(args->nlen);
32+ oldval = (void *) tswapl((long) args->oldval);
33+ oldlenp = (int *) tswapl((long) args->oldlenp);
34+ oldlen = tswapl(*oldlenp);
35+ newval = (void *) tswapl((long) args->newval);
36+ newlen = tswapl(args->newlen);
37+
38+ name = alloca(nlen * sizeof (int));
39+ for (i = 0; i < nlen; i++)
40+ name[i] = tswapl(name_target[i]);
41+
42+ if (nlen == 2 && name[0] == CTL_KERN && name[1] == KERN_VERSION) {
43+ ret = get_errno(
44+ sysctl(name, nlen, oldval, &oldlen, newval, newlen));
45+ if (!is_error(ret)) {
46+ *oldlenp = tswapl(oldlen);
47+ }
48+ } else {
49+ gemu_log("qemu: Unsupported sysctl name\n");
50+ ret = -ENOSYS;
51+ }
52+ }
53+ break;
54 case TARGET_NR_sched_setparam:
55 {
56 struct sched_param *target_schp;