[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#54667: 29.0.50; posix_spawn breaks emacs-gdb
From: |
Robert Pluim |
Subject: |
Re: bug#54667: 29.0.50; posix_spawn breaks emacs-gdb |
Date: |
Wed, 06 Apr 2022 14:33:50 +0200 |
>>>>> On Wed, 06 Apr 2022 15:21:16 +0300, Eli Zaretskii <eliz@gnu.org> said:
>> From: Robert Pluim <rpluim@gmail.com>
>> Cc: emacs-devel@gnu.org
>> Date: Wed, 06 Apr 2022 14:04:39 +0200
>>
>> >>>>> On Wed, 06 Apr 2022 14:09:04 +0300, Eli Zaretskii <eliz@gnu.org>
said:
>>
>> >> From: Robert Pluim <rpluim@gmail.com>
>> >> Date: Wed, 06 Apr 2022 11:02:12 +0200
>> >>
>> >> >>>>> On Mon, 04 Apr 2022 16:11:51 +0200, Robert Pluim
<rpluim@gmail.com> said:
Robert> In emacs-28 we only use posix_spawn on macOS because its vork is
Robert> sub-optimal. I donʼt remember the rationale for switching to using
it
Robert> everywhere, itʼs undoubtedly in the archives somewhere.
>> >>
Robert> Closing.
Robert> Committed as 8103b060d8
>> >>
>> >> Actually, do we want this in emacs-28 as well?
>>
Eli> The fix installed on master isn't macOS-specific, AFAICT. Can it be
Eli> reasonably installed on emacs-28 as macOS-specific? If yes, I think
Eli> we should indeed backport it.
>>
>> USABLE_POSIX_SPAWN is 0 on emacs-28 for every platform except macOS,
>> so applying the same patch as on master is all thatʼs needed.
Eli> I didn't see USABLE_POSIX_SPAWN in the patch. Maybe I was looking at
Eli> the wrong patch. Can you show it?
USABLE_POSIX_SPAWN is 0 on emacs-28 for all platforms except macOS,
and 1 on master for all platforms (modulo availability of some other
required features) => posix_spawn can only be used by macOS on
emacs-28.
emacs-28 callproc.c:
/* In order to be able to use `posix_spawn', it needs to support some
variant of `chdir' as well as `setsid'. */
#if defined DARWIN_OS \
&& defined HAVE_SPAWN_H && defined HAVE_POSIX_SPAWN \
&& defined HAVE_POSIX_SPAWNATTR_SETFLAGS \
&& (defined HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR \
|| defined HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP) \
&& defined HAVE_DECL_POSIX_SPAWN_SETSID \
&& HAVE_DECL_POSIX_SPAWN_SETSID == 1
# include <spawn.h>
# define USABLE_POSIX_SPAWN 1
#else
# define USABLE_POSIX_SPAWN 0
#endif
master callproc.c:
/* In order to be able to use `posix_spawn', it needs to support some
variant of `chdir' as well as `setsid'. */
#if defined HAVE_SPAWN_H && defined HAVE_POSIX_SPAWN \
&& defined HAVE_POSIX_SPAWNATTR_SETFLAGS \
&& (defined HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR \
|| defined HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP) \
&& defined HAVE_DECL_POSIX_SPAWN_SETSID \
&& HAVE_DECL_POSIX_SPAWN_SETSID == 1
# include <spawn.h>
# define USABLE_POSIX_SPAWN 1
#else
# define USABLE_POSIX_SPAWN 0
#endif
and all uses of posix_spawn are protected by USABLE_POSIX_SPAWN
Robert
--