Introduce posix_spawn_file_actions_addchdir_np()

This commit is contained in:
Justine Tunney 2023-10-11 20:26:28 -07:00
parent f92ad74e6b
commit 3a1f887928
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
25 changed files with 446 additions and 748 deletions

View file

@ -29,16 +29,14 @@
* @param fildes is what open() result gets duplicated to
* @param path will be safely copied
* @return 0 on success, or errno on error
* @raise ENOMEM if we require more vespene gas
* @raise ENOMEM if insufficient memory was available
* @raise EBADF if `fildes` is negative
* @raise ENOTSUP if `fildes` isn't 0, 1, or 2 on Windows
*/
int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *file_actions,
int fildes, const char *path, int oflag,
unsigned mode) {
char *path2;
if (fildes < 0) return EBADF;
if (IsWindows() && fildes > 2) return ENOTSUP;
if (!(path2 = strdup(path))) return ENOMEM;
return __posix_spawn_add_file_action(file_actions,
(struct _posix_faction){