1# Copyright (C) Igor Sysoev 2# Copyright (C) NGINX, Inc. 3 4# Linux clone syscall. 5 6NXT_ISOLATION=NO 7NXT_HAVE_CLONE=NO 8 9nsflags="USER NS PID NET UTS CGROUP" 10 11nxt_feature="clone(2)" 12nxt_feature_name=NXT_HAVE_CLONE 13nxt_feature_run=no 14nxt_feature_incs= 15nxt_feature_libs= 16nxt_feature_test="#include <sys/wait.h> 17 #include <sys/syscall.h> 18 19 int main() { 20 return __NR_clone | SIGCHLD; 21 }" 22. auto/feature 23 24if [ $nxt_found = yes ]; then 25 NXT_HAVE_CLONE=YES 26 27 # Test all isolation flags 28 for flag in $nsflags; do 29 nxt_feature="CLONE_NEW${flag}" 30 nxt_feature_name=NXT_HAVE_CLONE_NEW${flag} 31 nxt_feature_run=no 32 nxt_feature_incs= 33 nxt_feature_libs= 34 nxt_feature_test="#define _GNU_SOURCE 35 #include <sys/wait.h> 36 #include <sys/syscall.h> 37 #include <sched.h> 38 39 int main() { 40 return CLONE_NEW$flag; 41 }" 42 . auto/feature 43 44 if [ $nxt_found = yes ]; then 45 if [ "$NXT_ISOLATION" = "NO" ]; then 46 NXT_ISOLATION=$flag 47 else 48 NXT_ISOLATION="$NXT_ISOLATION $flag" 49 fi 50 fi 51 done 52fi 53