#include #include #include "firsttry.h" /* CpSc 824 Simple "hello world" program that demonstrates an rpc call. */ main (int argc, char *argv[]) { CLIENT *cl; char **p; if (argc != 2) { printf("Usage: firstmain hostname\n"); exit(1); } cl = clnt_create(argv[1],FIRSTTRYPROG, FIRSTTRYVERS, "tcp"); if (cl == NULL) { clnt_pcreateerror(argv[1]); exit(1); } /* Add Unix credentials */ auth_destroy(cl -> cl_auth); /* Destroy default auth info */ cl -> cl_auth = authsys_create_default(); printf("Getting ready to call firsttry\n"); p = firsttry_1(NULL,cl); printf("Back from firsttry\n"); if (p == NULL) { clnt_perror(cl,argv[1]); exit(1); } printf("Returned string=%s\n",*p); }