summaryrefslogtreecommitdiffstats
path: root/rpc_demo/msg_proc.c
blob: 229fedf7637e7e17049ec1fc6ad364cb760b6469 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * Server-side implementation of remote procedure calls
 */
#include <stdio.h>
#include "msg.h"

int *
printmessage_1_svc(char **argp, struct svc_req *rqstp)
{
	static int result;

	result = printf ("WOW -- RPC WORKS: `%s'\n", *argp);
	return &result;
}

int *
printnum_1_svc(int *argp, struct svc_req *rqstp)
{
	static int  result;

	printf ("The number you sent is %d.\n", *argp);
	result = *argp * *argp;
	return &result;
}