[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: struct timespec on NSK (FYI)
From: |
Matthew Woehlke |
Subject: |
Re: struct timespec on NSK (FYI) |
Date: |
Fri, 08 Dec 2006 18:53:18 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.0 |
Paul Eggert wrote:
Matthew Woehlke writes:
While trying to build gzip 1.3.7, I noticed inconsistent usage of
gnulib's timespec.h via stat-time.h, which led me to dig up where
'struct timespec' is defined on NSK. It turns out the declaration is
in spt_types.h, included in spthread.h.
Does this actually matter?
I'm not sure it does. I was going to say so in my original post until I
looked up the actual declaration.
That is, does the gnulib (or gzip code)
use any system functions that use the spt_types.h version of struct
timespec?
...and this is the real question. Realize, by "the spt_types.h version"
you mean "struct timespec" (actually, it turns out that pthreads.h would
pick up one in dec/cma_px.h - who woulda thought? - that is the same),
since this is the ONLY variety of "struct timespec" I could find on NSK.
One would have to assume "no", since no header defining it was pulled
in, although the call to localtime() which uses the tv_sec member is
more likely to be problematic. Except, ironically, time_t is correct for
that. :-)
Other than that I don't see gzip using it.
If not, then let's not worry about it: gzip will use its
own struct timespec which conforms to POSIX, and this will work better
for gzip than trying to deal with a nonstandard version of struct
timespec that doesn't really matter.
Given the difference (tv_secs signed vs unsigned), do you really expect
treating a signed as an unsigned to matter? Is tv_secs allowed to be
negative?
There might be a problem with the replacement, since NSK's types.h
defines time_t as 'long', but spt_types.h gives the type of tv_sec as
'unsigned long'.
Sounds like a recipe for bugs to me. Let's avoid the NSK struct
timespec if we can.
gzip looks OK (sans the problem in zip.c). Not sure about the rest of
gnulib; does it ever pull any of the following headers?
spt_types.h cma.h cma_*.h pthread.h spthread.h pthread_exc.h
(pthread.h is the only one I might expect to see, the rest I think are
probably NSK-specific.)
If not, then it is not going to pick up NSK's struct timespec, therefore
it will not pick up any system functions using it.
--
Matthew
HIPPOS wallow slightly in the MUDDY RIVER
What do you want to do next?
> WALLOW IN MUDDY RIVER
You join HIPPOS.