From c1829f604cdf8a3f393bfa6cb85fe9a6d4908919 Mon Sep 17 00:00:00 2001 From: netchild Date: Sat, 18 Mar 2006 18:20:17 +0000 Subject: Get rid of the need of COMPAT_43 in the linuxolator. Submitted by: Divacky Roman Obtained from: DragonFly (some parts) --- sys/compat/linux/linux_misc.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'sys/compat/linux/linux_misc.c') diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 758d756..a63c2a3 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -30,6 +30,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_mac.h" #include @@ -72,8 +73,6 @@ __FBSDID("$FreeBSD$"); #include -#include "opt_compat.h" - #include #ifdef COMPAT_LINUX32 @@ -1402,3 +1401,19 @@ linux_getpriority(struct thread *td, struct linux_getpriority_args *args) td->td_retval[0] = 20 - td->td_retval[0]; return error; } + +int +linux_sethostname(struct thread *td, struct linux_sethostname_args *args) +{ + struct proc *p = td->td_proc; + int name[2]; + int error; + + name[0] = CTL_KERN; + name[1] = KERN_HOSTNAME; + if ((error = suser_cred(p->p_ucred, SUSER_ALLOWJAIL))) + return (error); + return (userland_sysctl(td, name, 2, 0, 0, 0, args->hostname, + args->len, 0, 0)); +} + -- cgit v1.1