kern_sysctl.c (2112) | kern_sysctl.c (2631) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Mike Karels at Berkeley Software Design, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Mike Karels at Berkeley Software Design, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 |
37 * $Id: kern_sysctl.c,v 1.7 1994/08/10 06:25:02 wollman Exp $ | 37 * $Id: kern_sysctl.c,v 1.8 1994/08/18 22:35:04 wollman Exp $ |
38 */ 39 40/* 41 * sysctl system call. 42 */ 43 44#include <sys/param.h> 45#include <sys/systm.h> --- 258 unchanged lines hidden (view full) --- 304 u_int namelen; 305 void *oldp; 306 size_t *oldlenp; 307 void *newp; 308 size_t newlen; 309 struct proc *p; 310{ 311 extern char machine[], cpu_model[]; | 38 */ 39 40/* 41 * sysctl system call. 42 */ 43 44#include <sys/param.h> 45#include <sys/systm.h> --- 258 unchanged lines hidden (view full) --- 304 u_int namelen; 305 void *oldp; 306 size_t *oldlenp; 307 void *newp; 308 size_t newlen; 309 struct proc *p; 310{ 311 extern char machine[], cpu_model[]; |
312 extern int hw_float; |
|
312 313 /* all sysctl names at this level are terminal */ 314 if (namelen != 1) 315 return (ENOTDIR); /* overloaded */ 316 317 switch (name[0]) { 318 case HW_MACHINE: 319 return (sysctl_rdstring(oldp, oldlenp, newp, machine)); --- 5 unchanged lines hidden (view full) --- 325 return (sysctl_rdint(oldp, oldlenp, newp, BYTE_ORDER)); 326 case HW_PHYSMEM: 327 return (sysctl_rdint(oldp, oldlenp, newp, ctob(physmem))); 328 case HW_USERMEM: 329 return (sysctl_rdint(oldp, oldlenp, newp, 330 ctob(physmem - cnt.v_wire_count))); 331 case HW_PAGESIZE: 332 return (sysctl_rdint(oldp, oldlenp, newp, PAGE_SIZE)); | 313 314 /* all sysctl names at this level are terminal */ 315 if (namelen != 1) 316 return (ENOTDIR); /* overloaded */ 317 318 switch (name[0]) { 319 case HW_MACHINE: 320 return (sysctl_rdstring(oldp, oldlenp, newp, machine)); --- 5 unchanged lines hidden (view full) --- 326 return (sysctl_rdint(oldp, oldlenp, newp, BYTE_ORDER)); 327 case HW_PHYSMEM: 328 return (sysctl_rdint(oldp, oldlenp, newp, ctob(physmem))); 329 case HW_USERMEM: 330 return (sysctl_rdint(oldp, oldlenp, newp, 331 ctob(physmem - cnt.v_wire_count))); 332 case HW_PAGESIZE: 333 return (sysctl_rdint(oldp, oldlenp, newp, PAGE_SIZE)); |
334 case HW_FLOATINGPT: 335 return (sysctl_rdint(oldp, oldlenp, newp, hw_float)); |
|
333 default: 334 return (EOPNOTSUPP); 335 } 336 /* NOTREACHED */ 337} 338 339#ifdef DEBUG 340/* --- 484 unchanged lines hidden --- | 336 default: 337 return (EOPNOTSUPP); 338 } 339 /* NOTREACHED */ 340} 341 342#ifdef DEBUG 343/* --- 484 unchanged lines hidden --- |