530 |
#endif |
#endif |
531 |
} |
} |
532 |
|
|
533 |
|
#ifndef LONG_MAX |
534 |
|
# define LONG_MAX 2147483647L |
535 |
|
#endif |
536 |
|
|
537 |
#ifdef HAVE_GETRLIMIT |
#ifdef HAVE_GETRLIMIT |
538 |
|
|
539 |
#ifndef RLIMIT_NOFILE |
#ifndef RLIMIT_NOFILE |
540 |
# define RLIMIT_NOFILE RLIMIT_OFILE |
# define RLIMIT_NOFILE RLIMIT_OFILE |
541 |
#endif |
#endif |
542 |
|
|
|
#ifndef LONG_MAX |
|
|
# define LONG_MAX 2147483647L |
|
|
#endif |
|
|
|
|
543 |
#define SET_MAX_CON( lim) \ |
#define SET_MAX_CON( lim) \ |
544 |
if (lim == RLIM_INFINITY) { \ |
if (lim == RLIM_INFINITY) { \ |
545 |
max_connections = LONG_MAX; \ |
max_connections = LONG_MAX; \ |
552 |
int c; |
int c; |
553 |
struct rlimit rl; |
struct rlimit rl; |
554 |
|
|
555 |
if (max_connections > 0 && max_connections < 1) { |
if (max_connections < 1) { |
556 |
/* has not been set explicitly */ |
/* has not been set explicitly */ |
557 |
c = getrlimit(RLIMIT_NOFILE, &rl); |
c = getrlimit(RLIMIT_NOFILE, &rl); |
558 |
if (c < 0) { |
if (c < 0) { |
579 |
#else /* rlimits are not present */ |
#else /* rlimits are not present */ |
580 |
static void initialize_rlimits( ) |
static void initialize_rlimits( ) |
581 |
{ |
{ |
582 |
|
max_connections = LONG_MAX; |
583 |
return; |
return; |
584 |
} |
} |
585 |
#endif |
#endif |