sys-utils/lsns.c: In function ‘add_namespace_from_sock’:
sys-utils/lsns.c:580:19: error: ‘SIOCGSKNS’ undeclared (first use in this function)
nsfd = ioctl(sk, SIOCGSKNS);
^~~~~~~~~
SIOCGSKNS was added in https://github.com/torvalds/linux/commit/
c62cce2caee558e18aa05c01c2fd3b40f07174f2.
Fixes: https://github.com/util-linux/util-linux/issues/3502
Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Compat code so unshare and setns can be used with older libcs
+ * Compat code to support older libcs.
*/
#ifndef UTIL_LINUX_NAMESPACE_H
# define UTIL_LINUX_NAMESPACE_H
+/*
+ * Compat code for sched.h (unshare and setns)
+ */
+
# include <sched.h>
# ifndef CLONE_NEWNS
}
# endif
+/*
+ * Compat code for sockios.h
+ */
+
+# ifndef SIOCGSKNS
+# define SIOCGSKNS 0x894C
+# endif
+
#endif /* UTIL_LINUX_NAMESPACE_H */