[Lldb-commits] [PATCH] Apply SOCK_CLOEXEC flag to socket API functions in order to avoid handle leakage to a forked child process.

Greg Clayton clayborg at gmail.com
Mon Nov 10 16:45:42 PST 2014


I don't think this is a good default. Sockets are often used for IPC after fork/exec, but I would like to make a way to specify close on exec by supplying a boolean argument to ConnectionFileDescriptor() when creating it. Then clients will opt into this by force as they will need to supply the argument. Or you can make a default argument that defaults to true for "close_on_exec".

So maybe a boolean to:

    virtual lldb::ConnectionStatus ConnectionFileDescriptor::Connect(const char *s, Error *error_ptr, bool close_on_exec = true);

Then this gets passed along to whomever creates the IOObject subclass and they each do the right thing if they can

http://reviews.llvm.org/D6204






More information about the lldb-commits mailing list