Deleted Added
full compact
kern_mib.c (168545) kern_mib.c (169507)
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

--- 22 unchanged lines hidden (view full) ---

31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
36 */
37
38#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 * 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

--- 22 unchanged lines hidden (view full) ---

31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/sys/kern/kern_mib.c 168545 2007-04-09 19:18:09Z pjd $");
39__FBSDID("$FreeBSD: head/sys/kern/kern_mib.c 169507 2007-05-12 19:38:18Z wkoszek $");
40
41#include "opt_posix.h"
42
43#include <sys/param.h>
44#include <sys/kernel.h>
40
41#include "opt_posix.h"
42
43#include <sys/param.h>
44#include <sys/kernel.h>
45#include <sys/sbuf.h>
45#include <sys/systm.h>
46#include <sys/sysctl.h>
47#include <sys/proc.h>
48#include <sys/lock.h>
49#include <sys/mutex.h>
50#include <sys/jail.h>
51#include <sys/smp.h>
52#include <sys/unistd.h>

--- 237 unchanged lines hidden (view full) ---

290 }
291 return (error);
292}
293
294SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
295 CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl,
296 "I", "Current secure level");
297
46#include <sys/systm.h>
47#include <sys/sysctl.h>
48#include <sys/proc.h>
49#include <sys/lock.h>
50#include <sys/mutex.h>
51#include <sys/jail.h>
52#include <sys/smp.h>
53#include <sys/unistd.h>

--- 237 unchanged lines hidden (view full) ---

291 }
292 return (error);
293}
294
295SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
296 CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl,
297 "I", "Current secure level");
298
299/* Actual kernel configuration options. */
300extern char kernconfstring[];
301
302static int
303sysctl_kern_config(SYSCTL_HANDLER_ARGS)
304{
305 struct sbuf *sb;
306 int error;
307 char *p;
308
309 sb = sbuf_new(NULL, NULL, 2048, SBUF_AUTOEXTEND);
310 if (sb == NULL)
311 return (ENOMEM);
312 sbuf_clear(sb);
313 p = kernconfstring;
314 if (p == NULL || *p == '\0') {
315 sbuf_printf(sb, "No kernel configuration\n");
316 } else {
317 sbuf_printf(sb, "%s", p);
318 }
319 sbuf_trim(sb);
320 sbuf_putc(sb, '\n');
321 sbuf_finish(sb);
322 error = sysctl_handle_string(oidp, sbuf_data(sb), sbuf_len(sb), req);
323 if (error)
324 return (error);
325 sbuf_delete(sb);
326 return (error);
327}
328SYSCTL_PROC(_kern, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RW,
329 0, 0, sysctl_kern_config, "", "Kernel configuration file");
330
298char domainname[MAXHOSTNAMELEN];
299SYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW,
300 &domainname, sizeof(domainname), "Name of the current YP/NIS domain");
301
302u_long hostid;
303SYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID");
304char hostuuid[64] = "00000000-0000-0000-0000-000000000000";
305SYSCTL_STRING(_kern, KERN_HOSTUUID, hostuuid, CTLFLAG_RW, hostuuid,

--- 72 unchanged lines hidden ---
331char domainname[MAXHOSTNAMELEN];
332SYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW,
333 &domainname, sizeof(domainname), "Name of the current YP/NIS domain");
334
335u_long hostid;
336SYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID");
337char hostuuid[64] = "00000000-0000-0000-0000-000000000000";
338SYSCTL_STRING(_kern, KERN_HOSTUUID, hostuuid, CTLFLAG_RW, hostuuid,

--- 72 unchanged lines hidden ---