home *** CD-ROM | disk | FTP | other *** search
- /* @(#)msg_proc.c 2.1 88/08/11 4.0 RPCSRC */
- /*
- * msg_proc.c: implementation of the remote procedure "printmessage"
- */
- #include <stdio.h>
- #include <rpc/rpc.h> /* always need this here */
- #include "msg.h" /* need this too: msg.h will be generated by rpcgen */
-
- /*
- * Remote verson of "printmessage"
- */
- int *
- printmessage_1_svc(char **msg, struct svc_req *rqstp)
- {
- static int result; /* must be static! */
- FILE *f;
-
- #ifdef amigados
- f = stdout;
- #else
- f = fopen("/dev/console", "w");
- #endif
- if (f == NULL) {
- result = 0;
- return (&result);
- }
- fprintf(f, "%s\n", *msg);
- #ifndef amigados
- fclose(f);
- #endif
- result = 1;
- return (&result);
- }
-
-