diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-09-11 18:24:05 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-09-11 18:24:05 +0000 |
commit | 1b0fce052f0adf2e4f3da7762cd9f4885a5d9da8 (patch) | |
tree | ed62766bb1e9c9ec7a326e2a33424840c4dfdb23 /src/include | |
parent | e396f10de8804d1603a907069557b80e042f56ca (diff) | |
download | skalibs-1b0fce052f0adf2e4f3da7762cd9f4885a5d9da8.tar.xz |
Add posix_spawn_file_actions_addchdir() support
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/skalibs/cspawn.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/include/skalibs/cspawn.h b/src/include/skalibs/cspawn.h index 01f6570..fa5c934 100644 --- a/src/include/skalibs/cspawn.h +++ b/src/include/skalibs/cspawn.h @@ -10,10 +10,15 @@ #define CSPAWN_FLAGS_SIGBLOCKNONE 0x0002U #define CSPAWN_FLAGS_SETSID 0x0004U -#define CSPAWN_FA_CLOSE 0x0000U -#define CSPAWN_FA_COPY 0x0001U -#define CSPAWN_FA_MOVE 0x0002U -#define CSPAWN_FA_OPEN 0x0003U +enum cspawn_fileaction_type_e +{ + CSPAWN_FA_CLOSE, + CSPAWN_FA_COPY, + CSPAWN_FA_MOVE, + CSPAWN_FA_OPEN, + CSPAWN_FA_CHDIR, + CSPAWN_FA_FCHDIR +} ; struct cspawn_fa_openinfo_s { @@ -27,20 +32,21 @@ union cspawn_fileaction_u { int fd ; int fd2[2] ; + char const *path ; struct cspawn_fa_openinfo_s openinfo ; } ; typedef struct cspawn_fileaction_s cspawn_fileaction, *cspawn_fileaction_ref ; struct cspawn_fileaction_s { - uint32_t type ; + enum cspawn_fileaction_type_e type ; union cspawn_fileaction_u x ; } ; /* Generic interface for posix_spawn() with a fork()+execve() fallback */ -extern pid_t cspawn (char const *, char const *const *, char const *const *, uint32_t, cspawn_fileaction const *, size_t) ; +extern pid_t cspawn (char const *, char const *const *, char const *const *, uint16_t, cspawn_fileaction const *, size_t) ; /* Simple spawn functions with 0 or 1 communicating fds. */ |