kern_xxx.c (186570) | kern_xxx.c (193066) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/kern/kern_xxx.c 186570 2008-12-29 19:24:00Z ed $"); | 33__FBSDID("$FreeBSD: head/sys/kern/kern_xxx.c 193066 2009-05-29 21:27:12Z jamie $"); |
34 35#include "opt_compat.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/sysproto.h> 40#include <sys/kernel.h> 41#include <sys/priv.h> 42#include <sys/proc.h> 43#include <sys/lock.h> 44#include <sys/mutex.h> 45#include <sys/socket.h> 46#include <sys/sysctl.h> 47#include <sys/utsname.h> | 34 35#include "opt_compat.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/sysproto.h> 40#include <sys/kernel.h> 41#include <sys/priv.h> 42#include <sys/proc.h> 43#include <sys/lock.h> 44#include <sys/mutex.h> 45#include <sys/socket.h> 46#include <sys/sysctl.h> 47#include <sys/utsname.h> |
48#include <sys/vimage.h> | |
49 50#include <vm/vm_param.h> 51 52#if defined(COMPAT_43) 53 54#ifndef _SYS_SYSPROTO_H_ 55struct gethostname_args { 56 char *hostname; --- 41 unchanged lines hidden (view full) --- 98}; 99#endif 100/* ARGSUSED */ 101int 102ogethostid(td, uap) 103 struct thread *td; 104 struct ogethostid_args *uap; 105{ | 48 49#include <vm/vm_param.h> 50 51#if defined(COMPAT_43) 52 53#ifndef _SYS_SYSPROTO_H_ 54struct gethostname_args { 55 char *hostname; --- 41 unchanged lines hidden (view full) --- 97}; 98#endif 99/* ARGSUSED */ 100int 101ogethostid(td, uap) 102 struct thread *td; 103 struct ogethostid_args *uap; 104{ |
105 size_t len = sizeof(long); 106 int name[2]; |
|
106 | 107 |
107 *(long *)(td->td_retval) = hostid; 108 return (0); | 108 name[0] = CTL_KERN; 109 name[1] = KERN_HOSTID; 110 return (kernel_sysctl(td, name, 2, (long *)td->td_retval, &len, 111 NULL, 0, NULL, 0)); |
109} 110#endif /* COMPAT_43 */ 111 112#ifdef COMPAT_43 113#ifndef _SYS_SYSPROTO_H_ 114struct osethostid_args { 115 long hostid; 116}; 117#endif 118/* ARGSUSED */ 119int 120osethostid(td, uap) 121 struct thread *td; 122 struct osethostid_args *uap; 123{ | 112} 113#endif /* COMPAT_43 */ 114 115#ifdef COMPAT_43 116#ifndef _SYS_SYSPROTO_H_ 117struct osethostid_args { 118 long hostid; 119}; 120#endif 121/* ARGSUSED */ 122int 123osethostid(td, uap) 124 struct thread *td; 125 struct osethostid_args *uap; 126{ |
124 int error; | 127 int name[2]; |
125 | 128 |
126 error = priv_check(td, PRIV_SETHOSTID); 127 if (error) 128 return (error); 129 mtx_lock(&Giant); 130 hostid = uap->hostid; 131 mtx_unlock(&Giant); 132 return (0); | 129 name[0] = CTL_KERN; 130 name[1] = KERN_HOSTID; 131 return (kernel_sysctl(td, name, 2, NULL, NULL, &uap->hostid, 132 sizeof(uap->hostid), NULL, 0)); |
133} 134 135int 136oquota(td, uap) 137 struct thread *td; 138 struct oquota_args *uap; 139{ 140 --- 331 unchanged lines hidden --- | 133} 134 135int 136oquota(td, uap) 137 struct thread *td; 138 struct oquota_args *uap; 139{ 140 --- 331 unchanged lines hidden --- |