From fd142a53ebab66e6d2057a84485a1812499e9410 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Wed, 19 Apr 2023 17:59:01 -0400 Subject: [core] use posix_spawn() where available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use posix_spawn() where available use posix_spawn_file_actions_addfchdir_np() where available Using posix_spawn() reduces initial execution overhead of CGI programs; posix_spawn() is often faster than application code wrapping and calling traditional fork(),execve(). (history: fdevent.c posix_spawn code based on fdio.c:fdio_ipc_spawn() from 2015 on one of my unpublished branches. The inability to chdir() delayed inclusion in lighttpd, as the CGI specification says: "The current working directory for the script SHOULD be set to the directory containing the script." e.g. chdir() to target program directory before CGI execution) posix_spawn_file_actions_addfchdir_np() is a new(er) extension supported in glibc 2.29+, musl libc, FreeBSD ≥ 13.1, macOS ≥ 10.15 according to https://cygwin.com/pipermail/cygwin/2023-April/253505.html https://cygwin.com/pipermail/cygwin/2023-April/253526.html https://sourceware.org/bugzilla/show_bug.cgi?id=17405 POSIX Issue 8 plans to include posix_spawn_file_actions_addfchdir(): https://www.austingroupbugs.net/view.php?id=1208 --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 02b1cdf6..331f95d2 100644 --- a/configure.ac +++ b/configure.ac @@ -1461,6 +1461,8 @@ AC_CHECK_FUNCS([\ mkostemp \ pipe2 \ poll \ + posix_spawn \ + posix_spawn_file_actions_addfchdir_np \ pread \ pwrite \ sendfile \ -- cgit v1.2.1