#include <sys/ioctl.h>
#include <utmp.h>
#include <sys/resource.h>
-#if defined(SOL20)
-#include <sys/filio.h>
-#endif
#if (!defined(SVR3) || defined(sgi) || defined(_SEQUENT_))
#include <sys/un.h>
#endif
#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
-#ifdef AIX
-#include <time.h>
-#include <arpa/nameser.h>
-#else
#include "nameser.h"
-#endif
#include "resolv_legacy.h"
#include "sock.h" /* If FD_ZERO isn't define up to this point, */
/* define it (BSD4.2 needs this) */
struct rlimit limit;
if (!getrlimit (RLIMIT_FD_MAX, &limit)) {
-#ifdef pyr
- if (limit.rlim_cur < MAXCONNECTIONS)
-#else
if (limit.rlim_max < MAXCONNECTIONS)
-#endif
{
(void) fprintf (stderr, "ircd fd table too big\n");
(void) fprintf (stderr, "Hard Limit: %d IRC max: %d\n",
(void) fprintf (stderr, "Fix MAXCONNECTIONS\n");
exit (-1);
}
-#ifndef pyr
limit.rlim_cur = limit.rlim_max; /* make soft limit the max */
if (setrlimit (RLIMIT_FD_MAX, &limit) == -1) {
(void) fprintf (stderr, "error setting max fd's to %d\n",
(int) limit.rlim_cur);
exit (-1);
}
-#endif
}
#endif
-#ifdef sequent
-#ifndef DYNIXPTX
- int fd_limit;
-
- fd_limit = setdtablesize (MAXCONNECTIONS + 1);
- if (fd_limit < MAXCONNECTIONS) {
- (void) fprintf (stderr, "ircd fd table too big\n");
- (void) fprintf (stderr, "Hard Limit: %d IRC max: %d\n",
- fd_limit, MAXCONNECTIONS);
- (void) fprintf (stderr, "Fix MAXCONNECTIONS\n");
- exit (-1);
- }
-#endif
-#endif
#if defined(PCS) || defined(DYNIXPTX) || defined(SVR3)
char logbuf[BUFSIZ];
(void) setvbuf (stderr, logbuf, _IOLBF, sizeof (logbuf));
#else
-#if defined(HPUX)
- (void) setvbuf (stderr, NULL, _IOLBF, 0);
-#else
-#if !defined(SOL20) && !defined(SCOUNIX)
(void) setlinebuf (stderr);
-#endif
-#endif
#endif
for (fd = 3; fd < MAXCONNECTIONS; fd++) {
(void) close (fd);
(void) close (fd);
}
#endif
-#if defined(HPUX) || defined(SOL20) || defined(DYNIXPTX) || \
- defined(_POSIX_SOURCE) || defined(SVR4) || defined(SGI) \
- || defined(SCOUNIX)
+#if defined(_POSIX_SOURCE) || defined(SVR4)
(void) setsid ();
#else
(void) setpgrp (0, (int) getpid ());
report_error ("setsockopt(SO_RCVBUF) %s:%s", cptr);
#endif
#ifdef SO_SNDBUF
-#ifdef _SEQUENT_
-/* seems that Sequent freezes up if the receving buffer is a different size
- * to the sending buffer (maybe a tcp window problem too).
- */
opt = 8192;
-#else
- opt = 8192;
-#endif
if (setsockopt
(fd, SOL_SOCKET, SO_SNDBUF, (OPT_TYPE *) & opt, sizeof (opt))
< 0)
aClient *cptr;
int nfds;
struct timeval wait;
-#ifdef pyr
- struct timeval nowt;
- u_long us;
-#endif
fd_set read_set, write_set;
time_t delay2 = delay, now;
u_long usec = 0;
int ping = 0;
int sockerr;
-#ifdef pyr
- (void) gettimeofday (&nowt, NULL);
- now = nowt.tv_sec;
-#else
now = time (NULL);
-#endif
for (res = 0;;) {
((cptr->flags2 & FLAGS2_ZIP) && (cptr->zip->outcount > 0)) ||
#endif
(DoList (cptr) && IsSendable (cptr)))
-#ifndef pyr
FD_SET (i, &write_set);
-#else
- {
- if (!IsBlocked (cptr))
- FD_SET (i, &write_set);
- else
- delay2 = 0, usec = 500000;
- }
- if (now - cptr->lw.tv_sec && nowt.tv_usec - cptr->lw.tv_usec < 0)
- us = 1000000;
- else
- us = 0;
- us += nowt.tv_usec;
- if (us - cptr->lw.tv_usec > 500000)
- ClearBlocked (cptr);
-#endif
}
if (udpfd >= 0)
FD_SET (udpfd, &read_set);
strncpyzt (name, ut.ut_name, 9);
strncpyzt (line, ut.ut_line, 10);
#ifdef USER_PROCESS
-#if defined(HPUX) || defined(AIX)
- strncpyzt (host, (ut.ut_host[0]) ? (ut.ut_host) : me.name, 16);
-#else
strncpyzt (host, me.name, 9);
-#endif
if (ut.ut_type == USER_PROCESS)
return 0;
#else