struct stat.h with nanosecond resolution

Ulrich Drepper drepper@redhat.com
Mon Dec 2 11:40:00 GMT 2002


Andreas Jaeger wrote:

> I'm not sure that this is right either.  Uli, what is the proper way
> to handle <time.h>?  I currently don't see a clean solution for
> this:-(

We have something similar in a number of places.

<time.h> unconditionally defines struct __timespec.  The member names
are namespace-protected as well.

If __need_timespec is defined or <time.h> is included normally three new
macros are defined:

#define timespec __timespec
#define tv_sec __tv_sec
#define tv_nsec __tv_nsec


The only acceptable alternative is to not use a struct at all in
POSIX/Unix mode.  Use the "inlined" time_t/long fields.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------



More information about the Libc-alpha mailing list