Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 1997 13:16:10 +0930
From:      Mike Smith <mike@smith.net.au>
To:        Jonathan Mini <mini@d198-232.uoregon.edu>
Cc:        freebsd-emulation@FreeBSD.ORG
Subject:   Re: LINUX emulation and uname(3). 
Message-ID:  <199710120346.NAA00872@word.smith.net.au>
In-Reply-To: Your message of "Sat, 11 Oct 1997 15:41:49 MST." <19971011154149.56660@micron.mini.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> I have a question : How are these programs using the uname to detect if it's a
> linux system? are they jsut checkign to see that 'linux' exists in the uname
> string?

Most scripts check the output of 'uname' for equivalence to 'Linux'.  
There is a dummy 'uname' script installed as part of the Linux 
emulation support that does the Right Thing in this regard.  This 
generally means that you need to be running a Linux-mode shell before 
you start running the script. 

Applications calling uname() generally shouldn't (and don't) care what 
the system type returned is; the one that started this thread was a 
little un-savvy in that regard.

> If so, it seems to me that returning something like 
> 'Linux-emu (FreeVBSD blah.blah.blah)' would be a good solution. Also, this
>  means that programs like Netscape (linux binary) would properly return the
> fact that it is running under linux emulation under FreeBSD. 

Programs like the Linux Netscape correctly report that they are running 
on FreeBSD.  If you are a Linux binary and uname() doesn't report 
'Linux', it may report 'FreeBSD', 'NetBSD', 'OpenBSD' or almost 
anything else.  Not handling this sensibly is a bug.

mike




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710120346.NAA00872>