17 #include "apr_arch_networkio.h" 27 fd_flags = fcntl(sd, F_GETFL, 0);
28 #if defined(O_NONBLOCK) 29 fd_flags &= ~O_NONBLOCK;
30 #elif defined(O_NDELAY) 31 fd_flags &= ~O_NDELAY;
32 #elif defined(FNDELAY) 35 #error Please teach APR how to make sockets blocking on your platform. 37 if (fcntl(sd, F_SETFL, fd_flags) == -1) {
42 if (
setsockopt(sd, SOL_SOCKET, SO_NONBLOCK, &
on,
sizeof(
int)) < 0)
53 fd_flags = fcntl(sd, F_GETFL, 0);
54 #if defined(O_NONBLOCK) 55 fd_flags |= O_NONBLOCK;
56 #elif defined(O_NDELAY) 58 #elif defined(FNDELAY) 61 #error Please teach APR how to make sockets non-blocking on your platform. 63 if (fcntl(sd, F_SETFL, fd_flags) == -1) {
68 if (
setsockopt(sd, SOL_SOCKET, SO_NONBLOCK, &
on,
sizeof(
int)) < 0)
94 else if (t < 0 && sock->
timeout >= 0) {
114 apr_int32_t
opt, apr_int32_t
on)
211 #if defined(TCP_DEFER_ACCEPT) 213 int optlevel = IPPROTO_TCP;
214 int optname = TCP_DEFER_ACCEPT;
217 (
void *)&
on,
sizeof(
int)) == -1) {
227 #if defined(TCP_NODELAY) 229 int optlevel = IPPROTO_TCP;
230 int optname = TCP_NODELAY;
234 optlevel = IPPROTO_SCTP;
235 optname = SCTP_NODELAY;
257 #if APR_TCP_NOPUSH_FLAG 264 #ifndef HAVE_TCP_NODELAY_WITH_CORK 265 int optlevel = IPPROTO_TCP;
266 int optname = TCP_NODELAY;
270 optlevel = IPPROTO_SCTP;
271 optname = SCTP_NODELAY;
280 (
void*)&tmpflag,
sizeof(
int)) == -1) {
292 (
void*)&
on,
sizeof(
int)) == -1) {
296 #ifndef HAVE_TCP_NODELAY_WITH_CORK 303 (
void*)&tmpflag,
sizeof(
int)) == -1) {
319 #if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) 325 (
void *)&
on,
sizeof(
int)) == -1) {
334 #if defined(IP_FREEBIND) 336 (
void *)&one,
sizeof(
int)) == -1) {
363 apr_int32_t
opt, apr_int32_t *
on)
392 if (gethostname(
buf,
len) == 0) {
394 if (gethostname(
buf,
len) != 0) {
409 #if APR_HAS_SO_ACCEPTFILTER 414 const char *
name = nonconst_name;
415 const char *
args = nonconst_args;
417 struct accept_filter_arg af;
418 socklen_t optlen =
sizeof(af);
424 &af, &optlen)) == 0) {
425 if (!strcmp(
name, af.af_name) && !strcmp(
args, af.af_arg)) {
435 apr_cpystrn(af.af_name,
name, 16);
436 apr_cpystrn(af.af_arg,
args, 256 - 16);
439 &af,
sizeof(af))) < 0) {
448 #if APR_HAVE_SOCKADDR_UN