This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: struct stat.h with nanosecond resolution


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 `---------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]