Changeset View
Changeset View
Standalone View
Standalone View
contrib/netbsd-tests/lib/libc/rpc/t_rpc.c
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | reply(caddr_t replyp, struct netbuf * raddrp, struct netconfig * nconf) | ||||
error = getnameinfo(sock, sock->sa_len, host, sizeof(host), NULL, 0, 0); | error = getnameinfo(sock, sock->sa_len, host, sizeof(host), NULL, 0, 0); | ||||
if (error) | if (error) | ||||
warnx("Cannot resolve address (%s)", gai_strerror(error)); | warnx("Cannot resolve address (%s)", gai_strerror(error)); | ||||
else | else | ||||
printf("response from: %s\n", host); | printf("response from: %s\n", host); | ||||
return 0; | return 0; | ||||
} | } | ||||
#ifdef __FreeBSD__ | |||||
#define __rpc_control rpc_control | |||||
#endif | |||||
extern bool_t __rpc_control(int, void *); | |||||
static void | static void | ||||
onehost(const char *host, const char *transp) | onehost(const char *host, const char *transp) | ||||
{ | { | ||||
CLIENT *clnt; | CLIENT *clnt; | ||||
struct netbuf addr; | struct netbuf addr; | ||||
struct timeval tv; | struct timeval tv; | ||||
/* | /* | ||||
* Magic! | * Magic! | ||||
*/ | */ | ||||
tv.tv_sec = 0; | tv.tv_sec = 0; | ||||
tv.tv_usec = 500000; | tv.tv_usec = 500000; | ||||
#define CLCR_SET_RPCB_TIMEOUT 2 | if ((clnt = clnt_create_timed(host, RPCBPROG, RPCBVERS, transp, | ||||
__rpc_control(CLCR_SET_RPCB_TIMEOUT, &tv); | &tv)) == NULL) | ||||
if ((clnt = clnt_create(host, RPCBPROG, RPCBVERS, transp)) == NULL) | |||||
SKIPX(, "clnt_create (%s)", clnt_spcreateerror("")); | SKIPX(, "clnt_create (%s)", clnt_spcreateerror("")); | ||||
tv.tv_sec = 1; | tv.tv_sec = 1; | ||||
tv.tv_usec = 0; | tv.tv_usec = 0; | ||||
#ifdef __FreeBSD__ | #ifdef __FreeBSD__ | ||||
if (clnt_call(clnt, RPCBPROC_NULL, (xdrproc_t)xdr_void, NULL, | if (clnt_call(clnt, RPCBPROC_NULL, (xdrproc_t)xdr_void, NULL, | ||||
(xdrproc_t)xdr_void, NULL, tv) | (xdrproc_t)xdr_void, NULL, tv) | ||||
!= RPC_SUCCESS) | != RPC_SUCCESS) | ||||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |