summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2022-11-18 23:42:44 +0000
committerAndrew Clayton <a.clayton@nginx.com>2023-02-17 21:24:18 +0000
commit3ecdd2c69c4864526c63b8e55df22ad1a86f3c72 (patch)
tree01008c56e881a2a8be0d39bbbf1ef98032927213 /auto
parent763396b8be07be41b1baf336952fd222cbeb8db7 (diff)
downloadunit-3ecdd2c69c4864526c63b8e55df22ad1a86f3c72.tar.gz
unit-3ecdd2c69c4864526c63b8e55df22ad1a86f3c72.tar.bz2
Isolation: Rename NXT_HAVE_CLONE -> NXT_HAVE_LINUX_NS.
Due to the need to replace our use of clone/__NR_clone on Linux with fork(2)/unshare(2) for enabling Linux namespaces(7) to keep the pthreads(7) API working. Let's rename NXT_HAVE_CLONE to NXT_HAVE_LINUX_NS, i.e name it after the feature, not how it's implemented, then in future if we change how we do namespaces again we don't have to rename this. Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'auto')
-rw-r--r--auto/isolation14
-rw-r--r--auto/sources2
2 files changed, 8 insertions, 8 deletions
diff --git a/auto/isolation b/auto/isolation
index b706c94d..27f44624 100644
--- a/auto/isolation
+++ b/auto/isolation
@@ -4,7 +4,7 @@
# Linux clone syscall.
NXT_ISOLATION=NO
-NXT_HAVE_CLONE=NO
+NXT_HAVE_LINUX_NS=NO
NXT_HAVE_CLONE_NEWUSER=NO
NXT_HAVE_MOUNT=NO
NXT_HAVE_UNMOUNT=NO
@@ -12,21 +12,21 @@ NXT_HAVE_ROOTFS=NO
nsflags="USER NS PID NET UTS CGROUP"
-nxt_feature="clone(2)"
-nxt_feature_name=NXT_HAVE_CLONE
+nxt_feature="Linux unshare()"
+nxt_feature_name=NXT_HAVE_LINUX_NS
nxt_feature_run=no
nxt_feature_incs=
nxt_feature_libs=
-nxt_feature_test="#include <sys/wait.h>
- #include <sys/syscall.h>
+nxt_feature_test="#define _GNU_SOURCE
+ #include <sched.h>
int main(void) {
- return SYS_clone | SIGCHLD;
+ return unshare(0);
}"
. auto/feature
if [ $nxt_found = yes ]; then
- NXT_HAVE_CLONE=YES
+ NXT_HAVE_LINUX_NS=YES
# Test all isolation flags
for flag in $nsflags; do
diff --git a/auto/sources b/auto/sources
index 29f3c7b5..2ca78844 100644
--- a/auto/sources
+++ b/auto/sources
@@ -299,7 +299,7 @@ if [ "$NXT_HAVE_HPUX_SENDFILE" = "YES" \
fi
-if [ "$NXT_HAVE_CLONE" = "YES" ]; then
+if [ "$NXT_HAVE_LINUX_NS" = "YES" ]; then
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_CLONE_SRCS"
fi