summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSagi Lowenhardt <sagil@infinidat.com>2015-02-17 13:22:27 (GMT)
committerThomas Haller <thaller@redhat.com>2015-03-05 10:27:27 (GMT)
commitf91e6959eae3a819decaa2cc20d2af9d827060f3 (patch)
tree92d81f8cc28ea2740d4722ac4081f79b07c43cf4 /include
parent9614acf4c4354892b5b734cace4778acfc019999 (diff)
downloadlibnl-f91e6959eae3a819decaa2cc20d2af9d827060f3.zip
libnl-f91e6959eae3a819decaa2cc20d2af9d827060f3.tar.gz
libnl-f91e6959eae3a819decaa2cc20d2af9d827060f3.tar.bz2
add socket nl_connect_fd() & nl_create_fd()
- Added option to create socket (fd) without bind. It is now possible to forward the socket fd to another child process... ...later use nl_connect_fd() to connect to socket from the child process. - Added option to disable CLOEXEC even if defined (in socket.h) 'nl_socket_enable_cloexec' & 'nl_socket_disable_cloexec' No change to current default behavior. Signed-off-by: Sagi Lowenhardt <sagil@infinidat.com>
Diffstat (limited to 'include')
-rw-r--r--include/netlink-private/types.h1
-rw-r--r--include/netlink/netlink.h2
-rw-r--r--include/netlink/socket.h2
3 files changed, 5 insertions, 0 deletions
diff --git a/include/netlink-private/types.h b/include/netlink-private/types.h
index 54f06b5..7d044f1 100644
--- a/include/netlink-private/types.h
+++ b/include/netlink-private/types.h
@@ -77,6 +77,7 @@ struct nl_sock
int s_flags;
struct nl_cb * s_cb;
size_t s_bufsize;
+ int s_cloexec;
};
struct nl_cache
diff --git a/include/netlink/netlink.h b/include/netlink/netlink.h
index f8f2082..7b6cb60 100644
--- a/include/netlink/netlink.h
+++ b/include/netlink/netlink.h
@@ -49,6 +49,8 @@ extern struct nl_dump_params nl_debug_dp;
/* Connection Management */
extern int nl_connect(struct nl_sock *, int);
+extern int nl_create_fd(struct nl_sock *, int);
+extern int nl_connect_fd(struct nl_sock *, int, int);
extern void nl_close(struct nl_sock *);
/* Send */
diff --git a/include/netlink/socket.h b/include/netlink/socket.h
index 1007eba..bda0ff3 100644
--- a/include/netlink/socket.h
+++ b/include/netlink/socket.h
@@ -63,6 +63,8 @@ extern int nl_socket_get_fd(const struct nl_sock *);
extern int nl_socket_set_nonblocking(const struct nl_sock *);
extern void nl_socket_enable_msg_peek(struct nl_sock *);
extern void nl_socket_disable_msg_peek(struct nl_sock *);
+extern int nl_socket_enable_cloexec(struct nl_sock *);
+extern void nl_socket_disable_cloexec(struct nl_sock *);
#ifdef __cplusplus
}