I guess I'll have to submit this upstream too, but since I'm a) swamped b) going on vacation c) pretty angry with apr right now, I'll wait for that. The autoconf check in apr for CLOEXEC compatibility checks against the running kernel; if the running kernel for CBUILD is newer than the one from CHOST, and CHOST lacks CLOEXEC support, Apache will fail to start 'cause it cannot bind the socket. Obviously, it should retry if it failed with CLOEXEC, so that it falls back without breaking older kernels. On the other hand, it won't support CLOEXEC if it's not build on a kernel that supports it, also pretty stupid. Have fun because this just went stable thanks to a security issue.
apr_cv_sock_cloexec=no apr_cv_epoll_create1=no setting these in the environment let apr cross-build decently.
I added "cloexec" USE flag, whose disabling allows to disable support for SOCK_CLOEXEC.
I renamed "cloexec" USE flag to "older-kernels-compatibility", which better explains the meaning of this USE flag.
Well although the use flag is more "plain text" readable, at the same time it doesn't really say anything, or rather the comment with '#equery u apr' doesn't, as exactly what _is_ an 'older-kernel'? It's a relative term so need something to be relative to or it could as well say bla-bla-bla. Although 'cloexec' certainly give a hint to the initiated one, but what about something as '=< 2.6.26' or where ever that line is crossed? I don't know and probably many with me... Sure I can probably spend an hour or two on digging it up... but what a waste of time as someone probably already knows and there is a proper place to write it down... so please?
(In reply to comment #4) "older-kernels-compatibility" USE flag can mean enabling of compatibility with different versions of kernels in case of different versions of APR.
(In reply to comment #5) > (In reply to comment #4) > > "older-kernels-compatibility" USE flag can mean enabling of compatibility with > different versions of kernels in case of different versions of APR. > Yes I get that, but exactly what deem a kernel as 'old'? there is a specific build drawing the line or? I suspected my linux-2.6.24-openvz-008.1 would be old, but testing on 1 VE I haven't noticed any problems yet with apr-1.3.8 (-older-kernels-compatibility) and latest apache, but still testing. I know upgrading kernel would be the best, but the box is co-located and I just don't have the time to deal with it right now.
I think "cloexec" was a better name.