aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/netlink-socket.c7
-rw-r--r--lib/netlink-socket.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
index 8f9c3d50..3674bacb 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -667,6 +667,13 @@ nl_sock_wait(const struct nl_sock *sock, short int events)
{
poll_fd_wait(sock->fd, events);
}
+
+/* Returns the PID associated with this socket. */
+uint32_t
+nl_sock_pid(const struct nl_sock *sock)
+{
+ return sock->pid;
+}
/* Miscellaneous. */
diff --git a/lib/netlink-socket.h b/lib/netlink-socket.h
index 3ea790cf..ff248583 100644
--- a/lib/netlink-socket.h
+++ b/lib/netlink-socket.h
@@ -60,6 +60,8 @@ int nl_sock_drain(struct nl_sock *);
void nl_sock_wait(const struct nl_sock *, short int events);
+uint32_t nl_sock_pid(const struct nl_sock *);
+
/* Table dumping. */
struct nl_dump {
struct nl_sock *sock; /* Socket being dumped. */