followup: stuck lmtpd processes

Tom tom at sdf.com
Fri Sep 26 03:02:36 EDT 2003


On Wed, 24 Sep 2003, Henrique de Moraes Holschuh wrote:

> On Wed, 24 Sep 2003, Etienne Goyer wrote:
> > On Wed, Sep 24, 2003 at 11:27:46AM -0400, Rob Siemborski wrote:
> > > However, I have looked into this and to my surprise, Linux is indeed
> > > restarting the system calls instead of returning with EINTR.  However, the
> > > answer here is to set up the alarm() handler with sigaction without
> > > setting SA_RESTART, not to jump through select() hoops or make nonblocking
> > > lock attempts.
> >
> > I consult my local Unix guru on the subject, and he point me to
> > "Advanced Programming in the Unix Environment" by W. Richard Stevens,
> > section 10.5 (page 275 in my edition) "Interrupted System Calls".
> > The revelancy of this text may be questionned since it was published in
> > 1992, but the behavior of SVR4 vs BSD differ substantially in this
> > regard according to it.  My guru concluded that system call interuption
> > by signal is an assumption that may lead to portability problem.  In the
> > fud case, he is right.
>
> With SYSV you will get the interrupted system call, unless you tell it
> somehow not to do it (the SA_RESTART stuff).  If we are to accomodate the
> BSDs, we can:
>   1. Let them have the short end of the stick (they get what we have now,
>      that is, deadlocks). Not good.
>   2. Let them use the low-performance non-blocking mode (good solution).
>   3. Find out how to get EINTR from BSD (it should be possible nowadays).
>
> As for old legacy systems (too old BSDs, SunOS 4, very old Linux), well, I
> am inclined to simply ignore them.  Let them use solution (2) above.  That
> is the least of their problems, given the amount of annoying and dangerous
> bugs those old kernels have.

  #2 doesn't sound like a good option for anyone.  It is not clear from
the context in this message whether you want restartable system calls or
not.  BSD4.2 introduced restartable system calls.  BSD4.3 introduced
siginterrupt() to disable restartable system calls for a certain signal.
So even with SunOS 4, you'd have the option.

  Newer BSDs have SA_RESTART via sigaction().  sigaction() is supposed to
conform to the POSIX.1 standard, and therefore probably works the same as
Linux.

> --
>   "One disk to rule them all, One disk to find them. One disk to bring
>   them all and in the darkness grind them. In the Land of Redmond
>   where the shadows lie." -- The Silicon Valley Tarot
>   Henrique Holschuh
>

Tom




More information about the Info-cyrus mailing list