Misc patches for glibc
H.J. Lu
hjl@lucon.org
Sat Nov 7 22:42:00 GMT 1998
>
> hjl@lucon.org (H.J. Lu) writes:
>
> > Please take a look at
> >
> > http://www.opengroup.org/onlinepubs/7908799/xsh/sigtimedwait.html
> >
> > To me, it implies I can do
> >
> > #include <signal.h>
> > [...]
>
> Not really. You only need a forward declaration in some cases.
>
> Anyhow, since it is well known the timespec is in time.h and since
> some other platforms also follow the POSIX and Unix98 standard closely
> it is best to keep the forward declaration. This ensures portability.
>
FYI, both Solaris 2.5.1 and HP-UX 10.20 define timespec in
<signal.h> when sigtimedwait () is available. That means
#include <signal.h>
int
foo ()
{
struct timespec x;
x.tv_sec = 0;
x.tv_nsec = 0;
...
return sigtimedwait (..., ..., &x);
}
will compile on Solaris 2.5.1 and HP-UX 10.20, but not on glibc 2.
I think glibc 2 is wrong.
--
H.J. Lu (hjl@gnu.org)
More information about the Libc-hacker
mailing list