summaryrefslogtreecommitdiff
path: root/include/lldb/Host/Socket.h
diff options
context:
space:
mode:
authorOleksiy Vyalov <ovyalov@google.com>2014-11-14 16:25:18 +0000
committerOleksiy Vyalov <ovyalov@google.com>2014-11-14 16:25:18 +0000
commit6d3406e944549b81dbdedc0601217d3754442530 (patch)
tree3aeb42e377dfb7e6c252c0eb0b158f518de82301 /include/lldb/Host/Socket.h
parentf75dab5d69e3ee23d4dae85014c68db1ace6d3c9 (diff)
Apply SOCK_CLOEXEC flag to socket API functions in order to avoid handle leakage to a forked child process.
http://reviews.llvm.org/D6204 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@222004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/lldb/Host/Socket.h')
-rw-r--r--include/lldb/Host/Socket.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/lldb/Host/Socket.h b/include/lldb/Host/Socket.h
index 0f3aa0730..77069ae35 100644
--- a/include/lldb/Host/Socket.h
+++ b/include/lldb/Host/Socket.h
@@ -56,16 +56,16 @@ public:
// Initialize a Tcp Socket object in listening mode. listen and accept are implemented
// separately because the caller may wish to manipulate or query the socket after it is
// initialized, but before entering a blocking accept.
- static Error TcpListen(llvm::StringRef host_and_port, Socket *&socket, Predicate<uint16_t>* predicate);
- static Error TcpConnect(llvm::StringRef host_and_port, Socket *&socket);
- static Error UdpConnect(llvm::StringRef host_and_port, Socket *&send_socket, Socket *&recv_socket);
- static Error UnixDomainConnect(llvm::StringRef host_and_port, Socket *&socket);
- static Error UnixDomainAccept(llvm::StringRef host_and_port, Socket *&socket);
+ static Error TcpListen(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket, Predicate<uint16_t>* predicate);
+ static Error TcpConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket);
+ static Error UdpConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&send_socket, Socket *&recv_socket);
+ static Error UnixDomainConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket);
+ static Error UnixDomainAccept(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket);
// Blocks on a listening socket until a connection is received. This method assumes that
// |this->m_socket| is a listening socket, created via either TcpListen() or via the native
// constructor that takes a NativeSocket, which itself was created via a call to |listen()|
- Error BlockingAccept(llvm::StringRef host_and_port, Socket *&socket);
+ Error BlockingAccept(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket);
int GetOption (int level, int option_name, int &option_value);
int SetOption (int level, int option_name, int option_value);