⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simpservice.c

📁 this gives details of the network programming
💻 C
字号:
/* Definition of the remote add and subtract procedure used by    simple RPC example    rpcgen will create a template for you that contains much of the code   needed in this file is you give it the "-Ss" command line arg.*/#include <stdio.h>#include "simp.h"/* Here is the actual remote procedure *//* The return value of this procedure must be a pointer to int! *//* we declare the variable result as static so we can return a    pointer to it */int *add_1_svc(operands *argp, struct svc_req *rqstp){	static int  result;	printf("Got request: adding %d, %d\n",	       argp->x, argp->y);	result = argp->x + argp->y;	return (&result);}int *sub_1_svc(operands *argp, struct svc_req *rqstp){	static int  result;	printf("Got request: subtracting %d, %d\n",	       argp->x, argp->y);	result = argp->x - argp->y;	return (&result);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -