From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 27B46BC57 for ; Thu, 8 Jul 2010 19:23:20 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqQBAI+mNUzAbSoIe2dsb2JhbACDHp0TFQEBFiIEHrAOkVKBKYFBgUlyBIhC X-IronPort-AV: E=Sophos;i="4.53,559,1272837600"; d="scan'208";a="62968183" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Jul 2010 19:23:19 +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 o68HNIUg002720 for ; Thu, 8 Jul 2010 19:23:19 +0200 Received: by siouxsie (Postfix, from userid 1000) id CC25E1325; Thu, 8 Jul 2010 19:23:18 +0200 (CEST) Date: Thu, 8 Jul 2010 19:23:18 +0200 From: oliver@first.in-berlin.de To: caml-list List Subject: Re: [Caml-list] Distinguish between osx and linux programmatically Message-ID: <20100708172318.GB2178@first.in-berlin.de> References: <20100708102314.GA16057@annexia.org> <20100708104517.GA848@Stubb-2.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 0200,:01 uname:01 uname:01 basename:01 syscalls:01 stdlib:01 hacks:01 wrote:01 wrote:01 oliver:01 oliver:01 caml-list:01 external:03 daniel:04 On Thu, Jul 08, 2010 at 01:09:41PM +0200, Daniel Bünzli wrote: > On Thu, Jul 8, 2010 at 12:23 PM, Richard Jones wrote: > > > How about running the external "uname" program. > > Yes, why not. I was hoping that I wouldn't have to resort to that kind > of hacks, that I was missing a function using uname(3) directly. [...] There is uname(1) and uname(2). Why do you call it "hack"? You could write a C-binding for uname(2), but does the effort makes sense for this call? It's not like you start a whole shell over and over again, just to get the basename of a file for some 100000 files... I would assume the call of uname a thing that will be done once at startup of the program. For many syscalls I think it makes sense to have them in the stdlib, but this one is not the one, where I think it's really urgent to have it. Ciao, Oliver