From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 33DB8BC57 for ; Thu, 8 Jul 2010 19:17:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As0BAGOlNUzAbSoIe2dsb2JhbACDHpBVjD4VAQEWIgQesBKRT4EpgwpyBIhC X-IronPort-AV: E=Sophos;i="4.53,559,1272837600"; d="scan'208";a="53837224" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Jul 2010 19:17:44 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from siouxsie (e178016112.adsl.alicedsl.de [85.178.16.112]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id o68HHhtK002297 for ; Thu, 8 Jul 2010 19:17:43 +0200 Received: by siouxsie (Postfix, from userid 1000) id 815481325; Thu, 8 Jul 2010 19:17:43 +0200 (CEST) Date: Thu, 8 Jul 2010 19:17:43 +0200 From: oliver@first.in-berlin.de To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Distinguish between osx and linux programmatically Message-ID: <20100708171743.GA2178@first.in-berlin.de> References: <20100708114434.GB16057@annexia.org> <201007081042.41196.toots@rastageeks.org> <20100708170124.GC16057@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100708170124.GC16057@annexia.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Spam: no; 0.00; in-berlin:01 0100,:01 stdlib:01 uname:01 uname:01 stdlib:01 non-unix:01 mingw:01 cygwin:01 imho:01 wrote:01 wrote:01 unix:01 oliver:01 oliver:01 On Thu, Jul 08, 2010 at 06:01:24PM +0100, Richard Jones wrote: > On Thu, Jul 08, 2010 at 10:42:40AM -0500, Romain Beauxis wrote: > > Le jeudi 8 juillet 2010 06:44:34, Richard Jones a écrit : > > > Stdlib could bind the uname(2) syscall, but it's legendary in its > > > complexity. Seems more likely to cause problems than just calling out > > > to the external program. > > > > I fail to see the complexity.. Where is it ? > > Actually *I* misunderstood the link I posted > (http://www.kernel.org/doc/man-pages/online/pages/man2/uname.2.html#NOTES) > thinking it meant that the string fields in the structure could have > variable width. Reading it again, they don't. > > Nevertheless I still think this is not a useful addition to stdlib, > but for different reasons: > > (1) You'd have to emulate it on non-Unix platforms, but it's unclear > what you'd emulate it with. Windows has a completely different and > much richer concept of OS version. This sort of version probing > complexity doesn't belong in the core library, but in an external "OS > version" library where detection rules can be frequently updated. [...] $ uname -a If it's not Unix, what will uname(2) or uname(1) give you? What will be reported on Windows with MinGW or Cygwin? IMHO using uname(1) is fine. Ciao, Oliver