Re: [Exim] Exim daemon problem; not closing inherited fds

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: Steve Haslam
CC: exim-users
Tárgy: Re: [Exim] Exim daemon problem; not closing inherited fds
On Mon, 2 Sep 2002, Steve Haslam wrote:

> Exim doesn't seem to close open fds when it goes into the background (i.e.
> when run as exim -bd). This can cause problems if one of the fds is a pipe
> and a parent process is waiting for the pipe to close :(


If I recall correctly, a long time ago Exim did try to close all file
descriptors. But the only way to do this is along the lines of

for (i = 0; i < max; i++) close(i);

When people ran it on operating systems with very many potential fds, it
took far too long to start up. So nowadays it just closes 0, 1, and 2.

If anybody can find a convenient, fast, and portable way to close all
open descriptors, please tell me about it.


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