OSDN Git Service

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