diff options
author | alfred <alfred@FreeBSD.org> | 2003-01-02 02:19:10 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2003-01-02 02:19:10 +0000 |
commit | 6f979f7e5f34bfa805c879fd818dcd148def2365 (patch) | |
tree | 99826f563971bf97a7c515ce2142bc0961221917 /sys/compat/linux/linux_sysctl.c | |
parent | 0d04e17370ab2b8976dd2c0dcb3d6e9ba061ad5c (diff) | |
download | FreeBSD-src-6f979f7e5f34bfa805c879fd818dcd148def2365.zip FreeBSD-src-6f979f7e5f34bfa805c879fd818dcd148def2365.tar.gz |
Add function linux_msg() for regulating output from the linux emulation
code, make the emulator use it.
Rename unsupported_msg() to unimplemented_syscall(). Rename some arguments
for clarity
Fixup grammar.
Requested by: bde
Diffstat (limited to 'sys/compat/linux/linux_sysctl.c')
-rw-r--r-- | sys/compat/linux/linux_sysctl.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_sysctl.c b/sys/compat/linux/linux_sysctl.c index 86a8758..699b5d6 100644 --- a/sys/compat/linux/linux_sysctl.c +++ b/sys/compat/linux/linux_sysctl.c @@ -35,10 +35,13 @@ #include <sys/proc.h> #include <sys/sysctl.h> #include <sys/systm.h> +#include <sys/sbuf.h> #include <machine/../linux/linux.h> #include <machine/../linux/linux_proto.h> +#include <compat/linux/linux_util.h> + #define LINUX_CTL_KERN 1 #define LINUX_CTL_VM 2 #define LINUX_CTL_NET 3 @@ -78,6 +81,7 @@ int linux_sysctl(struct thread *td, struct linux_sysctl_args *args) { struct l___sysctl_args la; + struct sbuf *sb; l_int *mib; int error, i; @@ -113,10 +117,18 @@ linux_sysctl(struct thread *td, struct linux_sysctl_args *args) break; } - printf("linux: sysctl: unhandled name="); - for (i = 0; i < la.nlen; i++) - printf("%c%d", (i) ? ',' : '{', mib[i]); - printf("}\n"); + sb = sbuf_new(NULL, NULL, 20 + la.nlen * 5, SBUF_AUTOEXTEND); + if (sb == NULL) { + linux_msg(td, "sysctl is not implemented"); + } else { + sbuf_printf(sb, "sysctl "); + for (i = 0; i < la.nlen; i++) + sbuf_printf(sb, "%c%d", (i) ? ',' : '{', mib[i]); + sbuf_printf(sb, "} is not implemented"); + sbuf_finish(sb); + linux_msg(td, "%s", sbuf_data(sb)); + sbuf_delete(sb); + } free(mib, M_TEMP); return (ENOTDIR); |