struct timespec normalization

Thomas Schwinge thomas@codesourcery.com
Fri Feb 10 21:08:00 GMT 2012


Hi!

On Mon, 6 Feb 2012 09:50:05 -0800, Roland McGrath <roland@hack.frob.com> wrote:
> This suggests we'd benefit from a common inline function to do that.

For referene, ``that'' is the following idiom:

| -	  if (wakeup_time.tv_nsec > 1000000000)
| +	  if (wakeup_time.tv_nsec >= 1000000000)
|             {
|               wakeup_time.tv_nsec -= 1000000000;
|               ++wakeup_time.tv_sec;
|             }

Would ``that'' go into time/time.h, to find its place in
/usr/include/time.h, guarded by __USE_GNU (like TIMEVAL_TO_TIMESPEC in
time/sys/time.h, for example) -- that is, for general consumption and
benefit?  Or should it be only an internal thing, thus go into
include/time.h, avoiding us to have to think about versioning and all
that?


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120210/1cb95aa4/attachment.sig>


More information about the Libc-alpha mailing list