diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-11-15 09:21:53 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-11-15 09:21:53 -0500 |
commit | 8b312eb6553235c36f5483d4e46c5034dcc03ce2 (patch) | |
tree | e50343acd34d92cfb146068a78624568ab903a6e /src/xspawn.h | |
parent | cc7d66416b91e0972c1022d0a835804a63ab7ab1 (diff) | |
download | bfs-8b312eb6553235c36f5483d4e46c5034dcc03ce2.tar.xz |
xspawn: API tweaks
Diffstat (limited to 'src/xspawn.h')
-rw-r--r-- | src/xspawn.h | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/xspawn.h b/src/xspawn.h index 2a3d736..e3ad1eb 100644 --- a/src/xspawn.h +++ b/src/xspawn.h @@ -34,59 +34,58 @@ struct bfs_spawn { struct bfs_spawn_action *head; struct bfs_spawn_action **tail; - /** pthread_spawn() context, for when we can use it. */ - posix_spawnattr_t attr; + /** posix_spawn() context, for when we can use it. */ posix_spawn_file_actions_t actions; + posix_spawnattr_t attr; }; /** * Create a new bfs_spawn() context. * - * @return 0 on success, -1 on failure. + * @return + * 0 on success, -1 on failure. */ int bfs_spawn_init(struct bfs_spawn *ctx); /** * Destroy a bfs_spawn() context. * - * @return 0 on success, -1 on failure. + * @return + * 0 on success, -1 on failure. */ int bfs_spawn_destroy(struct bfs_spawn *ctx); /** - * Set the flags for a bfs_spawn() context. - * - * @return 0 on success, -1 on failure. - */ -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. + * @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. + * @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. + * @return + * 0 on success, -1 on failure. */ int bfs_spawn_addfchdir(struct bfs_spawn *ctx, int fd); /** - * Add a setrlimit() action to a bfs_spawn() context. + * Apply setrlimit() to a bfs_spawn() context. * - * @return 0 on success, -1 on failure. + * @return + * 0 on success, -1 on failure. */ -int bfs_spawn_addsetrlimit(struct bfs_spawn *ctx, int resource, const struct rlimit *rl); +int bfs_spawn_setrlimit(struct bfs_spawn *ctx, int resource, const struct rlimit *rl); /** * Spawn a new process. |