diff options
author | netchild <netchild@FreeBSD.org> | 2006-03-18 18:20:17 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2006-03-18 18:20:17 +0000 |
commit | c1829f604cdf8a3f393bfa6cb85fe9a6d4908919 (patch) | |
tree | 0bfbd4f21076e4935e7376b8d0502c8d258d4cfa /sys/compat/linux/linux_misc.c | |
parent | d4f801f4ab01a2c0d88e59ddabc9757533800554 (diff) | |
download | FreeBSD-src-c1829f604cdf8a3f393bfa6cb85fe9a6d4908919.zip FreeBSD-src-c1829f604cdf8a3f393bfa6cb85fe9a6d4908919.tar.gz |
Get rid of the need of COMPAT_43 in the linuxolator.
Submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
Obtained from: DragonFly (some parts)
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 19 |
1 files changed, 17 insertions, 2 deletions
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 <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_mac.h" #include <sys/param.h> @@ -72,8 +73,6 @@ __FBSDID("$FreeBSD$"); #include <posix4/sched.h> -#include "opt_compat.h" - #include <compat/linux/linux_sysproto.h> #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)); +} + |