'\" te .\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved .TH rusers 3RPC "30 Dec 1996" "SunOS 5.11" "RPC Library Functions" .SH NAME rusers, rnusers \- return information about users on remote machines .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lrpcsvc\fR [ \fIlibrary\fR ... ] #include #include \fBenum clnt_stat\fR \fBrusers\fR(\fBchar *\fR\fIhost\fR, \fBstruct utmpidlearr *\fR\fIup\fR); .fi .LP .nf \fBint\fR \fBrnusers\fR(\fBchar *\fR\fIhost\fR); .fi .SH PROTOCOL .sp .LP \fB/usr/include/rpcsvc/rusers.x\fR .SH DESCRIPTION .sp .LP These routines require that the \fBrpc.rusersd\fR(1M) daemon be configured and available on the remote system indicated by \fIhost\fR. The \fBrusers()\fR protocol is used to retrieve information about users logged in on the remote system. .sp .LP \fBrusers()\fR fills the \fButmpidlearr\fR structure with data about \fIhost\fR, and returns \fB0\fR if successful. \fIup\fR must point to an allocated \fButmpidlearr\fR structure. If \fBrusers()\fR returns successful it will have allocated data structures within the \fIup\fR structure, which should be freed with \fBxdr_free\fR(3NSL) when you no longer need them: .sp .in +2 .nf xdr_free(xdr_utimpidlearr, up); .fi .in -2 .sp .sp .LP On error, the returned value can be interpreted as an \fBenum\fR \fBclnt_stat\fR and can be displayed with \fBclnt_perror\fR(3NSL) or \fBclnt_sperrno\fR(3NSL). .sp .LP See the header \fB\fR for a definition of struct \fButmpidlearr\fR. .sp .LP \fBrnusers()\fR returns the number of users logged on to \fIhost\fR (\fB\(mi1\fR if it cannot determine that number). .sp .LP The following \fBXDR\fR routines are available in \fBlibrpcsvc\fR: .sp .in +2 .nf xdr_utmpidlearr .fi .in -2 .sp .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBrusers\fR(1), \fBrpc.rusersd\fR(1M), \fBrpc_clnt_calls\fR(3NSL), \fBxdr_free\fR(3NSL), \fBattributes\fR(5)