diff options
| author | Cy Schubert <cy@FreeBSD.org> | 2017-07-07 17:03:42 +0000 |
|---|---|---|
| committer | Cy Schubert <cy@FreeBSD.org> | 2017-07-07 17:03:42 +0000 |
| commit | 33a9b234e7087f573ef08cd7318c6497ba08b439 (patch) | |
| tree | d0ea40ad3bf5463a3c55795977c71bcb7d781b4b /src/lib/rpc/unit-test/rpc_test_clnt.c | |
Diffstat (limited to 'src/lib/rpc/unit-test/rpc_test_clnt.c')
| -rw-r--r-- | src/lib/rpc/unit-test/rpc_test_clnt.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/rpc/unit-test/rpc_test_clnt.c b/src/lib/rpc/unit-test/rpc_test_clnt.c new file mode 100644 index 000000000000..4e4a18a72019 --- /dev/null +++ b/src/lib/rpc/unit-test/rpc_test_clnt.c @@ -0,0 +1,22 @@ +#include "rpc_test.h" +#include <string.h> + +/* Default timeout can be changed using clnt_control() */ +static struct timeval TIMEOUT = { 25, 0 }; + +char ** +rpc_test_echo_1(argp, clnt) + char **argp; + CLIENT *clnt; +{ + static char *clnt_res; + + memset(&clnt_res, 0, sizeof (clnt_res)); + if (clnt_call(clnt, RPC_TEST_ECHO, + (xdrproc_t) xdr_wrapstring, (caddr_t) argp, + (xdrproc_t) xdr_wrapstring, (caddr_t) &clnt_res, + TIMEOUT) != RPC_SUCCESS) { + return (NULL); + } + return (&clnt_res); +} |
