mount_setattr.2: Minor tweaks to Christian's patch
[man-pages.git] / man3 / getrpcport.3
blob087f63224ed29b668ae0e4bb60ed859e9f521e6d
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 .\" @(#)getrpcport.3r   2.2 88/08/02 4.0 RPCSRC; from 1.12 88/02/26 SMI
8 .TH GETRPCPORT 3 2021-03-22 "" "Linux Programmer's Manual"
9 .SH NAME
10 getrpcport \- get RPC port number
11 .SH SYNOPSIS
12 .nf
13 .B "#include <rpc/rpc.h>"
14 .PP
15 .BI "int getrpcport(const char *" host ", unsigned long " prognum ,
16 .BI "               unsigned long " versnum ", unsigned int " proto );
17 .fi
18 .SH DESCRIPTION
19 .BR getrpcport ()
20 returns the port number for version
21 .I versnum
22 of the RPC program
23 .I prognum
24 running on
25 .I host
26 and using protocol
27 .IR proto .
28 It returns 0 if it cannot contact the portmapper, or if
29 .I prognum
30 is not registered.
32 .I prognum
33 is registered but not with version
34 .IR versnum ,
35 it will still return a port number (for some version of the program)
36 indicating that the program is indeed registered.
37 The version mismatch will be detected upon the first call to the service.
38 .SH ATTRIBUTES
39 For an explanation of the terms used in this section, see
40 .BR attributes (7).
41 .ad l
42 .nh
43 .TS
44 allbox;
45 lbx lb lb
46 l l l.
47 Interface       Attribute       Value
49 .BR getrpcport ()
50 T}      Thread safety   MT-Safe env locale
51 .TE
52 .hy
53 .ad
54 .sp 1
55 .SH CONFORMING TO
56 Not in POSIX.1.
57 Present on the BSDs, Solaris, and many other systems.