summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure1
-rw-r--r--src/sysdeps/trynsgetparent.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/configure b/configure
index 736b068..3481730 100755
--- a/configure
+++ b/configure
@@ -514,6 +514,7 @@ EOF
choose clr getrandom GETRANDOM 'getrandom()'
choose cl itimer ITIMER 'setitimer()'
choose cl namespaces NAMESPACES 'namespaces'
+ choose cl nsgetparent NSGETPARENT 'NS_GET_PARENT'
echo '#endif' >> $sysdeps/sysdeps.h
fi
diff --git a/src/sysdeps/trynsgetparent.c b/src/sysdeps/trynsgetparent.c
new file mode 100644
index 0000000..393a9a7
--- /dev/null
+++ b/src/sysdeps/trynsgetparent.c
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#undef _POSIX_C_SOURCE
+#undef _XOPEN_SOURCE
+
+#include <sys/ioctl.h>
+#include <linux/nsfs.h>
+
+int main (void)
+{
+ return ioctl(0, NS_GET_PARENT) ;
+}