| 43 |
|
|
| 44 |
|
static struct pollfd *pollfds; |
| 45 |
|
static int pollmax = -1; /* highest FD number */ |
| 46 |
– |
static dlink_node *hookptr; |
| 47 |
– |
|
| 48 |
– |
/* |
| 49 |
– |
* changing_fdlimit |
| 50 |
– |
* |
| 51 |
– |
* Resize pollfds array if necessary. |
| 52 |
– |
*/ |
| 53 |
– |
static void * |
| 54 |
– |
changing_fdlimit(va_list args) |
| 55 |
– |
{ |
| 56 |
– |
int old_fdlimit = hard_fdlimit; |
| 57 |
– |
|
| 58 |
– |
pass_callback(hookptr, va_arg(args, int)); |
| 59 |
– |
|
| 60 |
– |
if (hard_fdlimit != old_fdlimit) |
| 61 |
– |
pollfds = MyRealloc(pollfds, sizeof(struct pollfd) * hard_fdlimit); |
| 62 |
– |
|
| 63 |
– |
return NULL; |
| 64 |
– |
} |
| 46 |
|
|
| 47 |
|
/* |
| 48 |
|
* init_netio |
| 59 |
|
|
| 60 |
|
for (fd = 0; fd < hard_fdlimit; fd++) |
| 61 |
|
pollfds[fd].fd = -1; |
| 81 |
– |
|
| 82 |
– |
hookptr = install_hook(fdlimit_cb, changing_fdlimit); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
/* |