| 9 |
|
*/ |
| 10 |
|
|
| 11 |
|
#include <stdio.h> |
| 12 |
– |
#include <sys/types.h> |
| 12 |
|
#include <signal.h> |
| 13 |
|
#include <fcntl.h> |
| 14 |
+ |
#include "selcall.h" |
| 15 |
|
#include "netproc.h" |
| 16 |
+ |
#include "paths.h" |
| 17 |
|
#include "vfork.h" |
| 17 |
– |
/* select call compatibility stuff */ |
| 18 |
– |
#ifndef FD_SETSIZE |
| 19 |
– |
#include <sys/param.h> |
| 20 |
– |
#define FD_SETSIZE NOFILE /* maximum # select file descriptors */ |
| 21 |
– |
#endif |
| 22 |
– |
#ifndef FD_SET |
| 23 |
– |
#ifndef NFDBITS |
| 24 |
– |
#define NFDBITS (8*sizeof(int)) /* number of bits per fd_mask */ |
| 25 |
– |
#endif |
| 26 |
– |
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) |
| 27 |
– |
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) |
| 28 |
– |
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) |
| 29 |
– |
#ifndef BSD |
| 30 |
– |
#define bzero(d,n) (void)memset(d,0,n) |
| 31 |
– |
#endif |
| 32 |
– |
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) |
| 33 |
– |
#endif |
| 18 |
|
|
| 19 |
|
PSERVER *pslist = NULL; /* global process server list */ |
| 20 |
|
|
| 21 |
|
static PROC *pindex[FD_SETSIZE]; /* process index table */ |
| 22 |
|
|
| 23 |
|
static char ourhost[64]; /* this host name */ |
| 24 |
< |
static char ourdir[128]; /* our working directory */ |
| 24 |
> |
static char ourdir[MAXPATH]; /* our working directory */ |
| 25 |
|
static char ouruser[32]; /* our user name */ |
| 26 |
|
static char *ourshell; /* our user's shell */ |
| 27 |
|
|
| 47 |
|
if (ps == NULL) |
| 48 |
|
return(NULL); |
| 49 |
|
if (!ourhost[0]) { /* initialize */ |
| 50 |
< |
char dirtmp[128]; |
| 50 |
> |
char dirtmp[MAXPATH]; |
| 51 |
|
register char *cp; |
| 52 |
|
register int len; |
| 53 |
|
|
| 54 |
|
strcpy(ourhost, myhostname()); |
| 55 |
< |
getcwd(dirtmp, sizeof(dirtmp)); |
| 55 |
> |
getwd(dirtmp); |
| 56 |
|
if ((cp = getenv("HOME")) != NULL) { |
| 57 |
|
if (!strcmp(cp, dirtmp)) |
| 58 |
|
ourdir[0] = '\0'; |
| 153 |
|
char *command; |
| 154 |
|
int (*compf)(); |
| 155 |
|
{ |
| 156 |
< |
char udirt[128]; |
| 156 |
> |
char udirt[MAXPATH]; |
| 157 |
|
char *av[16]; |
| 158 |
|
int pfd[2], pid; |
| 159 |
|
register int i; |