/* * rb_init_netio * * This is a needed exported function which will be called to initialise * the network loop code. */ int rb_init_netio_poll(void) { int fd; pollfd_list.pollfds = rb_malloc(rb_getmaxconnect() * (sizeof(struct pollfd))); pollfd_list.allocated = rb_getmaxconnect(); for(fd = 0; fd < rb_getmaxconnect(); fd++) { pollfd_list.pollfds[fd].fd = -1; } pollfd_list.maxindex = 0; return 0; }
/* SET MAX */ static void quote_max(struct Client *source_p, const char *arg, int newval) { if(newval > 0) { if(newval > maxconnections - MAX_BUFFER) { sendto_one_notice(source_p, ":You cannot set MAXCLIENTS to > %d", maxconnections - MAX_BUFFER); return; } if(newval < 32) { sendto_one_notice(source_p, ":You cannot set MAXCLIENTS to < 32 (%d:%d)", GlobalSetOptions.maxclients, rb_getmaxconnect()); return; } GlobalSetOptions.maxclients = newval; sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s!%s@%s set new MAXCLIENTS to %d (%lu current)", source_p->name, source_p->username, source_p->host, GlobalSetOptions.maxclients, rb_dlink_list_length(&lclient_list)); return; } else { sendto_one_notice(source_p, ":Current Maxclients = %d (%lu)", GlobalSetOptions.maxclients, rb_dlink_list_length(&lclient_list)); } }
/* * rb_init_netio * * This is a needed exported function which will be called to initialise * the network loop code. */ int rb_init_netio_sigio(void) { int fd; pollfd_list.pollfds = rb_malloc(rb_getmaxconnect() * (sizeof(struct pollfd))); pollfd_list.allocated = rb_getmaxconnect(); for(fd = 0; fd < rb_getmaxconnect(); fd++) { pollfd_list.pollfds[fd].fd = -1; } pollfd_list.maxindex = 0; sigio_is_screwed = 1; /* Start off with poll first.. */ sigemptyset(&our_sigset); sigaddset(&our_sigset, RTSIGIO); sigaddset(&our_sigset, SIGIO); #ifdef SIGIO_SCHED_EVENT sigaddset(&our_sigset, RTSIGTIM); #endif sigprocmask(SIG_BLOCK, &our_sigset, NULL); return 0; }