Re: [EXIM] accept() errors instead of accepting when network…

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Philip Hazel
Data:  
Para: Greg A. Woods
CC: exim-users
Assunto: Re: [EXIM] accept() errors instead of accepting when network unreachable
On Thu, 19 Nov 1998, Greg A. Woods wrote:

> At some point someone (perhaps even Ron Karr or Landon Noll) discovered
> the following (this comment goes back to before 1992):
>
> /*
> * Interactive UNIX 2.2 has a bug in accept(). If accept() is
> * interrupted by an alarm signal, accept() does not return from
> * waiting for a connection with errno set to EINTR. Unfortunately
> * this is necessary for smail to process its mail queues at regular
> * intervals, as specified with the -q option.
> *
> * Interactive's select() does work correctly, however. Thus,
> * we use select() to determine when to call accept(), and catch
> * alarm signals out of select(), instead of out of accept().
> */


A similar experience happened in Exim:

/* Sleep till a connection happens if listening, and handle the connection if
that is why we woke up. The FreeBSD operating system requires the use of
select() before accept() because the latter function is not interrupted by
a signal, and we want to wake up for SIGCHLD and SIGALRM signals. Some other
OS do notice signals in accept() but it does no harm to have the select()
in for all of them - and it won't then be a lurking problem for ports to
new OS. In fact, the later addition of listening on specific interfaces only
requires this way of working anyway. */


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



--
*** Exim information can be found at http://www.exim.org/ ***