Use the O_CLOEXEC flag only when it is available. Some old systems (e.g.
SLES10) do not support this flag. POSIX explicitly guarantees that this
flag can be checked for using #if, so there is no need for a CMake
check.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
In the original version my patch (D28854) I had fallback code which sets the FD_CLOEXEC flag using fcntl(2). What do you think about using that? It's a bit racy, but it's better than nothing.
I intend to start using these function from lldb, so if anyone will use lldb on the old systems, he'll get descriptor leakage there.
Comment Actions
Now I am not sure whether that meant "yeah, that'll work and i'll do it", or "yeah, go ahead and you do it" :P, but based on lack of activity, it seems to be latter.
I'll go ahead and add those then. I'd very much appreciate if you could test it for me though.
Comment Actions
@rafael: I am going to assume you are fine with this as well. Let me know if you have concerns.