# HG changeset patch # User Paul Eggert # Date 1309471496 25200 # Node ID 15ab18909697a9644cb24bc9f6a0b9ad453c6017 # Parent e121c7cef4a99fd6fe154eacd0a90d9af81c591f * lib/timespec.h (timespec_sign): New inline function. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2011-06-30 Paul Eggert + * lib/timespec.h (timespec_sign): New inline function. + pselect: new module * lib/sys_select.in.h: Include , for 'sigset_t'. (pselect): New decls. diff --git a/lib/timespec.h b/lib/timespec.h --- a/lib/timespec.h +++ b/lib/timespec.h @@ -57,6 +57,14 @@ : (int) (a.tv_nsec - b.tv_nsec)); } +/* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be + nonnegative. */ +static inline int +timespec_sign (struct timespec a) +{ + return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; +} + void gettime (struct timespec *); int settime (struct timespec const *);