|
|
To establish a connection with an REXEC server, use the rexecve call:
#include <rx.h>Upon successful completion, rexecve will allocate and return a connection number, which should be used for all subsequent calls to REXEC client routines for this connection.int cnum; /* rexec connection number */
main() { char host[20], /* host name */ service[20], /* service name */ *rxargv[10], /* service argument vector */ *rxenvp[10]; /* service environment vector */ int flags = 0; /* service flags */ extern long Rx_errno; /* rexec error */
(void) strcpy(host, "tahoe"); (void) strcpy(service, "rx"); rxargv[0] = "ls"; rxargv[1] = "-l"; rxargv[2] = NULL; rxenvp[0] = NULL;
cnum = rexecve(host, service, rxargv, rxenvp, flags); if (cnum < 0) { rxperror(Rx_errno); exit(1); } . . . }