Deleted Added
full compact
kern_mib.c (183550) kern_mib.c (187864)
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 183550 2008-10-02 15:37:58Z zec $");
39__FBSDID("$FreeBSD: head/sys/kern/kern_mib.c 187864 2009-01-28 19:58:05Z ed $");
40
41#include "opt_compat.h"
42#include "opt_posix.h"
43#include "opt_config.h"
44
45#include <sys/param.h>
46#include <sys/kernel.h>
47#include <sys/sbuf.h>

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

82 "Compatibility code");
83SYSCTL_NODE(, OID_AUTO, security, CTLFLAG_RW, 0,
84 "Security");
85#ifdef REGRESSION
86SYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0,
87 "Regression test MIB");
88#endif
89
40
41#include "opt_compat.h"
42#include "opt_posix.h"
43#include "opt_config.h"
44
45#include <sys/param.h>
46#include <sys/kernel.h>
47#include <sys/sbuf.h>

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

82 "Compatibility code");
83SYSCTL_NODE(, OID_AUTO, security, CTLFLAG_RW, 0,
84 "Security");
85#ifdef REGRESSION
86SYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0,
87 "Regression test MIB");
88#endif
89
90SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD,
90SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD|CTLFLAG_MPSAFE,
91 kern_ident, 0, "Kernel identifier");
92
91 kern_ident, 0, "Kernel identifier");
92
93SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD,
93SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD|CTLFLAG_MPSAFE,
94 osrelease, 0, "Operating system release");
95
96SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD,
97 0, BSD, "Operating system revision");
98
94 osrelease, 0, "Operating system release");
95
96SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD,
97 0, BSD, "Operating system revision");
98
99SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD,
99SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE,
100 version, 0, "Kernel version");
101
100 version, 0, "Kernel version");
101
102SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD,
102SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE,
103 ostype, 0, "Operating system type");
104
105/*
106 * NOTICE: The *userland* release date is available in
107 * /usr/include/osreldate.h
108 */
109SYSCTL_INT(_kern, KERN_OSRELDATE, osreldate, CTLFLAG_RD,
110 &osreldate, 0, "Kernel release date");

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

160
161 len = req->oldlen;
162 if (len > sizeof(buf))
163 len = sizeof(buf);
164 arc4rand(buf, len, 0);
165 return (SYSCTL_OUT(req, buf, len));
166}
167
103 ostype, 0, "Operating system type");
104
105/*
106 * NOTICE: The *userland* release date is available in
107 * /usr/include/osreldate.h
108 */
109SYSCTL_INT(_kern, KERN_OSRELDATE, osreldate, CTLFLAG_RD,
110 &osreldate, 0, "Kernel release date");

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

160
161 len = req->oldlen;
162 if (len > sizeof(buf))
163 len = sizeof(buf);
164 arc4rand(buf, len, 0);
165 return (SYSCTL_OUT(req, buf, len));
166}
167
168SYSCTL_PROC(_kern, KERN_ARND, arandom, CTLTYPE_OPAQUE | CTLFLAG_RD,
169 NULL, 0, sysctl_kern_arnd, "", "arc4rand");
168SYSCTL_PROC(_kern, KERN_ARND, arandom,
169 CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0,
170 sysctl_kern_arnd, "", "arc4rand");
170
171static int
172sysctl_hw_physmem(SYSCTL_HANDLER_ARGS)
173{
174 u_long val;
175
176 val = ctob(physmem);
177 return (sysctl_handle_long(oidp, &val, 0, req));

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

262 bcopy(tmphostname, V_hostname, MAXHOSTNAMELEN);
263 mtx_unlock(&hostname_mtx);
264 }
265 }
266 return (error);
267}
268
269SYSCTL_PROC(_kern, KERN_HOSTNAME, hostname,
171
172static int
173sysctl_hw_physmem(SYSCTL_HANDLER_ARGS)
174{
175 u_long val;
176
177 val = ctob(physmem);
178 return (sysctl_handle_long(oidp, &val, 0, req));

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

263 bcopy(tmphostname, V_hostname, MAXHOSTNAMELEN);
264 mtx_unlock(&hostname_mtx);
265 }
266 }
267 return (error);
268}
269
270SYSCTL_PROC(_kern, KERN_HOSTNAME, hostname,
270 CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_PRISON,
271 CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_PRISON|CTLFLAG_MPSAFE,
271 0, 0, sysctl_hostname, "A", "Hostname");
272
273static int regression_securelevel_nonmonotonic = 0;
274
275#ifdef REGRESSION
276SYSCTL_INT(_regression, OID_AUTO, securelevel_nonmonotonic, CTLFLAG_RW,
277 &regression_securelevel_nonmonotonic, 0, "securelevel may be lowered");
278#endif

--- 192 unchanged lines hidden ---
272 0, 0, sysctl_hostname, "A", "Hostname");
273
274static int regression_securelevel_nonmonotonic = 0;
275
276#ifdef REGRESSION
277SYSCTL_INT(_regression, OID_AUTO, securelevel_nonmonotonic, CTLFLAG_RW,
278 &regression_securelevel_nonmonotonic, 0, "securelevel may be lowered");
279#endif

--- 192 unchanged lines hidden ---