mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Introduce posix_spawn_file_actions_addchdir_np()
This commit is contained in:
parent
f92ad74e6b
commit
3a1f887928
25 changed files with 446 additions and 748 deletions
|
@ -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){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue