version 1.4, 1996/09/04 23:43:57 |
version 1.5, 1996/12/10 19:00:03 |
|
|
CLIENT *rstat_clnt; |
CLIENT *rstat_clnt; |
statstime host_stat; |
statstime host_stat; |
static struct timeval timeout = {25, 0}; |
static struct timeval timeout = {25, 0}; |
|
extern char *__progname; |
|
|
rstat_clnt = clnt_create(host, RSTATPROG, RSTATVERS_TIME, "udp"); |
rstat_clnt = clnt_create(host, RSTATPROG, RSTATVERS_TIME, "udp"); |
if (rstat_clnt == NULL) { |
if (rstat_clnt == NULL) { |
warnx("%s", clnt_spcreateerror(host)); |
fprintf(stderr, "%s: %s", __progname, |
|
clnt_spcreateerror(host)); |
return; |
return; |
} |
} |
|
|
bzero((char *)&host_stat, sizeof(host_stat)); |
bzero((char *)&host_stat, sizeof(host_stat)); |
if (clnt_call(rstat_clnt, RSTATPROC_STATS, xdr_void, NULL, |
if (clnt_call(rstat_clnt, RSTATPROC_STATS, xdr_void, NULL, |
xdr_statstime, &host_stat, timeout) != RPC_SUCCESS) { |
xdr_statstime, &host_stat, timeout) != RPC_SUCCESS) { |
warnx("%s", clnt_sperror(rstat_clnt, host)); |
fprintf(stderr, "%s: %s", __progname, |
|
clnt_sperror(rstat_clnt, host)); |
return; |
return; |
} |
} |
|
|
|
|
{ |
{ |
statstime host_stat; |
statstime host_stat; |
enum clnt_stat clnt_stat; |
enum clnt_stat clnt_stat; |
|
extern char *__progname; |
size_t i; |
size_t i; |
|
|
if (sort_type != SORT_NONE) { |
if (sort_type != SORT_NONE) { |
|
|
clnt_stat = clnt_broadcast(RSTATPROG, RSTATVERS_TIME, RSTATPROC_STATS, |
clnt_stat = clnt_broadcast(RSTATPROG, RSTATVERS_TIME, RSTATPROC_STATS, |
xdr_void, NULL, xdr_statstime, &host_stat, rstat_reply); |
xdr_void, NULL, xdr_statstime, &host_stat, rstat_reply); |
if (clnt_stat != RPC_SUCCESS && clnt_stat != RPC_TIMEDOUT) { |
if (clnt_stat != RPC_SUCCESS && clnt_stat != RPC_TIMEDOUT) { |
warnx("%s", clnt_sperrno(clnt_stat)); |
fprintf(stderr, "%s: %s", __progname, clnt_sperrno(clnt_stat)); |
exit(1); |
exit(1); |
} |
} |
|
|