This is the mail archive of the libc-hacker@sourceware.cygnus.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]

Re: Misc patches for glibc


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


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