From da8387f131b31fd09269eb0025ceb4082c11001e Mon Sep 17 00:00:00 2001 From: wollman Date: Sun, 7 Aug 1994 18:50:51 +0000 Subject: Sun RPC demo programs from 4.4-Lite --- share/examples/sunrpc/msg/msg_proc.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 share/examples/sunrpc/msg/msg_proc.c (limited to 'share/examples/sunrpc/msg/msg_proc.c') diff --git a/share/examples/sunrpc/msg/msg_proc.c b/share/examples/sunrpc/msg/msg_proc.c new file mode 100644 index 0000000..80e5d95 --- /dev/null +++ b/share/examples/sunrpc/msg/msg_proc.c @@ -0,0 +1,28 @@ +/* @(#)msg_proc.c 2.1 88/08/11 4.0 RPCSRC */ +/* + * msg_proc.c: implementation of the remote procedure "printmessage" + */ +#include +#include /* always need this here */ +#include "msg.h" /* need this too: msg.h will be generated by rpcgen */ + +/* + * Remote verson of "printmessage" + */ +int * +printmessage_1(msg) + char **msg; +{ + static int result; /* must be static! */ + FILE *f; + + f = fopen("/dev/console", "w"); + if (f == NULL) { + result = 0; + return (&result); + } + fprintf(f, "%s\n", *msg); + fclose(f); + result = 1; + return (&result); +} -- cgit v1.1