mirror of https://git.musl-libc.org/git/musl
Browse Source
these are presently extensions, thus named with _np to match glibc and other implementations that provide them; however they are likely to be standardized in the future without the _np suffix as a result of Austin Group issue 1208. if so, both names will be kept as aliases.master
5 changed files with 50 additions and 0 deletions
@ -0,0 +1,18 @@ |
|||
#include <spawn.h> |
|||
#include <stdlib.h> |
|||
#include <string.h> |
|||
#include <errno.h> |
|||
#include "fdop.h" |
|||
|
|||
int posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *restrict fa, const char *restrict path) |
|||
{ |
|||
struct fdop *op = malloc(sizeof *op + strlen(path) + 1); |
|||
if (!op) return ENOMEM; |
|||
op->cmd = FDOP_CHDIR; |
|||
op->fd = -1; |
|||
strcpy(op->path, path); |
|||
if ((op->next = fa->__actions)) op->next->prev = op; |
|||
op->prev = 0; |
|||
fa->__actions = op; |
|||
return 0; |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
#include <spawn.h> |
|||
#include <stdlib.h> |
|||
#include <string.h> |
|||
#include <errno.h> |
|||
#include "fdop.h" |
|||
|
|||
int posix_spawn_file_actions_addfchdir_np(posix_spawn_file_actions_t *fa, int fd) |
|||
{ |
|||
struct fdop *op = malloc(sizeof *op); |
|||
if (!op) return ENOMEM; |
|||
op->cmd = FDOP_FCHDIR; |
|||
op->fd = fd; |
|||
if ((op->next = fa->__actions)) op->next->prev = op; |
|||
op->prev = 0; |
|||
fa->__actions = op; |
|||
return 0; |
|||
} |
|||
Loading…
Reference in new issue