| 1 |
– |
/* Copyright (c) 1996 Regents of the University of California */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* Parallel network process handling routines |
| 6 |
|
*/ |
| 7 |
|
|
| 8 |
|
#include <stdio.h> |
| 12 |
– |
#include <sys/types.h> |
| 13 |
– |
#include <sys/select.h> |
| 9 |
|
#include <signal.h> |
| 10 |
|
#include <fcntl.h> |
| 11 |
+ |
#include "selcall.h" |
| 12 |
|
#include "netproc.h" |
| 13 |
|
#include "paths.h" |
| 14 |
|
#include "vfork.h" |
| 19 |
– |
/* select call compatibility stuff */ |
| 20 |
– |
#ifndef FD_SETSIZE |
| 21 |
– |
#include <sys/param.h> |
| 22 |
– |
#define FD_SETSIZE NOFILE /* maximum # select file descriptors */ |
| 23 |
– |
#endif |
| 24 |
– |
#ifndef FD_SET |
| 25 |
– |
#ifndef NFDBITS |
| 26 |
– |
#define NFDBITS (8*sizeof(int)) /* number of bits per fd_mask */ |
| 27 |
– |
#endif |
| 28 |
– |
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) |
| 29 |
– |
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) |
| 30 |
– |
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) |
| 31 |
– |
#ifndef BSD |
| 32 |
– |
#define bzero(d,n) (void)memset(d,0,n) |
| 33 |
– |
#endif |
| 34 |
– |
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) |
| 35 |
– |
#endif |
| 15 |
|
|
| 16 |
|
PSERVER *pslist = NULL; /* global process server list */ |
| 17 |
|
|
| 27 |
|
|
| 28 |
|
extern char *remsh; /* externally defined remote shell program */ |
| 29 |
|
|
| 51 |
– |
extern char *malloc(), *realloc(); |
| 30 |
|
extern char *getenv(); |
| 31 |
|
|
| 32 |
|
|
| 122 |
|
/* remove server from list */ |
| 123 |
|
psp->next = ps->next; |
| 124 |
|
pslist = pstart.next; |
| 125 |
< |
free((char *)ps); /* free associated memory */ |
| 125 |
> |
free((void *)ps); /* free associated memory */ |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
|
| 292 |
|
close(pp->efd); /* close error stream */ |
| 293 |
|
pindex[pp->efd] = NULL; |
| 294 |
|
FD_CLR(pp->efd, &errdesc); |
| 295 |
< |
free((char *)pp->errs); |
| 295 |
> |
free((void *)pp->errs); |
| 296 |
|
pp->com = NULL; /* clear settings */ |
| 297 |
|
pp->pid = -1; |
| 298 |
|
pp->efd = -1; |