npth-0.90 build report
wk at gnupg.org
Sat May 12 10:19:53 CEST 2012
On Fri, 11 May 2012 21:38, lists at openorbit.org said:
> I decided to publish some code I wrote earlier at github. It
> implements clock_gettime for OS X / darwin. I kindly offer it using a
> dual GPL v2 or LGPL v3 or later license. This may be interesting for
Thanks for that offer. However, I already implemented it using
npth_clock_gettime (struct timespec *ts)
#if defined(CLOCK_REALTIME) && HAVE_CLOCK_GETTIME
return clock_gettime (CLOCK_REALTIME, ts);
struct timeval tv;
if (gettimeofday (&tv, NULL))
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
/* FIXME: fall back on time() with seconds resolution. */
# error clock_gettime not available - please provide a fallback.
The gotcha was that HAVE_CLOCK_GETTIME alone was not sufficient, a test
for the CLOCK_REALTIME macro was also required. It would be better to
do the test for CLOCK_REALTIME while testing for clock_gettime, but
well, this was easier.
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
More information about the Gnupg-devel