[pisa-src] Re: r2137 - in trunk: Makefile.am libpisa/scheduler.c libpisa/scheduler.h libpisa/sysdep.c libpisa/sysdep.h libpisa/util.c libpisa/util.h

  • From: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Mon, 15 Mar 2010 01:20:20 +0100

Diego Biurrun <diego@xxxxxxxxxx> wrote:
> > +#ifdef __linux__
> > +
> > +#define HAVE_CLOCK_GETTIME
> > +
> > +#endif /* __linux__ */  
> 
> This is ugly and nonportable.  I don't even think it's correct since
> there is no direct relationship between the kernel and clock_gettime()
> availability.  I bet it's missing not only in OS X but also on older
> Linux distros, maybe OpenWrt, scratchbox, maemo...

True, it's a bit ugly. True, the real culprit is the C library. But:
1. this is far from being written in stone. So I will add libc flavour
detection if and when needed.
2. you'd be surprised to see how old this is :) In 2008 I was working with this
on some old distributions (for that time).

> This should be a proper check in configure.

What we really need is the conditional linking with -lrt (have it just on
Linux).

Mircea


-- 
Dipl.-Ing. Mircea Gherzan

Other related posts: