Re: race condition?

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Lee McLoughlin
日付:  
To: Neal Becker
CC: Philip Hazel, Ian Jackson, exim-users
題目: Re: race condition?
Neal Becker wrote:
>
> >>>>> "Philip" == Philip Hazel <ph10@???> writes:
>
> [...]
>     >> Surely when it re-execs itself it should pass the socket file
>     >> descriptor on to the new daemon process, so that it doesn't have to be
>     >> created and bound again ?

>
>     Philip> On Wed, 10 Apr 1996, Lee McLoughlin wrote:

>
>     >> Yes ideally it should.  However it is fairly fiddly to do.  A lot of exec's
>     >> will close off all file descriptors unless you are careful to setup flags.

>
> So why not pass the open fd? That does sound a lot more reliable.
> Doesn't exec pass open fd's on every un*x system? Why is this 'fairly
> fiddly' to do?


You want to make sure that the only fd passed is the bound socket. So you should
flag all other fd's as close_on_exec. Which is done by different mechanisms on
different unixes. That is why it is fiddly.

--
Lee McLoughlin.                         Phone: +44 171 594 8388
IC-Parc, Imperial College,              Fax:   +44 171 594 8449
South Kensington, London. SW7 2BZ. UK.  Email: L.McLoughlin@???