From owner-freebsd-emulation Sat Oct 11 20:49:17 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA26232 for emulation-outgoing; Sat, 11 Oct 1997 20:49:17 -0700 (PDT) (envelope-from owner-freebsd-emulation) Received: from word.smith.net.au (ppp20.portal.net.au [202.12.71.120]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA26226 for ; Sat, 11 Oct 1997 20:49:11 -0700 (PDT) (envelope-from mike@word.smith.net.au) Received: from word.smith.net.au (localhost [127.0.0.1]) by word.smith.net.au (8.8.7/8.8.5) with ESMTP id NAA00872; Sun, 12 Oct 1997 13:16:11 +0930 (CST) Message-Id: <199710120346.NAA00872@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: Jonathan Mini cc: freebsd-emulation@FreeBSD.ORG Subject: Re: LINUX emulation and uname(3). In-reply-to: Your message of "Sat, 11 Oct 1997 15:41:49 MST." <19971011154149.56660@micron.mini.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 12 Oct 1997 13:16:10 +0930 From: Mike Smith Sender: owner-freebsd-emulation@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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