On Jan 14 06:02, Eric Blake wrote:
>
> In a multi-threaded app, any fd that is opened only temporarily, such as
> the one in mq_open, should be opened with O_CLOEXEC, so that no other
> thread can win a race and do a fork/exec inside the window when the
> temporary fd was open. So even though mq_open does not leak an fd to the
> current process, it should pass O_CLOEXEC as part of its internal open()
> call in order to avoid leaking the fd to unrelated child processes.
Uh, ok, that makes sense.
I'll send a revised patch later today. It will also include the pipe2
implementation.