]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getrpcent.3
epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, fallocate.2, futex.2, getcpu...
[thirdparty/man-pages.git] / man3 / getrpcent.3
1 .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
2 .\"
3 .\" %%%LICENSE_START(BSD_ONELINE_CDROM)
4 .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
5 .\" %%%LICENSE_END
6 .\"
7 .\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI
8 .TH GETRPCENT 3 2008-08-19 "" "Linux Programmer's Manual"
9 .SH NAME
10 getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get
11 RPC entry
12 .SH SYNOPSIS
13 .nf
14 .B #include <netdb.h>
15
16 .BI "struct rpcent *getrpcent(void);"
17
18 .BI "struct rpcent *getrpcbyname(char *" name );
19
20 .BI "struct rpcent *getrpcbynumber(int " number );
21
22 .BI "void setrpcent(int " stayopen );
23
24 .BI "void endrpcent(void);"
25 .fi
26 .SH DESCRIPTION
27 .LP
28 The
29 .BR getrpcent (),
30 .BR getrpcbyname (),
31 and
32 .BR getrpcbynumber ()
33 functions each return a pointer to an object with the
34 following structure containing the broken-out
35 fields of an entry in the RPC program number data base.
36 .in +4n
37 .nf
38
39 struct rpcent {
40 char *r_name; /* name of server for this RPC program */
41 char **r_aliases; /* alias list */
42 long r_number; /* RPC program number */
43 };
44 .fi
45 .in
46 .LP
47 The members of this structure are:
48 .RS 4
49 .TP 12
50 .I r_name
51 The name of the server for this RPC program.
52 .TP
53 .I r_aliases
54 A NULL-terminated list of alternate names for the RPC program.
55 .TP
56 .I r_number
57 The RPC program number for this service.
58 .RE
59 .LP
60 The
61 .BR getrpcent ()
62 function reads the next entry from the database.
63 A connection is opened to the database if necessary.
64 .LP
65 The
66 .BR setrpcent ()
67 function opens a connection to the database,
68 and sets the next entry to the first entry.
69 If \fIstayopen\fP is nonzero,
70 then the connection to the database
71 will not be closed between calls to one of the
72 .BR getrpc* ()
73 functions.
74 .LP
75 The
76 .BR endrpcent ()
77 function closes the connection to the database.
78 .LP
79 The
80 .BR getrpcbyname ()
81 and
82 .BR getrpcbynumber ()
83 functions sequentially search from the beginning
84 of the file until a matching RPC program name or
85 program number is found, or until end-of-file is encountered.
86 .SH RETURN VALUE
87 On success,
88 .BR getrpcent (),
89 .BR getrpcbyname (),
90 and
91 .BR getrpcbynumber ()
92 return a pointer to a statically allocated
93 .I rpcent
94 structure.
95 A NULL pointer is returned on EOF or error.
96 .SH FILES
97 .TP
98 .I /etc/rpc
99 RPC program number database.
100 .SH CONFORMING TO
101 Not in POSIX.1-2001.
102 Present on the BSDs, Solaris, and many other systems.
103 .SH BUGS
104 All information
105 is contained in a static area
106 so it must be copied if it is
107 to be saved.
108 .SH SEE ALSO
109 .BR getrpcent_r (3),
110 .BR rpc (5),
111 .BR rpcinfo (8),
112 .BR ypserv (8)