diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-05-31 22:32:15 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-05-31 22:32:15 -0400 |
commit | 7df809c6223a89beb8d2c186a85c56c880b4fbbf (patch) | |
tree | 2eeb7798599e2597d190d64521d27df7bcf6199d /spawn.h | |
parent | 7ce47037e801ac07f8608326ac49164488bcbc52 (diff) | |
download | bfs-7df809c6223a89beb8d2c186a85c56c880b4fbbf.tar.xz |
spawn: Add dup2() and close() file actions
Diffstat (limited to 'spawn.h')
-rw-r--r-- | spawn.h | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1,6 +1,6 @@ /**************************************************************************** * bfs * - * Copyright (C) 2018 Tavian Barnes <tavianator@tavianator.com> * + * Copyright (C) 2018-2019 Tavian Barnes <tavianator@tavianator.com> * * * * Permission to use, copy, modify, and/or distribute this software for any * * purpose with or without fee is hereby granted. * @@ -64,6 +64,20 @@ int bfs_spawn_destroy(struct bfs_spawn *ctx); int bfs_spawn_setflags(struct bfs_spawn *ctx, enum bfs_spawn_flags flags); /** + * Add a close() action to a bfs_spawn() context. + * + * @return 0 on success, -1 on failure. + */ +int bfs_spawn_addclose(struct bfs_spawn *ctx, int fd); + +/** + * Add a dup2() action to a bfs_spawn() context. + * + * @return 0 on success, -1 on failure. + */ +int bfs_spawn_adddup2(struct bfs_spawn *ctx, int oldfd, int newfd); + +/** * Add an fchdir() action to a bfs_spawn() context. * * @return 0 on success, -1 on failure. |