[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [nmh-workers] closefds() _before_ fork?
From: |
Ralph Corderoy |
Subject: |
Re: [nmh-workers] closefds() _before_ fork? |
Date: |
Tue, 23 Apr 2019 13:10:46 +0100 |
Hi,
David wrote:
> Ken wrote:
> > I suggest we simply remove closefds() completely.
...
> Ralph's suggestion of looking for only open fds addresses the
> suboptimality of closefds(), though only for systems that use /proc.
That was just meant as a temporary debugging aid to see what was
sneaking through. :-)
I agree with the general principle that if we open it, we track it, and
then close it so it doesn't reach the child, typically with O_CLOEXEC or
FD_CLOEXEC. Calling close(2) lots of times based on getdtablesize(3)
can take a while. screen(1) had a bug recently where it was taking ages
trying to close almost 512 Ki of them.
https://lists.archlinux.org/pipermail/arch-general/2019-March/046214.html
I don't think there's any multi-threading in nmh so we just have what's
open at the time of fork(2) to deal with.
--
Cheers, Ralph.
- Re: [nmh-workers] closefds() _before_ fork?, (continued)
- Re: [nmh-workers] closefds() _before_ fork?, David Levine, 2019/04/22
- Re: [nmh-workers] closefds() _before_ fork?, Tom Lane, 2019/04/22
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/22
- Re: [nmh-workers] closefds() _before_ fork?, Ralph Corderoy, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Valdis Klētnieks, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Robert Elz, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Valdis Klētnieks, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Robert Elz, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Valdis Klētnieks, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?,
Ralph Corderoy <=
- Re: [nmh-workers] closefds() _before_ fork?, Paul Vixie, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Ralph Corderoy, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Tom Lane, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Andy Bradford, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Andy Bradford, 2019/04/24
- Message not available
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/25