diff options
author | marcel <marcel@FreeBSD.org> | 1999-08-27 19:47:41 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 1999-08-27 19:47:41 +0000 |
commit | 421ba20de2168eca011b02a722a39a50edbcc3bb (patch) | |
tree | e76e287183d035dafec15693fbd1edc52428cd1e /sys/kern | |
parent | 10d7165e451a9b3103b41e843fd883bc9f69e7bc (diff) | |
download | FreeBSD-src-421ba20de2168eca011b02a722a39a50edbcc3bb.zip FreeBSD-src-421ba20de2168eca011b02a722a39a50edbcc3bb.tar.gz |
Add sysctl variables for the Linuxulator. These reside under `compat.linux' as
discussed on current.
The following variables are defined (for now):
osname (defaults to "Linux")
Allow users to change the name of the OS as returned by uname(2),
specially added for all those Linux Netscape users and statistics
maniacs :-) We now have what we all wanted!
osrelease (defaults to "2.2.5")
Allow users to change the version of the OS as returned by uname(2).
Since -current supports glibc2.1 now, change the default to 2.2.5
(was 2.0.36).
oss_version (defaults to 198144 [0x030600])
This one will be used by the OSS_GETVERSION ioctl (PR 12917) which I
can commit now that we have the MIB. The default version number is the
lowest version possible with the current 'encoding'.
A note about imprisoned processes (see jail(2)):
These variables are copy-on-write (as suggested by phk). This means that
imprisoned processes will use the system wide value unless it is written/set
by the process. From that moment on, a copy local to the prison will be
used.
A note about the implementation:
I choose to add a single pointer to struct prison, because I didn't like the
idea of changing struct prison every time I come up with a new variable. As
a side effect, the extra storage is only needed when a variable is set from
within the prison. This also minimizes kernel bloat when the Linuxulator is
not used; both compiled in or as a module.
Reviewed by: bde (first version only) and phk
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_exit.c | 7 | ||||
-rw-r--r-- | sys/kern/kern_mib.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 91a7461..10a54ac 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_exit.c 8.7 (Berkeley) 2/12/94 - * $Id: kern_exit.c,v 1.80 1999/04/28 11:36:52 phk Exp $ + * $Id: kern_exit.c,v 1.81 1999/06/07 20:37:29 msmith Exp $ */ #include "opt_compat.h" @@ -508,8 +508,11 @@ loop: /* * Destroy empty prisons */ - if (p->p_prison && !--p->p_prison->pr_ref) + if (p->p_prison && !--p->p_prison->pr_ref) { + if (p->p_prison->pr_linux != NULL) + FREE(p->p_prison->pr_linux, M_PRISON); FREE(p->p_prison, M_PRISON); + } /* * Finally finished with old proc entry. diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index d9e9250..aa69b24 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 - * $Id: kern_mib.c,v 1.22 1999/07/20 07:19:32 phk Exp $ + * $Id: kern_mib.c,v 1.23 1999/08/08 18:42:48 phk Exp $ */ #include <sys/param.h> @@ -72,10 +72,12 @@ SYSCTL_NODE(, CTL_MACHDEP, machdep, CTLFLAG_RW, 0, "machine dependent"); SYSCTL_NODE(, CTL_USER, user, CTLFLAG_RW, 0, "user-level"); - SYSCTL_NODE(, CTL_P1003_1B, p1003_1b, CTLFLAG_RW, 0, "p1003_1b, (see p1003_1b.h)"); +SYSCTL_NODE(, OID_AUTO, compat, CTLFLAG_RW, 0, + "Compatibility code"); + SYSCTL_NODE(_kern, OID_AUTO, prison, CTLFLAG_RW, 0, "Prison rules"); |