[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EINTR causing useless recompilation?

From: Tom Rodriguez
Subject: Re: EINTR causing useless recompilation?
Date: Thu, 23 Jan 2003 19:31:48 -0800

Hello.  I've finally gotten a chance to look at this more closely and
the problem is that GNU make assume that SA_RESTART restarts all
system calls which isn't true for solaris and I suspect isn't true for
any System V based Unix.  From looking at the linux sources it appears
to restart everything but solaris seems to explicitly follow this
language from the man page for sigaction:

           If set and the signal is caught,  functions  that  are
           interrupted  by the execution of this signal's handler
           are transparently  restarted  by  the  system,  namely
           fcntl(2), ioctl(2),  wait(2),
            waitid(2), and the following functions on  slow  dev-
           ices  like  terminals:  getmsg()  and  getpmsg()  (see
           getmsg(2));  putmsg() and putpmsg()  (see  putmsg(2));
           pread(),  read(), and readv() (see read(2)); pwrite(),
           write(),  and   writev()   (see   write(2));   recv(),
           recvfrom(),  and  recvmsg()  (see  recv(3SOCKET)); and
           send(), sendto(), and  sendmsg()  (see  send(3SOCKET).
           Otherwise, the function returns an  EINTR error.

A quick glance at the solaris sources and the disassembly of _stat vs.
_read shows that read will restart itself but stat will not so the man
page seem to accurately reflect what really going to happen.

The source of the signals is the SIGCHLD handler installed by the
jobserver logic.  It's true that --disable-job-server will make this
problem disappear but maybe it should be disabled by default on
Solaris since it clearly doesn't work.

>  2) Although your OS says it supports SA_RESTART, in fact it does not
>     properly implement it.  I've already discovered another OS, Sequent
>     PTX, which defines the SA_RESTART constant in the system header
>     files, but it does not actually work.
>     To the best of my knowledge SA_RESTART does work properly in Solaris
>     2.7 and above (at least) on SPARC.  I've never tried it on x86.

I've seen failures with EINTR on Solaris sparc 2.7, 2.8 and solaris
x86 2.8, so I don't think it works.   The sparc failures are on
machines with more than 15 CPUs but the Solaris x86 failures are on a
4 way system.  I tried defining HAVE_BROKEN_RESTART on solaris but
that doesn't compile since Solaris already has #define of stat to
stat64 for large file support.  Why not simply define atomic_stat and
atomic_readdir all the time and use them throughout make?  It wouldn't
hurt any platform that never returns EINTR and would guarantee that it
works on any platform with a more restricted definition of
SA_RESTART.  Thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]