From db5cd6b699cbc065e5443c998c01455588c189c0 Mon Sep 17 00:00:00 2001 From: Tom Li Date: Tue, 25 Dec 2018 23:20:52 +0800 Subject: [PATCH] configure: define HAVE_PIPE2 if we have pipe2() and O_CLOEXEC. This commit adds a new run for pipe2() and O_CLOEXEC. If a program can be executed, define HAVE_PIPE2. Signed-off-by: Tom Li --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index fe503d7..dc06a77 100755 --- a/configure +++ b/configure @@ -152,6 +152,9 @@ issolaris() { check_compile 'whether we have GNU-style getservbyname_r()' "-DHAVE_GNU_GETSERVBYNAME_R" \ '#define _GNU_SOURCE\n#include \nint main() {\nstruct servent *se = 0;struct servent se_buf;char buf[1024];\ngetservbyname_r("foo", (void*) 0, &se_buf, buf, sizeof(buf), &se);\nreturn 0;}' +check_compile 'whether we have pipe2() and O_CLOEXEC' "-DHAVE_PIPE2" \ +'#define _GNU_SOURCE\n#include \n#include \nint main() {\nint pipefd[2];\npipe2(pipefd, O_CLOEXEC);\nreturn 0;}' + check_define __APPLE__ && { mac_detected=true check_define __x86_64__ && mac_64=true