<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 23, 2015 at 3:23 AM, Donn Cave <span dir="ltr"><<a href="mailto:donn@avvanta.com" target="_blank">donn@avvanta.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">quoth Niklas_Hambüchen,<br>
<span class="">>> do that, you set up the conditions for breaking something that<br>
>> works in C, which I hate to see happen with Haskell.<br>
><br>
> While I understand your opinion here, I'm not sure that "breaking<br>
> something that works in C" is the right description. O_CLOEXEC changes a<br>
> default setting, but does not irrevocably disable any feature that is<br>
> available in C.<br>
<br>
</span>Sure, it isn't irrevocable - so what's broken may be fixed, if you<br>
have access to it, but of course it's better not to break things<br>
in the first place.<br>
<span class=""><br>
> In other words, CLOEXEC is something that is easy to *undo* locally when<br>
> you don't want it, but hard to *do* globally when you need it.<br>
<br>
</span>Yes, of course, I understand the appeal. But it's a deep change<br>
to the way FDs have historically worked that affects widely used<br>
UNIX features, and it doesn't solve the problem - sockets, file<br>
descriptors created by external libraries or inherited from the<br>
parent process, child processes that don't exec - so if you want<br>
to relieve a child process of all extraneous open files, you still<br>
have to walk the FD table, the sam way it's been done for the last<br>
20 or 30 years. Fork-exec is the relatively unusual event where<br>
it makes sense to deal with these issues - including other resources<br>
besides FDs as required. Fork-exec outside of GHC should of course<br>
continue to work as written.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>This history is from before the c10k problem and related file descriptor scaling became relevant.<br><br>Yes we need to walk the open file descriptors by walking /prod/self/fd and using obscure APIs on OS X. No matter how you see it, it's not what it was 30 years ago.<br><br></div><div>Alexander<br></div></div></div></div>