OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / 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 2014-05-28 "" "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(const 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
70 .I stayopen
71 is nonzero,
72 then the connection to the database
73 will not be closed between calls to one of the
74 .BR getrpc* ()
75 functions.
76 .LP
77 The
78 .BR endrpcent ()
79 function closes the connection to the database.
80 .LP
81 The
82 .BR getrpcbyname ()
83 and
84 .BR getrpcbynumber ()
85 functions sequentially search from the beginning
86 of the file until a matching RPC program name or
87 program number is found, or until end-of-file is encountered.
88 .SH RETURN VALUE
89 On success,
90 .BR getrpcent (),
91 .BR getrpcbyname (),
92 and
93 .BR getrpcbynumber ()
94 return a pointer to a statically allocated
95 .I rpcent
96 structure.
97 NULL is returned on EOF or error.
98 .SH FILES
99 .TP
100 .I /etc/rpc
101 RPC program number database.
102 .SH CONFORMING TO
103 Not in POSIX.1-2001.
104 Present on the BSDs, Solaris, and many other systems.
105 .SH BUGS
106 All information
107 is contained in a static area
108 so it must be copied if it is
109 to be saved.
110 .SH SEE ALSO
111 .BR getrpcent_r (3),
112 .BR rpc (5),
113 .BR rpcinfo (8),
114 .BR ypserv (8)
115 .SH COLOPHON
116 This page is part of release 3.68 of the Linux
117 .I man-pages
118 project.
119 A description of the project,
120 information about reporting bugs,
121 and the latest version of this page,
122 can be found at
123 \%http://www.kernel.org/doc/man\-pages/.