/* * The bulk of this was generated automatically by rpcgen -a * The -a paramter causes rpcgen to generate the framework for * the all of the components, including the server and client * * I added the implementation of the function. The skeleton * was created for me. */ #include "helloworld.h" char ** helloworld_1_svc(void *argp, struct svc_req *rqstp) { /* * Notice two things: * 1) Both of these are static, so that they exist upon * return so RPC can still access the pointer to get * to the string, and access the string to marshal it * * 2) I didn't just return &hello, but instead used a * separate pointer. &&hello doesn't make sense and * this must return a pointer to the data to return. */ static char hello[256] = "Hello world"; static char *hello_p; printf("Entering helloworld_1_svc()\n"); hello_p = hello; printf("Returning from helloworld_1_svc()\n"); return(&hello_p); }