xref: /freebsd/lib/libc/rpc/getrpcent.3 (revision dc36d6f9bb1753f3808552f3afd30eda9a7b206a)
18360efbdSAlfred Perlstein.\" $NetBSD: getrpcent.3,v 1.6 1998/02/05 18:49:06 perry Exp $
2fbc400a6SNik Clayton.\"
3*283970e8SPedro F. Giffuni.Dd February 26, 2016
4639460dcSMike Pritchard.Dt GETRPCENT 3
5639460dcSMike Pritchard.Os
6f3c1d59cSPeter Wemm.Sh NAME
7639460dcSMike Pritchard.Nm getrpcent ,
8639460dcSMike Pritchard.Nm getrpcbyname ,
9f3c1d59cSPeter Wemm.Nm getrpcbynumber ,
10f3c1d59cSPeter Wemm.Nm endrpcent ,
11f3c1d59cSPeter Wemm.Nm setrpcent
12639460dcSMike Pritchard.Nd get RPC entry
138360efbdSAlfred Perlstein.Sh LIBRARY
148360efbdSAlfred Perlstein.Lb libc
15639460dcSMike Pritchard.Sh SYNOPSIS
1632eef9aeSRuslan Ermilov.In rpc/rpc.h
17639460dcSMike Pritchard.Ft struct rpcent *
18f3c1d59cSPeter Wemm.Fn getrpcent void
19639460dcSMike Pritchard.Ft struct rpcent *
20*283970e8SPedro F. Giffuni.Fn getrpcbyname "const char *name"
21639460dcSMike Pritchard.Ft struct rpcent *
22639460dcSMike Pritchard.Fn getrpcbynumber "int number"
23639460dcSMike Pritchard.Ft void
24639460dcSMike Pritchard.Fn setrpcent "int stayopen"
25639460dcSMike Pritchard.Ft void
26f3c1d59cSPeter Wemm.Fn endrpcent void
27639460dcSMike Pritchard.Sh DESCRIPTION
281fae73b1SRuslan ErmilovThe
29639460dcSMike Pritchard.Fn getrpcent ,
30639460dcSMike Pritchard.Fn getrpcbyname ,
3199064799SGarrett Wollmanand
32639460dcSMike Pritchard.Fn getrpcbynumber
331fae73b1SRuslan Ermilovfunctions
348360efbdSAlfred Perlsteineach return a pointer to an object with the
3599064799SGarrett Wollmanfollowing structure
3699064799SGarrett Wollmancontaining the broken-out
3799064799SGarrett Wollmanfields of a line in the rpc program number data base,
388360efbdSAlfred Perlstein.Pa /etc/rpc :
39639460dcSMike Pritchard.Bd -literal
4099064799SGarrett Wollmanstruct rpcent {
4199064799SGarrett Wollman	char	*r_name;	/* name of server for this rpc program */
4299064799SGarrett Wollman	char	**r_aliases;	/* alias list */
4399064799SGarrett Wollman	long	r_number;	/* rpc program number */
4499064799SGarrett Wollman};
45639460dcSMike Pritchard.Ed
46639460dcSMike Pritchard.Pp
4799064799SGarrett WollmanThe members of this structure are:
488360efbdSAlfred Perlstein.Bl -tag -width r_aliases -offset indent
498360efbdSAlfred Perlstein.It Va r_name
5099064799SGarrett WollmanThe name of the server for this rpc program.
518360efbdSAlfred Perlstein.It Va r_aliases
5299064799SGarrett WollmanA zero terminated list of alternate names for the rpc program.
538360efbdSAlfred Perlstein.It Va r_number
5499064799SGarrett WollmanThe rpc program number for this service.
55639460dcSMike Pritchard.El
56639460dcSMike Pritchard.Pp
571fae73b1SRuslan ErmilovThe
58639460dcSMike Pritchard.Fn getrpcent
591fae73b1SRuslan Ermilovfunction
608360efbdSAlfred Perlsteinreads the next line of the file, opening the file if necessary.
618360efbdSAlfred Perlstein.Pp
621fae73b1SRuslan ErmilovThe
63563f6bdeSRuslan Ermilov.Fn setrpcent
641fae73b1SRuslan Ermilovfunction
651a0a9345SRuslan Ermilovopens and rewinds the file.
661a0a9345SRuslan ErmilovIf the
67639460dcSMike Pritchard.Fa stayopen
6899064799SGarrett Wollmanflag is non-zero,
6999064799SGarrett Wollmanthe net data base will not be closed after each call to
70639460dcSMike Pritchard.Fn getrpcent
7199064799SGarrett Wollman(either directly, or indirectly through one of
72639460dcSMike Pritchardthe other
738360efbdSAlfred Perlstein.Dq getrpc
748360efbdSAlfred Perlsteincalls).
75639460dcSMike Pritchard.Pp
761fae73b1SRuslan ErmilovThe
77639460dcSMike Pritchard.Fn endrpcent
781fae73b1SRuslan Ermilovfunction
7999064799SGarrett Wollmancloses the file.
80639460dcSMike Pritchard.Pp
811fae73b1SRuslan ErmilovThe
82639460dcSMike Pritchard.Fn getrpcbyname
8399064799SGarrett Wollmanand
84639460dcSMike Pritchard.Fn getrpcbynumber
851fae73b1SRuslan Ermilovfunctions
8699064799SGarrett Wollmansequentially search from the beginning
8799064799SGarrett Wollmanof the file until a matching rpc program name or
8899064799SGarrett Wollmanprogram number is found, or until end-of-file is encountered.
89639460dcSMike Pritchard.Sh FILES
90639460dcSMike Pritchard.Bl -tag -width /etc/rpc -compact
91639460dcSMike Pritchard.It Pa /etc/rpc
92639460dcSMike Pritchard.El
93639460dcSMike Pritchard.Sh DIAGNOSTICS
9499064799SGarrett WollmanA
95639460dcSMike Pritchard.Dv NULL
9699064799SGarrett Wollmanpointer is returned on
97639460dcSMike Pritchard.Dv EOF
9899064799SGarrett Wollmanor error.
9924a0682cSRuslan Ermilov.Sh SEE ALSO
10024a0682cSRuslan Ermilov.Xr rpc 5 ,
10124a0682cSRuslan Ermilov.Xr rpcinfo 8 ,
10224a0682cSRuslan Ermilov.Xr ypserv 8
103639460dcSMike Pritchard.Sh BUGS
10499064799SGarrett WollmanAll information
10599064799SGarrett Wollmanis contained in a static area
10699064799SGarrett Wollmanso it must be copied if it is
10799064799SGarrett Wollmanto be saved.
108