[mod_cgi] FreeBSD 9.3/MacOSX does not have pipe2() (fixes #2765)
commit653305628989ded07c65e815b32cf0e50f95077f
authorGlenn Strauss <gstrauss@gluelogic.com>
Fri, 4 Nov 2016 22:05:45 +0000 (4 18:05 -0400)
committerGlenn Strauss <gstrauss@gluelogic.com>
Thu, 24 Nov 2016 14:36:09 +0000 (24 09:36 -0500)
tree6f51ac3b3d7c1cb75ad13ef1f1990fd5d08f89e5
parentc74bdf834b75dbc3e7dc566807913f91e07c6691
[mod_cgi] FreeBSD 9.3/MacOSX does not have pipe2() (fixes #2765)

FreeBSD 9.3 has O_CLOEXEC, but does not have pipe2() until FreeBSD 10.
FreeBSD 10 also adds SOCK_CLOEXEC, so use that as indicator
https://wiki.freebsd.org/AtomicCloseOnExec

Note: FreeBSD 9.3 will soon reach its "extended" EOL date (31 Dec 2016),
so those using FreeBSD 9.3 should consider upgrading.
https://www.freebsd.org/security/security.html#sup

Mac OS X does not have pipe2().  User reported:
  Undefined symbols for architecture x86_64:
    "_pipe2", referenced from:
        _mod_cgi_handle_subrequest in mod_cgi.o

x-ref:
  "Undefined symbols _pipe2"
  https://redmine.lighttpd.net/issues/2765
src/mod_cgi.c