From f1869e11225d9aa054fb11474887d8f109af0949 Mon Sep 17 00:00:00 2001 From: "Albert ARIBAUD (3ADEV)" Date: Thu, 12 Apr 2018 20:50:21 +0200 Subject: Y2038: add function __pmap_rmtcall64 --- sunrpc/pmap_rmt.c | 23 +++++++++++++++++++++++ sunrpc/rpc/pmap_clnt.h | 15 +++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c index 6b142e5..501da4f 100644 --- a/sunrpc/pmap_rmt.c +++ b/sunrpc/pmap_rmt.c @@ -390,3 +390,26 @@ done_broad: return stat; } libc_hidden_nolink_sunrpc (clnt_broadcast, GLIBC_2_0) + +/* 64-bit-time version */ + +/* The 64-bit-time version of pmap_rmtcall. + * Only handles 64-bit-time timeouts smaller than 2^^31 seconds. + */ +enum clnt_stat +__pmap_rmtcall64 (struct sockaddr_in *addr, u_long prog, u_long vers, + u_long proc, xdrproc_t xdrargs, caddr_t argsp, + xdrproc_t xdrres, caddr_t resp, + struct __timeval64 tout, u_long *port_ptr) +{ + struct timeval tout32; + if (tout.tv_sec > INT_MAX) + { + return RPC_SYSTEMERROR; + } + tout32.tv_sec = tout.tv_sec; + tout32.tv_usec = tout.tv_usec; + + return pmap_rmtcall (addr, prog, vers, proc, xdrargs, argsp, xdrres, + resp, tout32, port_ptr); +} diff --git a/sunrpc/rpc/pmap_clnt.h b/sunrpc/rpc/pmap_clnt.h index 1cc94b8..b436ebb 100644 --- a/sunrpc/rpc/pmap_clnt.h +++ b/sunrpc/rpc/pmap_clnt.h @@ -71,6 +71,21 @@ extern bool_t pmap_set (const u_long __program, const u_long __vers, extern bool_t pmap_unset (const u_long __program, const u_long __vers) __THROW; extern struct pmaplist *pmap_getmaps (struct sockaddr_in *__address) __THROW; +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT) +extern enum clnt_stat __REDIRECT (pmap_rmtcall, (struct sockaddr_in *__addr, + const u_long __prog, + const u_long __vers, + const u_long __proc, + xdrproc_t __xdrargs, + caddr_t __argsp, xdrproc_t __xdrres, + caddr_t __resp, struct timeval __tout, + u_long *__port_ptr), + __pmap_rmtcall64) __THROW; +# else +# define pmap_rmtcall __pmap_rmtcall64 +# endif +#endif extern enum clnt_stat pmap_rmtcall (struct sockaddr_in *__addr, const u_long __prog, const u_long __vers, -- cgit v1.1