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_misc.c | |
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_misc.c')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 929bfaa..74fb731 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -25,7 +25,7 @@ * (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: linux_misc.c,v 1.66 1999/08/25 11:19:02 marcel Exp $ + * $Id: linux_misc.c,v 1.67 1999/08/25 14:11:01 marcel Exp $ */ #include "opt_compat.h" @@ -61,6 +61,7 @@ #include <i386/linux/linux.h> #include <i386/linux/linux_proto.h> #include <i386/linux/linux_util.h> +#include <i386/linux/linux_mib.h> #include <posix4/sched.h> @@ -880,15 +881,19 @@ int linux_newuname(struct proc *p, struct linux_newuname_args *args) { struct linux_new_utsname utsname; + char *osrelease, *osname; #ifdef DEBUG printf("Linux-emul(%ld): newuname(*)\n", (long)p->p_pid); #endif + osname = linux_get_osname(p); + osrelease = linux_get_osrelease(p); + bzero(&utsname, sizeof(struct linux_new_utsname)); - strncpy(utsname.sysname, "Linux", LINUX_MAX_UTSNAME-1); + strncpy(utsname.sysname, osname, LINUX_MAX_UTSNAME-1); strncpy(utsname.nodename, hostname, LINUX_MAX_UTSNAME-1); - strncpy(utsname.release, "2.0.36", LINUX_MAX_UTSNAME-1); + strncpy(utsname.release, osrelease, LINUX_MAX_UTSNAME-1); strncpy(utsname.version, version, LINUX_MAX_UTSNAME-1); strncpy(utsname.machine, machine, LINUX_MAX_UTSNAME-1); strncpy(utsname.domainname, domainname, LINUX_MAX_UTSNAME-1); |