nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nmh-workers] closefds() _before_ fork?


From: Ken Hornstein
Subject: Re: [nmh-workers] closefds() _before_ fork?
Date: Thu, 25 Apr 2019 16:53:34 -0400

>Basically, it opens a file and  attempts to obtain an exclusive lock the
>file  descriptor for  that  file. If/when  it  successfully obtains  the
>exclusive lock  it then uses exec()  to execute a new  process, and that
>new process inherits  the open file descriptor. As long  as that process
>leaves the file  descriptor open, it continues to hold  the lock on said
>file  which  prevents  any  similarly  invoked  processes  from  running
>concurrently.
>
>The  lock goes  away either  when the  file descriptor  is intentionally
>closed, or the process exits or crashes.

Ah, alright, I see how that works.  And yes, as you note later on, this
should actually be an improvement over current nmh behavior, at least
in relation to programs that want to do this sort of thing.

>Yes, I see  what you mean---also, I didn't realize  that the approach in
>nmh was so  varied, but then, I haven't looked  at the sources in-depth.

Yeah, consistency is not an nmh (nor MH) hallmark, sadly :-)

--Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]