summaryrefslogtreecommitdiff
path: root/include/netlink-local.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/netlink-local.h')
-rw-r--r--include/netlink-local.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/netlink-local.h b/include/netlink-local.h
index 32e8302..9acc0e4 100644
--- a/include/netlink-local.h
+++ b/include/netlink-local.h
@@ -186,4 +186,16 @@ static inline int wait_for_ack(struct nl_sock *sk)
return nl_wait_for_ack(sk);
}
+static inline int build_sysconf_path(char **strp, const char *filename)
+{
+ char *sysconfdir;
+
+ sysconfdir = getenv("NLSYSCONFDIR");
+
+ if (!sysconfdir)
+ sysconfdir = SYSCONFDIR;
+
+ return asprintf(strp, "%s/%s", sysconfdir, filename);
+}
+
#endif