ioctl_tty.2: srcfix
[man-pages.git] / man3 / getrpcent.3
blob4c0d42a2ff13872e86aac0786403543e477e27fc
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 2021-03-22 "" "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 .PP
16 .BI "struct rpcent *getrpcent(void);"
17 .PP
18 .BI "struct rpcent *getrpcbyname(const char *" name );
19 .BI "struct rpcent *getrpcbynumber(int " number );
20 .PP
21 .BI "void setrpcent(int " stayopen );
22 .BI "void endrpcent(void);"
23 .fi
24 .SH DESCRIPTION
25 The
26 .BR getrpcent (),
27 .BR getrpcbyname (),
28 and
29 .BR getrpcbynumber ()
30 functions each return a pointer to an object with the
31 following structure containing the broken-out
32 fields of an entry in the RPC program number data base.
33 .PP
34 .in +4n
35 .EX
36 struct rpcent {
37     char  *r_name;     /* name of server for this RPC program */
38     char **r_aliases;  /* alias list */
39     long   r_number;   /* RPC program number */
41 .EE
42 .in
43 .PP
44 The members of this structure are:
45 .TP
46 .I r_name
47 The name of the server for this RPC program.
48 .TP
49 .I r_aliases
50 A NULL-terminated list of alternate names for the RPC program.
51 .TP
52 .I r_number
53 The RPC program number for this service.
54 .PP
55 The
56 .BR getrpcent ()
57 function reads the next entry from the database.
58 A connection is opened to the database if necessary.
59 .PP
60 The
61 .BR setrpcent ()
62 function opens a connection to the database,
63 and sets the next entry to the first entry.
65 .I stayopen
66 is nonzero,
67 then the connection to the database
68 will not be closed between calls to one of the
69 .BR getrpc* ()
70 functions.
71 .PP
72 The
73 .BR endrpcent ()
74 function closes the connection to the database.
75 .PP
76 The
77 .BR getrpcbyname ()
78 and
79 .BR getrpcbynumber ()
80 functions sequentially search from the beginning
81 of the file until a matching RPC program name or
82 program number is found, or until end-of-file is encountered.
83 .SH RETURN VALUE
84 On success,
85 .BR getrpcent (),
86 .BR getrpcbyname (),
87 and
88 .BR getrpcbynumber ()
89 return a pointer to a statically allocated
90 .I rpcent
91 structure.
92 NULL is returned on EOF or error.
93 .SH FILES
94 .TP
95 .I /etc/rpc
96 RPC program number database.
97 .SH ATTRIBUTES
98 For an explanation of the terms used in this section, see
99 .BR attributes (7).
100 .ad l
103 allbox;
104 lbx lb lb
105 l l l.
106 Interface       Attribute       Value
108 .BR getrpcent (),
109 .BR getrpcbyname (),
110 .BR getrpcbynumber ()
111 T}      Thread safety   MT-Unsafe
113 .BR setrpcent (),
114 .BR endrpcent ()
115 T}      Thread safety   MT-Safe locale
119 .sp 1
120 .SH CONFORMING TO
121 Not in POSIX.1.
122 Present on the BSDs, Solaris, and many other systems.
123 .SH BUGS
124 All information
125 is contained in a static area
126 so it must be copied if it is
127 to be saved.
128 .SH SEE ALSO
129 .BR getrpcent_r (3),
130 .BR rpc (5),
131 .BR rpcinfo (8),
132 .BR ypserv (8)