1 |
/* |
2 |
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
3 |
* rlimits.h: sidestep configure test for RLIMIT_* values. |
4 |
* |
5 |
* This code is in the public domain. |
6 |
* |
7 |
* $Id$ |
8 |
*/ |
9 |
|
10 |
#ifndef INCLUDED_rlimits_h |
11 |
#define INCLUDED_rlimits_h |
12 |
|
13 |
#ifdef HAVE_SYS_RESOURCE_H |
14 |
#include <sys/resource.h> |
15 |
|
16 |
/* This nest of #ifdefs is because not all 'cpp's support #elif */ |
17 |
|
18 |
#ifdef RLIMIT_FDMAX |
19 |
# define RLIMIT_FD_MAX RLIMIT_FDMAX |
20 |
#else |
21 |
# ifdef RLIMIT_NOFILE |
22 |
# define RLIMIT_FD_MAX RLIMIT_NOFILE |
23 |
# else |
24 |
# ifdef RLIMIT_OPEN_MAX |
25 |
# define RLIMIT_FD_MAX RLIMIT_OPEN_MAX |
26 |
# else |
27 |
# warning No file descriptor limit was found |
28 |
# endif |
29 |
# endif |
30 |
#endif |
31 |
|
32 |
#endif /* HAVE_SYS_RESOURCE_H */ |
33 |
|
34 |
#endif /* INCLUDED_rlimits_h */ |