version 1.2, 2000/12/06 19:57:48 |
version 1.3, 2000/12/12 22:30:01 |
|
|
int maxfd; |
int maxfd; |
#define maxcon (maxfd - 10) |
#define maxcon (maxfd - 10) |
|
|
char *prog; |
extern char *__progname; |
fd_set read_wait; |
fd_set read_wait; |
int ncon; |
int ncon; |
|
|
|
|
static void |
static void |
usage(void) |
usage(void) |
{ |
{ |
fatal("usage: %s [-t timeout] { [--] host | -f file } ...\n", prog); |
fatal("usage: %s [-t timeout] { [--] host | -f file } ...\n", __progname); |
return; |
return; |
} |
} |
|
|
|
|
|
|
TAILQ_INIT(&tq); |
TAILQ_INIT(&tq); |
|
|
if ((prog = strrchr(argv[0], '/'))) |
|
prog++; |
|
else |
|
prog = argv[0]; |
|
|
|
if (argc <= argno) |
if (argc <= argno) |
usage(); |
usage(); |
|
|
|
|
|
|
maxfd = fdlim_get(1); |
maxfd = fdlim_get(1); |
if (maxfd < 0) |
if (maxfd < 0) |
fatal("%s: fdlim_get: bad value\n", prog); |
fatal("%s: fdlim_get: bad value\n", __progname); |
if (maxfd > MAXMAXFD) |
if (maxfd > MAXMAXFD) |
maxfd = MAXMAXFD; |
maxfd = MAXMAXFD; |
if (maxcon <= 0) |
if (maxcon <= 0) |
fatal("%s: not enough file descriptors\n", prog); |
fatal("%s: not enough file descriptors\n", __progname); |
if (maxfd > fdlim_get(0)) |
if (maxfd > fdlim_get(0)) |
fdlim_set(maxfd); |
fdlim_set(maxfd); |
fdcon = xmalloc(maxfd * sizeof(con)); |
fdcon = xmalloc(maxfd * sizeof(con)); |