]> git.eshelyaron.com Git - emacs.git/commit
Use posix_spawn if possible.
authorPhilipp Stephani <phst@google.com>
Wed, 30 Dec 2020 13:42:01 +0000 (14:42 +0100)
committerPhilipp Stephani <phst@google.com>
Sat, 13 Nov 2021 15:45:19 +0000 (16:45 +0100)
commitcc4edea872ca653f3e0631ce50e47b5260c6773a
tree1687f6dc24ee03aade146c749504d3b8d7b9e73f
parenta56dd60d2fba9d873748ca3831ba61711628f698
Use posix_spawn if possible.

posix_spawn is less error-prone than vfork + execve, and can make
better use of system-specific enhancements like 'clone' on Linux.  Use
it if we don't need to configure a pseudoterminal.

Backported from commit a60053f8368e058229721f1bf1567c2b1676b239.
Unlike that commit, only define USABLE_POSIX_SPAWN on macOS, because
there posix_spawn is much faster than vfork.

Don't merge to master.

* configure.ac (HAVE_SPAWN_H, HAVE_POSIX_SPAWN)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP)
(HAVE_POSIX_SPAWNATTR_SETFLAGS, HAVE_DECL_POSIX_SPAWN_SETSID): New
configuration variables.
* src/callproc.c (USABLE_POSIX_SPAWN): New configuration macro.
(emacs_posix_spawn_init_actions)
(emacs_posix_spawn_init_attributes, emacs_posix_spawn_init): New
helper functions.
(emacs_spawn): Use posix_spawn if possible.

(cherry picked from commit a60053f8368e058229721f1bf1567c2b1676b239)
configure.ac
src/callproc.c