Skip to content

Commit

Permalink
configure: define HAVE_PIPE2 if we have pipe2() and O_CLOEXEC.
Browse files Browse the repository at this point in the history
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 <tomli@tomli.me>
  • Loading branch information
biergaizi authored and rofl0r committed Dec 25, 2018
1 parent a6959ee commit db5cd6b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ issolaris() {
check_compile 'whether we have GNU-style getservbyname_r()' "-DHAVE_GNU_GETSERVBYNAME_R" \
'#define _GNU_SOURCE\n#include <netdb.h>\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 <fcntl.h>\n#include <unistd.h>\nint main() {\nint pipefd[2];\npipe2(pipefd, O_CLOEXEC);\nreturn 0;}'

check_define __APPLE__ && {
mac_detected=true
check_define __x86_64__ && mac_64=true
Expand Down

0 comments on commit db5cd6b

Please sign in to comment.