From c980fc653d0bfe1b4744e7e8364b37225ac38746 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 3 Aug 2010 17:47:34 +0200 Subject: fd_util: add function socketpair_cloexec() --- src/fd_util.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/fd_util.h') diff --git a/src/fd_util.h b/src/fd_util.h index b704d3d2..b49a5137 100644 --- a/src/fd_util.h +++ b/src/fd_util.h @@ -65,6 +65,17 @@ pipe_cloexec(int fd[2]); int pipe_cloexec_nonblock(int fd[2]); +#ifndef WIN32 + +/** + * Wrapper for socketpair(), which sets the CLOEXEC flag (atomically + * if supported by the OS). + */ +int +socketpair_cloexec(int domain, int type, int protocol, int sv[2]); + +#endif + /** * Wrapper for socket(), which sets the CLOEXEC and the NONBLOCK flag * (atomically if supported by the OS). -- cgit v1.2.3