#include #include "firsttry.h" /* CpSc 824 Hello world RPC server -- it just returns the string. */ char **firsttry_1(void *dummy, struct svc_req *reqPtr) { static char msg[256]; static char *p; struct authdes_cred *credPtr; int uid, gid, len; int gidlist[16]; credPtr = (struct authdes_cred *)reqPtr -> rq_clntcred; if (authdes_getucred(credPtr, &uid, &gid, &len, gidlist) != 1) { perror("getucred"); } fprintf(stderr, "UID=%d, GID=%d\n", uid, gid); strcpy(msg, "Hello world"); p = msg; return(&p); }