Subject: Re: hardcoding uname
To: Todd Vierling <tv@wasabisystems.com>
From: Frank van der Linden <fvdl@vaasje.org>
List: tech-kern
Date: 12/31/2000 20:12:48
On Sun, Dec 31, 2000 at 12:10:49AM -0500, Todd Vierling wrote:
> 	syssrc/sys/compat/linux/common: linux_misc.c linux_oldolduname.c
> 	    linux_olduname.c linux_types.h
> 
> Log Message:
> Hardcode what the linux uname() calls return (Linux 2.2.5 is the current
> value). A few major applications check for this (like VMware), and
> there is no other way to trick them. Needs a more generic solution
> eventually.
> 
> =====
> 
> This doesn't seem right, even in the short term.  (Particularly, this
> shouldn't persist to the 1.6 branch.)

There is currently no better solution. Several applications check for this,
and to provide good emulation, uname() should provide these values.
I don't give a flying f*ck about the argument "but I want netscape
to return 'NetBSD'". If you want something cosmetic rather than having
some binaries actually *work at all*, you're out of your mind.

A generic solution isn't that easy, because:

	1) If you make it a sysctl, it arguably belongs in the Linux
	   emulation bits. However, the Linux emulation can be an LKM,
	   and we don't have a way to register sysctls for LKMs.
	2) Another option is to use p_emuldata (which would be a good
	   place for it), but to set this, you need a new exec() system
	   call. Something like execvee(argp, envp, emuldata). And
	   a 'linuxrun' program to go along with it. And even in that
	   case, returning linux values by default is the best way.

- Frank