Version franaise
Home About Download Resources Contact us
Browse thread
Distinguish between osx and linux programmatically
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: oliver@f...
Subject: Re: [Caml-list] Distinguish between osx and linux programmatically
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 <rich@annexia.org> 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