rstat.c revision 256281
117304Sserb/*
217304Sserb * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
317304Sserb * unrestricted use provided that this legend is included on all tape
417304Sserb * media and as a part of the software program in whole or part.  Users
517304Sserb * may copy or modify Sun RPC without charge, but are not authorized
617304Sserb * to license or distribute it to anyone else except as part of a product or
717304Sserb * program developed by the user or with the express written consent of
817304Sserb * Sun Microsystems, Inc.
917304Sserb *
1017304Sserb * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
1117304Sserb * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
1217304Sserb * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
1317304Sserb *
1417304Sserb * Sun RPC is provided with no support and without any obligation on the
1517304Sserb * part of Sun Microsystems, Inc. to assist in its use, correction,
1617304Sserb * modification or enhancement.
1717304Sserb *
1817304Sserb * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
1917304Sserb * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
2017304Sserb * OR ANY PART THEREOF.
2117304Sserb *
2217304Sserb * In no event will Sun Microsystems, Inc. be liable for any lost revenue
2317304Sserb * or profits or other special, indirect and consequential damages, even if
2417304Sserb * Sun has been advised of the possibility of such damages.
2517304Sserb *
2617304Sserb * Sun Microsystems, Inc.
2717304Sserb * 2550 Garcia Avenue
2817304Sserb * Mountain View, California  94043
2917304Sserb */
3017304Sserb
3117304Sserb#include <sys/cdefs.h>
3217304Sserb__FBSDID("$FreeBSD: stable/10/lib/librpcsvc/rstat.c 189087 2009-02-26 20:32:11Z ed $");
3317304Sserb
3417304Sserb#if !defined(lint) && defined(SCCSIDS)
3517304Sserbstatic char sccsid[] = "@(#)rstat.c	1.2 91/03/11 TIRPC 1.0; from 1.6 89/03/24 SMI";
3617304Sserb#endif
3717304Sserb
3817304Sserb/*
3917304Sserb * Copyright (c) 1985 by Sun Microsystems, Inc.
4017304Sserb */
4117304Sserb
4217304Sserb/*
4317304Sserb * "High" level programmatic interface to rstat RPC service.
4417304Sserb */
4517304Sserb#include <rpc/rpc.h>
4617304Sserb#include <rpcsvc/rstat.h>
4717304Sserb
4817304Sserbenum clnt_stat
4917304Sserbrstat(char *host, struct statstime *statp)
5017304Sserb{
5117304Sserb	return (callrpc(host, RSTATPROG, RSTATVERS_TIME, RSTATPROC_STATS,
5217304Sserb			(xdrproc_t)xdr_void, (char *) NULL,
5317304Sserb			(xdrproc_t)xdr_statstime, (char *) statp));
5417304Sserb}
5517304Sserb
5617304Sserbint
5717304Sserbhavedisk(char *host)
5817304Sserb{
5917304Sserb	long have;
6017304Sserb
6117304Sserb	if (callrpc(host, RSTATPROG, RSTATVERS_SWTCH, RSTATPROC_HAVEDISK,
6217304Sserb			(xdrproc_t)xdr_void, (char *) NULL,
6317304Sserb			(xdrproc_t)xdr_long, (char *) &have) != 0)
6417304Sserb		return (-1);
6517304Sserb	else
6617304Sserb		return (have);
6717304Sserb}
6817304Sserb
6917304Sserb