]> 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>
Thu, 11 Nov 2021 21:00:03 +0000 (22:00 +0100)
commita60053f8368e058229721f1bf1567c2b1676b239
tree78866bddd58675dd9c60ac690b40602984e22e7e
parent6c9ac53249a1c1b05bbcc8e253f39fa8d1e319f6
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.

* 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.
configure.ac
src/callproc.c