147593e96SBill Paul /*
247593e96SBill Paul * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
347593e96SBill Paul * unrestricted use provided that this legend is included on all tape
447593e96SBill Paul * media and as a part of the software program in whole or part. Users
547593e96SBill Paul * may copy or modify Sun RPC without charge, but are not authorized
647593e96SBill Paul * to license or distribute it to anyone else except as part of a product or
747593e96SBill Paul * program developed by the user or with the express written consent of
847593e96SBill Paul * Sun Microsystems, Inc.
947593e96SBill Paul *
1047593e96SBill Paul * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
1147593e96SBill Paul * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
1247593e96SBill Paul * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
1347593e96SBill Paul *
1447593e96SBill Paul * Sun RPC is provided with no support and without any obligation on the
1547593e96SBill Paul * part of Sun Microsystems, Inc. to assist in its use, correction,
1647593e96SBill Paul * modification or enhancement.
1747593e96SBill Paul *
1847593e96SBill Paul * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
1947593e96SBill Paul * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
2047593e96SBill Paul * OR ANY PART THEREOF.
2147593e96SBill Paul *
2247593e96SBill Paul * In no event will Sun Microsystems, Inc. be liable for any lost revenue
2347593e96SBill Paul * or profits or other special, indirect and consequential damages, even if
2447593e96SBill Paul * Sun has been advised of the possibility of such damages.
2547593e96SBill Paul *
2647593e96SBill Paul * Sun Microsystems, Inc.
2747593e96SBill Paul * 2550 Garcia Avenue
2847593e96SBill Paul * Mountain View, California 94043
2947593e96SBill Paul */
30542d87feSMatthew Dillon
31542d87feSMatthew Dillon #include <sys/cdefs.h>
3247593e96SBill Paul
3347593e96SBill Paul /*
3447593e96SBill Paul * rnusers.c
3547593e96SBill Paul *
3647593e96SBill Paul * "High" level programmatic interface to rnusers RPC service.
3747593e96SBill Paul *
3847593e96SBill Paul * Copyright (c) 1985 by Sun Microsystems, Inc.
3947593e96SBill Paul */
4047593e96SBill Paul
4147593e96SBill Paul #include <rpc/rpc.h>
4247593e96SBill Paul #include <rpcsvc/rnusers.h>
4347593e96SBill Paul
4447593e96SBill Paul int
rusers(char * host,utmpidlearr * up)45e0e0f30fSEd Schouten rusers(char *host, utmpidlearr *up)
4647593e96SBill Paul {
4747593e96SBill Paul return (callrpc(host, RUSERSPROG, RUSERSVERS_IDLE, RUSERSPROC_NAMES,
484f759369SPeter Wemm (xdrproc_t)xdr_void, (char *) NULL,
494f759369SPeter Wemm (xdrproc_t)xdr_utmpidlearr, (char *) up));
5047593e96SBill Paul }
5147593e96SBill Paul
5247593e96SBill Paul int
rnusers(char * host)53e0e0f30fSEd Schouten rnusers(char *host)
5447593e96SBill Paul {
5547593e96SBill Paul int nusers;
5647593e96SBill Paul
5747593e96SBill Paul if (callrpc(host, RUSERSPROG, RUSERSVERS_ORIG, RUSERSPROC_NUM,
584f759369SPeter Wemm (xdrproc_t)xdr_void, (char *) NULL,
594f759369SPeter Wemm (xdrproc_t)xdr_u_long, (char *) &nusers) != 0)
6047593e96SBill Paul return (-1);
6147593e96SBill Paul else
6247593e96SBill Paul return (nusers);
6347593e96SBill Paul }
6447593e96SBill Paul
65