aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-05-17 10:31:49 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-05-17 10:31:49 +0200
commitd8c333ecf179b652eaabf71a512aebc1864f6bf7 (patch)
treecb64967a57935686a0129d79fed12b557ad61ab8
parentccb9aa7f2db7f5e867c8025d7da00cf147222854 (diff)
Use posix_spawn() on OpenBSD 5.2 or later
-rw-r--r--libbutl/process.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbutl/process.cxx b/libbutl/process.cxx
index 5523b96..a19719f 100644
--- a/libbutl/process.cxx
+++ b/libbutl/process.cxx
@@ -47,6 +47,14 @@
# elif defined(__NetBSD__) && __NetBSD__ >= 6
# define LIBBUTL_POSIX_SPAWN
//
+// On OpenBSD posix_spawn() appeared in 5.2 (see the man page for details).
+//
+# elif defined(__OpenBSD__)
+# include <sys/param.h> // OpenBSD (yyyymm)
+# if OpenBSD >= 201211 // 5.2 released on 1 Nov 2012.
+# define LIBBUTL_POSIX_SPAWN
+# endif
+//
// posix_spawn() appeared in Version 3 of the Single UNIX Specification that
// was implemented in MacOS 10.5 (see the man page for details).
//