diff options
author | Konstantin Pavlov <thresh@nginx.com> | 2023-02-28 10:30:50 -0800 |
---|---|---|
committer | Konstantin Pavlov <thresh@nginx.com> | 2023-02-28 10:30:50 -0800 |
commit | 2cc95374dee1fba712a8520c03b72a763ea0b40b (patch) | |
tree | 9cf241d0cd7e191466e91156c99429f9491c76ac /auto | |
parent | cae4a4e4185503725d412d52d880189f46b76ef5 (diff) | |
parent | 0af1253c17161b19a5c61a0bbb262f6cd2e515ed (diff) | |
download | unit-2cc95374dee1fba712a8520c03b72a763ea0b40b.tar.gz unit-2cc95374dee1fba712a8520c03b72a763ea0b40b.tar.bz2 |
Merged with the 1.29 branch.
Diffstat (limited to 'auto')
-rw-r--r-- | auto/endian | 31 | ||||
-rw-r--r-- | auto/isolation | 29 | ||||
-rw-r--r-- | auto/sources | 2 |
3 files changed, 53 insertions, 9 deletions
diff --git a/auto/endian b/auto/endian new file mode 100644 index 00000000..cb23639b --- /dev/null +++ b/auto/endian @@ -0,0 +1,31 @@ +# Copyright (C) Igor Sysoev +# Copyright (C) Andrew Clayton +# Copyright (C) Nginx, Inc. + + +nxt_feature="endianness" +nxt_feature_name= +nxt_feature_run=value +nxt_feature_incs= +nxt_feature_libs= +nxt_feature_test="#include <stdint.h> + #include <stdio.h> + + int main(void) { + int i = 0x11223344; + uint8_t *p; + + p = (uint8_t *)&i; + if (*p == 0x44) + printf(\"little endian\"); + else + printf(\"big endian\"); + return 0; + }" +. auto/feature + +if [ "$nxt_feature_value" = "little endian" ]; then + nxt_have=NXT_HAVE_LITTLE_ENDIAN . auto/have +else + nxt_have=NXT_HAVE_BIG_ENDIAN . auto/have +fi diff --git a/auto/isolation b/auto/isolation index cbf42d9d..c535e80a 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 @@ -90,7 +90,7 @@ nxt_feature_test="#include <mntent.h> nxt_feature="prctl(PR_SET_NO_NEW_PRIVS)" -nxt_feature_name=NXT_HAVE_PR_SET_NO_NEW_PRIVS0 +nxt_feature_name=NXT_HAVE_PR_SET_NO_NEW_PRIVS nxt_feature_run=no nxt_feature_incs= nxt_feature_libs= @@ -102,6 +102,19 @@ nxt_feature_test="#include <sys/prctl.h> . auto/feature +nxt_feature="prctl(PR_SET_CHILD_SUBREAPER)" +nxt_feature_name=NXT_HAVE_PR_SET_CHILD_SUBREAPER +nxt_feature_run=no +nxt_feature_incs= +nxt_feature_libs= +nxt_feature_test="#include <sys/prctl.h> + + int main(void) { + return PR_SET_CHILD_SUBREAPER; + }" +. auto/feature + + nxt_feature="Linux mount()" nxt_feature_name=NXT_HAVE_LINUX_MOUNT nxt_feature_run=no 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 |