From b08424dd960c2241ce14a61c0241c90f612cd6b4 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 20 May 2021 13:01:43 -0400 Subject: spawn: New bfs_spawn_addsetrlimit() action --- spawn.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spawn.h') diff --git a/spawn.h b/spawn.h index 0225ed8..a2c23fd 100644 --- a/spawn.h +++ b/spawn.h @@ -21,6 +21,7 @@ #ifndef BFS_SPAWN_H #define BFS_SPAWN_H +#include #include /** @@ -82,6 +83,13 @@ int bfs_spawn_adddup2(struct bfs_spawn *ctx, int oldfd, int newfd); */ int bfs_spawn_addfchdir(struct bfs_spawn *ctx, int fd); +/** + * Add a setrlimit() action to a bfs_spawn() context. + * + * @return 0 on success, -1 on failure. + */ +int bfs_spawn_addsetrlimit(struct bfs_spawn *ctx, int resource, const struct rlimit *rl); + /** * Spawn a new process. * -- cgit v1.2.3