From 23f4aac7e7604f6297d81ef130bb622fed86c9a6 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 16 Jan 2025 18:37:00 +0100 Subject: [PATCH] Add posix_spawn_file_actions_add{f}chdir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit POSIX®.1-2024 now defines posix_spawn_file_actions_addchdir and posix_spawn_file_actions_addfchdir. Add these interfaces to spawn.h, guarded as POSIX 202405 symbols. Cygwin-only: Export them as aliases of the *_np counterparts. Bump API minor. Signed-off-by: Corinna Vinschen --- newlib/libc/include/spawn.h | 9 +++++++-- winsup/cygwin/cygwin.din | 2 ++ winsup/cygwin/include/cygwin/version.h | 4 +++- winsup/cygwin/release/3.6.0 | 5 +++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/newlib/libc/include/spawn.h b/newlib/libc/include/spawn.h index d6ae992db..45017c3ae 100644 --- a/newlib/libc/include/spawn.h +++ b/newlib/libc/include/spawn.h @@ -70,9 +70,14 @@ int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t * __restrict, int, const char * __restrict, int, mode_t); int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *, int, int); int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *, int); +#if __POSIX_VISIBLE >= 202405 +int posix_spawn_file_actions_addchdir (posix_spawn_file_actions_t *__restrict, + const char *__restrict); +int posix_spawn_file_actions_addfchdir (posix_spawn_file_actions_t *__restrict, + int); +#endif #if __MISC_VISIBLE || __GNU_VISIBLE -int posix_spawn_file_actions_addchdir_np (posix_spawn_file_actions_t *__restrict -, +int posix_spawn_file_actions_addchdir_np (posix_spawn_file_actions_t *__restrict, const char *__restrict); int posix_spawn_file_actions_addfchdir_np (posix_spawn_file_actions_t *__restrict, int); diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din index 37ec00896..efc750e83 100644 --- a/winsup/cygwin/cygwin.din +++ b/winsup/cygwin/cygwin.din @@ -1051,9 +1051,11 @@ posix_madvise SIGFE posix_memalign SIGFE posix_openpt SIGFE posix_spawn SIGFE +posix_spawn_file_actions_addchdir = posix_spawn_file_actions_addchdir_np SIGFE posix_spawn_file_actions_addchdir_np SIGFE posix_spawn_file_actions_addclose SIGFE posix_spawn_file_actions_adddup2 SIGFE +posix_spawn_file_actions_addfchdir = posix_spawn_file_actions_addfchdir_np SIGFE posix_spawn_file_actions_addfchdir_np SIGFE posix_spawn_file_actions_addopen SIGFE posix_spawn_file_actions_destroy SIGFE diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index d12ea9c89..4dc3e0fcf 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -490,12 +490,14 @@ details. */ 353: Implement fdclosedir. 354: Implement posix_getdents. 355: Implement setproctitle. + 356: Export posix_spawn_file_actions_addchdir and + posix_spawn_file_actions_addfchdir. Note that we forgot to bump the api for ualarm, strtoll, strtoull, sigaltstack, sethostname. */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 355 +#define CYGWIN_VERSION_API_MINOR 356 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible changes are made to the shared diff --git a/winsup/cygwin/release/3.6.0 b/winsup/cygwin/release/3.6.0 index 171ed15e1..74a6f780c 100644 --- a/winsup/cygwin/release/3.6.0 +++ b/winsup/cygwin/release/3.6.0 @@ -9,6 +9,11 @@ What's new: - New API call: timespec_get. +- New POSIX-defined entry points posix_spawn_file_actions_addchdir and + posix_spawn_file_actions_addfchdir. These are the same as the already + exported posix_spawn_file_actions_addchdir_np and + posix_spawn_file_actions_addfchdir_np. + - Add FS_IOC_[GS]ETFLAGS FS_PINNED_FL and FS_UNPINNED_FL flags to handle Windows attributes FILE_ATTRIBUTE_PINNED and FILE_ATTRIBUTE_UNPINNED. Add matching 'p' and 'u' mode bits in chattr(1) and lsattr(1).