summaryrefslogtreecommitdiff
path: root/libc/inet/rpc/svc_udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inet/rpc/svc_udp.c')
-rw-r--r--libc/inet/rpc/svc_udp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c
index 208fbf281..c0b0c2237 100644
--- a/libc/inet/rpc/svc_udp.c
+++ b/libc/inet/rpc/svc_udp.c
@@ -42,10 +42,13 @@
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <errno.h>
+#include <unistd.h>
#define rpc_buffer(xprt) ((xprt)->xp_p1)
+#ifndef MAX
#define MAX(a, b) ((a > b) ? a : b)
+#endif
static bool_t svcudp_recv();
static bool_t svcudp_reply();
@@ -54,6 +57,10 @@ static bool_t svcudp_getargs();
static bool_t svcudp_freeargs();
static void svcudp_destroy();
+static void cache_set(SVCXPRT *xprt, u_long replylen);
+static int cache_get(SVCXPRT *xprt, struct rpc_msg *msg,
+ char **replyp, u_long *replylenp);
+
static struct xp_ops svcudp_op = {
svcudp_recv,
svcudp_stat,
@@ -63,8 +70,6 @@ static struct xp_ops svcudp_op = {
svcudp_destroy
};
-extern int errno;
-
/*
* kept in xprt->xp_p2
*/
@@ -329,7 +334,7 @@ struct udp_cache {
* Enable use of the cache.
* Note: there is no disable.
*/
-svcudp_enablecache(transp, size)
+int svcudp_enablecache(transp, size)
SVCXPRT *transp;
u_long size;
{
@@ -367,7 +372,7 @@ u_long size;
/*
* Set an entry in the cache
*/
-static cache_set(xprt, replylen)
+static void cache_set(xprt, replylen)
SVCXPRT *xprt;
u_long replylen;
{
@@ -432,7 +437,7 @@ u_long replylen;
* Try to get an entry from the cache
* return 1 if found, 0 if not found
*/
-static cache_get(xprt, msg, replyp, replylenp)
+static int cache_get(xprt, msg, replyp, replylenp)
SVCXPRT *xprt;
struct rpc_msg *msg;
char **replyp;