From 86df3efa3c9429c132bc7c39dcb2575b4eac440c Mon Sep 17 00:00:00 2001 From: "Albert ARIBAUD (3ADEV)" Date: Thu, 12 Apr 2018 20:46:27 +0200 Subject: Y2038: add function __clntudp_create64 --- sunrpc/clnt_udp.c | 19 +++++++++++++++++++ sunrpc/rpc/clnt.h | 12 ++++++++++++ 2 files changed, 31 insertions(+) diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c index c2436e3ebc..27a324465a 100644 --- a/sunrpc/clnt_udp.c +++ b/sunrpc/clnt_udp.c @@ -644,3 +644,22 @@ clntudp_destroy (CLIENT *cl) mem_free ((caddr_t) cu, (sizeof (*cu) + cu->cu_sendsz + cu->cu_recvsz)); mem_free ((caddr_t) cl, sizeof (CLIENT)); } + +/* 64-bit time versions */ + +CLIENT * +__clntudp_create64 (struct sockaddr_in *raddr, u_long program, u_long version, + struct __timeval64 wait, int *sockp) +{ + struct timeval wait32; + + if (wait.tv_sec > INT32_MAX || wait.tv_sec < INT32_MIN) + { + return NULL; + } + + wait32.tv_sec = wait.tv_sec; + wait32.tv_usec = wait.tv_usec; + + return clntudp_create (raddr, program, version, wait32, sockp); +} diff --git a/sunrpc/rpc/clnt.h b/sunrpc/rpc/clnt.h index f4d4a941c7..b24b5ccafe 100644 --- a/sunrpc/rpc/clnt.h +++ b/sunrpc/rpc/clnt.h @@ -329,6 +329,18 @@ extern CLIENT *clnttcp_create (struct sockaddr_in *__raddr, u_long __prog, * u_int sendsz; * u_int recvsz; */ +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT) +extern CLIENT * __REDIRECT (clntudp_create,(struct sockaddr_in *__raddr, + u_long __program, + u_long __version, + struct timeval __wait_resend, + int *__sockp), + __clntudp_create64) __THROW; +# else +# define clntudp_create __clntudp_create64 +# endif +#endif extern CLIENT *clntudp_create (struct sockaddr_in *__raddr, u_long __program, u_long __version, struct timeval __wait_resend, int *__sockp) __THROW; -- cgit 1.4.1