diff options
Diffstat (limited to 'share/examples/sunrpc/msg/msg_proc.c')
-rw-r--r-- | share/examples/sunrpc/msg/msg_proc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/share/examples/sunrpc/msg/msg_proc.c b/share/examples/sunrpc/msg/msg_proc.c new file mode 100644 index 000000000000..ed088839e52a --- /dev/null +++ b/share/examples/sunrpc/msg/msg_proc.c @@ -0,0 +1,30 @@ +/* @(#)msg_proc.c 2.1 88/08/11 4.0 RPCSRC */ +/* $FreeBSD$ */ +/* + * msg_proc.c: implementation of the remote procedure "printmessage" + */ +#include <paths.h> +#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(msg) + char **msg; +{ + static int result; /* must be static! */ + FILE *f; + + f = fopen(_PATH_CONSOLE, "w"); + if (f == NULL) { + result = 0; + return (&result); + } + fprintf(f, "%s\n", *msg); + fclose(f); + result = 1; + return (&result); +} |