From d79b7be41ea85cf52a724e348d1911a19503e959 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 19 Nov 2023 15:17:25 -0500 Subject: xspawn: Detect posix_spawn() support --- src/xspawn.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/xspawn.h') 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 #include #include +#include + +#if _POSIX_SPAWN > 0 +# include +#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 }; /** -- cgit v1.2.3