Re: struct timespec

Derek Atkins (warlord@mit.edu)
Tue, 18 Jun 1996 11:54:21 -0400


According to POSIX.1 Section 14.1.1, "A time value structure timespec
specifies a single time value and includes at least the following
members:
member type member name description
time_t tv_sec seconds
long tv_usec nanosections

Therefore, the definition in linux/time.h is correct and the pthreads
definition is incorrect. I doubt Linus will accept this patch, since
it breaks POSIX compatibility.

Enjoy!

-derek

> Last week, I found out, that timespec is declared as
> struct timespec {
> long tv_sec; /* seconds */
> long tv_nsec; /* nanoseconds */
> };
>
> However pthreads declares it in its own header files as
> struct timespec {
> long ts_sec; /* seconds */
> long ts_nsec; /* nanoseconds */
> };
> which seems a little bit more intuitive to me.