https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=23f4aac7e7604f6297d81ef130bb622fed86c9a6

commit 23f4aac7e7604f6297d81ef130bb622fed86c9a6
Author:     Corinna Vinschen <cori...@vinschen.de>
AuthorDate: Thu Jan 16 18:37:00 2025 +0100
Commit:     Corinna Vinschen <cori...@vinschen.de>
CommitDate: Thu Jan 16 18:38:52 2025 +0100

    Add posix_spawn_file_actions_add{f}chdir
    
    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 <cori...@vinschen.de>

Diff:
---
 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 d6ae992dbd8e..45017c3aed02 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 37ec00896232..efc750e83121 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 d12ea9c89d62..4dc3e0fcf596 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 171ed15e146a..74a6f780c315 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).

Reply via email to