<div dir="ltr">I'd like to jump on the "this has bitten me before" bandwagon. +1<br><div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 23, 2017 at 1:49 PM, Bardur Arantsson <span dir="ltr"><<a href="mailto:spam@scientician.net" target="_blank">spam@scientician.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2017-06-23 10:46, Merijn Verstraaten wrote:<br>
> Hi!<br>
><br>
> So I realise proposing backwards incompatible changes to base is tilting at windmills, but I just noticed that most (all?) file operations in base don't open files with O_CLOEXEC, which basically means that every open Handle/file descriptor gets leaked to every single subprocess you fork+exec from Haskell. This seems highly undesirable. For POSIX there appears to be an operation in base that disables this, but it doesn't seem to easily exported.<br>
><br>
> I would like to propose that all operations in base open files with O_CLOEXEC by default and exposing an easy method to mark specific file descriptors to be preserved across exec (This can be achieved by using fcntl to remove the CLOEXEC bit from a specific fd).<br>
><br>
> I'm not sure to what extent Windows behaviour is similar to POSIX, but in principle it should behave the same, I think.<br>
><br>
<br>
</span>+1. Current behavior is suboptimal for *almost* every use case and also<br>
highly surprising.<br>
<br>
Regards,<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div>