[Date Prev][Date Next] [Chronological] [Thread] [Top]

(a.josey 12144) Re: (c.harding 29009) Re: c-api-03 minor nits



Hi -

At 18:34 09/06/99 -0400, Mark Smith wrote:
>"Kurt D. Zeilenga" wrote:

>> ...
>> 6) struct timeval
>> 
>> Not all systems timeval fields are of type 'long'.
>> Implementations must be allowed to declare struct
>> timeval as it is found in primary header files of
>> the current C translator.
>
>I didn't realize that was the case.  Is timeval defined in a POSIX spec.
>(it must be)?  It would be nice to have a reference.
>
struct timeval is defined in the Single UNIX Specification (Open Group
Publication, see
http://www.opengroup.org/onlinepubs/007908799/xsh/systime.h.html ) to be
available when <sys/time.h> is included and to contain fields 

   time_t       tv_sec        seconds
   suseconds_t  tv_usec       microseconds

I don't beleive that it is defined in ISO 9945 or IEEE 1003.1 (POSIX).
Rather, POSIX defines struct timespec, to be available when <time.h> is
included, and containing:

   time_t       tv_sec        seconds
   long         tv_nsec       nanoseconds

The argument for the timespec as opposed to the timeval structure is that,
these days, microseconds are a pretty coarse granularity for timers.

You might consider changing the LDAP API to use timespecs rather than
timevals.

BTW, a very minor nit, in the definition of ldap_compare_ext (section 10.9,
page 30), there should be a comma following "struct berval *bvalue".



Regards,

Chris
+++++

-------------------------------------------------------------------------
           Chris Harding
  T H E    Development Manager
 O P E N   Apex Plaza, Forbury Road, Reading RG1 1AX, UK
G R O U P  Mailto:c.harding@opengroup.org   Ph: +44 118 950 8311 x2262
           WWW: http://www.opengroup.org    Fx: +44 118 950 0110  

OSF/1, Motif, UNIX and the "X" device are registered trademarks in
the US and other countries, and IT DialTone and The Open Group are
trademarks of The Open Group.
-------------------------------------------------------------------------