diff options
author | mini <mini@FreeBSD.org> | 2002-09-23 06:17:54 +0000 |
---|---|---|
committer | mini <mini@FreeBSD.org> | 2002-09-23 06:17:54 +0000 |
commit | e206834961edb2d9141a787805ae32d92c3c9877 (patch) | |
tree | 5f424fb16ca806384a61af312db97a34a1315a17 /sys/compat/linux/linux_sysctl.c | |
parent | bcb38a31ff0d92c47ebc284b3704fa8f94de02ba (diff) | |
download | FreeBSD-src-e206834961edb2d9141a787805ae32d92c3c9877.zip FreeBSD-src-e206834961edb2d9141a787805ae32d92c3c9877.tar.gz |
Don't use compatability syscall wrappers in emulation code.
This is needed for the COMPAT_FREEBSD3 option split.
Reviewed by: alfred, jake
Diffstat (limited to 'sys/compat/linux/linux_sysctl.c')
-rw-r--r-- | sys/compat/linux/linux_sysctl.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_sysctl.c b/sys/compat/linux/linux_sysctl.c index 294da08..153e0ac 100644 --- a/sys/compat/linux/linux_sysctl.c +++ b/sys/compat/linux/linux_sysctl.c @@ -29,7 +29,11 @@ */ #include <sys/param.h> +#include <sys/lock.h> #include <sys/malloc.h> +#include <sys/mutex.h> +#include <sys/proc.h> +#include <sys/sysctl.h> #include <sys/systm.h> #include <machine/../linux/linux.h> @@ -117,3 +121,20 @@ linux_sysctl(struct thread *td, struct linux_sysctl_args *args) free(mib, M_TEMP); return (ENOTDIR); } + +int +linux_sethostname(struct thread *td, struct linux_sethostname_args *uap) +{ + int name[2]; + int error; + + name[0] = CTL_KERN; + name[1] = KERN_HOSTNAME; + mtx_lock(&Giant); + if ((error = suser_cred(td->td_ucred, PRISON_ROOT)) == 0) { + error = userland_sysctl(td, name, 2, 0, 0, 0, + uap->hostname, uap->len, 0); + } + mtx_unlock(&Giant); + return (error); +} |