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/compat/linux/linux_mib.h | |
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/compat/linux/linux_mib.h')
-rw-r--r-- | sys/compat/linux/linux_mib.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h new file mode 100644 index 0000000..24c2548 --- /dev/null +++ b/sys/compat/linux/linux_mib.h @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 1999 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software withough specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $Id$ + */ + +#ifndef _LINUX_MIB_H_ +#define _LINUX_MIB_H_ + +char* linux_get_osname __P((struct proc *p)); +int linux_set_osname __P((struct proc *p, char *osname)); + +char* linux_get_osrelease __P((struct proc *p)); +int linux_set_osrelease __P((struct proc *p, char *osrelease)); + +int linux_get_oss_version __P((struct proc *p)); +int linux_set_oss_version __P((struct proc *p, int oss_version)); + +#endif /* _LINUX_MIB_H_ */ |