| 1 |
greg |
2.1 |
/* Copyright (c) 1996 Regents of the University of California */ |
| 2 |
|
|
|
| 3 |
|
|
/* SCCSid "$SunId$ LBL" */ |
| 4 |
|
|
|
| 5 |
|
|
/* |
| 6 |
|
|
* Header file for network processing routines |
| 7 |
|
|
*/ |
| 8 |
|
|
|
| 9 |
|
|
typedef struct { |
| 10 |
|
|
char *com; /* command (stored on client side) */ |
| 11 |
|
|
int pid; /* process ID */ |
| 12 |
|
|
int efd; /* standard error file descriptor */ |
| 13 |
|
|
char *errs; /* error output */ |
| 14 |
|
|
int elen; /* error output length */ |
| 15 |
|
|
int (*cf)(); /* completion callback function */ |
| 16 |
|
|
} PROC; /* process slot */ |
| 17 |
|
|
|
| 18 |
|
|
/* Callback function cf above passed process server, slot number and status */ |
| 19 |
|
|
|
| 20 |
|
|
typedef struct pserver { |
| 21 |
|
|
struct pserver *next; /* next process server in main list */ |
| 22 |
|
|
char hostname[64]; /* remote host ID */ |
| 23 |
|
|
char directory[128]; /* remote execution directory */ |
| 24 |
|
|
char username[32]; /* remote user ID */ |
| 25 |
|
|
short nprocs; /* number of allocated process slots */ |
| 26 |
|
|
PROC proc[1]; /* process slot(s) (must be last in struct) */ |
| 27 |
|
|
} PSERVER; /* process server */ |
| 28 |
|
|
|
| 29 |
|
|
extern PSERVER *pslist; /* global process server list */ |
| 30 |
|
|
|
| 31 |
|
|
extern PSERVER *addpserver(), *findjob(); |
| 32 |
|
|
|
| 33 |
|
|
#define LHOSTNAME "localhost" /* accepted name for local host */ |
| 34 |
|
|
|
| 35 |
|
|
#define pserverOK(ps) (wait4job(ps, startjob(ps, "true", NULL)) == 0) |