kern_mib.c (1829d5da5355930d5cfa8ec8add8ff47dc0bebab) | kern_mib.c (f6dfe47a145263dc5eb67fa4789925ab708709bc) |
---|---|
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 * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD --- 194 unchanged lines hidden (view full) --- 203 0, 0, sysctl_hw_usermem, "LU", ""); 204 205SYSCTL_ULONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); 206 207static char machine_arch[] = MACHINE_ARCH; 208SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD, 209 machine_arch, 0, "System architecture"); 210 | 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 * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD --- 194 unchanged lines hidden (view full) --- 203 0, 0, sysctl_hw_usermem, "LU", ""); 204 205SYSCTL_ULONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); 206 207static char machine_arch[] = MACHINE_ARCH; 208SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD, 209 machine_arch, 0, "System architecture"); 210 |
211#ifndef VIMAGE | 211/* should become #ifndef VIMAGE */ |
212char hostname[MAXHOSTNAMELEN]; | 212char hostname[MAXHOSTNAMELEN]; |
213#endif | |
214 215/* 216 * This mutex is used to protect the hostname and domainname variables, and 217 * perhaps in the future should also protect hostid, hostuid, and others. 218 */ 219struct mtx hostname_mtx; 220MTX_SYSINIT(hostname_mtx, &hostname_mtx, "hostname", MTX_DEF); 221 --- 122 unchanged lines hidden (view full) --- 344 return (sysctl_handle_string(oidp, kernconfstring, 345 strlen(kernconfstring), req)); 346} 347 348SYSCTL_PROC(_kern, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RW, 349 0, 0, sysctl_kern_config, "", "Kernel configuration file"); 350#endif 351 | 213 214/* 215 * This mutex is used to protect the hostname and domainname variables, and 216 * perhaps in the future should also protect hostid, hostuid, and others. 217 */ 218struct mtx hostname_mtx; 219MTX_SYSINIT(hostname_mtx, &hostname_mtx, "hostname", MTX_DEF); 220 --- 122 unchanged lines hidden (view full) --- 343 return (sysctl_handle_string(oidp, kernconfstring, 344 strlen(kernconfstring), req)); 345} 346 347SYSCTL_PROC(_kern, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RW, 348 0, 0, sysctl_kern_config, "", "Kernel configuration file"); 349#endif 350 |
352#ifndef VIMAGE | 351/* should become #ifndef VIMAGE */ |
353char domainname[MAXHOSTNAMELEN]; /* Protected by hostname_mtx. */ | 352char domainname[MAXHOSTNAMELEN]; /* Protected by hostname_mtx. */ |
354#endif | |
355 356static int 357sysctl_domainname(SYSCTL_HANDLER_ARGS) 358{ 359 char tmpdomainname[MAXHOSTNAMELEN]; 360 int error; 361 362 mtx_lock(&hostname_mtx); --- 109 unchanged lines hidden --- | 353 354static int 355sysctl_domainname(SYSCTL_HANDLER_ARGS) 356{ 357 char tmpdomainname[MAXHOSTNAMELEN]; 358 int error; 359 360 mtx_lock(&hostname_mtx); --- 109 unchanged lines hidden --- |