diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-11-19 15:17:25 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-11-19 15:17:25 -0500 |
commit | d79b7be41ea85cf52a724e348d1911a19503e959 (patch) | |
tree | 2eeb30e94a974ccde1e6d2def0ce105e172656f3 /src/xspawn.h | |
parent | 949a197112e2de23c31f2afb1247bf3568097b69 (diff) | |
download | bfs-d79b7be41ea85cf52a724e348d1911a19503e959.tar.xz |
xspawn: Detect posix_spawn() support
Diffstat (limited to 'src/xspawn.h')
-rw-r--r-- | src/xspawn.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/xspawn.h b/src/xspawn.h index e3ad1eb..77273ee 100644 --- a/src/xspawn.h +++ b/src/xspawn.h @@ -9,9 +9,13 @@ #define BFS_XSPAWN_H #include "config.h" -#include <spawn.h> #include <sys/resource.h> #include <sys/types.h> +#include <unistd.h> + +#if _POSIX_SPAWN > 0 +# include <spawn.h> +#endif /** * bfs_spawn() flags. @@ -34,9 +38,11 @@ struct bfs_spawn { struct bfs_spawn_action *head; struct bfs_spawn_action **tail; +#if _POSIX_SPAWN > 0 /** posix_spawn() context, for when we can use it. */ posix_spawn_file_actions_t actions; posix_spawnattr_t attr; +#endif }; /** |