| 1 |
'\" t |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" %%%LICENSE_START(BSD_ONELINE_CDROM) |
| 5 |
.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) |
| 6 |
.\" %%%LICENSE_END |
| 7 |
.\" |
| 8 |
.TH getrpcport 3 2025-05-17 "Linux man-pages 6.18" |
| 9 |
.SH NAME |
| 10 |
getrpcport \- get RPC port number |
| 11 |
.SH LIBRARY |
| 12 |
Standard C library |
| 13 |
.RI ( libc ,\~ \-lc ) |
| 14 |
.SH SYNOPSIS |
| 15 |
.nf |
| 16 |
.B "#include <rpc/rpc.h>" |
| 17 |
.P |
| 18 |
.BI "int getrpcport(const char *" host ", unsigned long " prognum , |
| 19 |
.BI " unsigned long " versnum ", unsigned int " proto ); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
.BR getrpcport () |
| 23 |
returns the port number for version |
| 24 |
.I versnum |
| 25 |
of the RPC program |
| 26 |
.I prognum |
| 27 |
running on |
| 28 |
.I host |
| 29 |
and using protocol |
| 30 |
.IR proto . |
| 31 |
It returns 0 if it cannot contact the portmapper, or if |
| 32 |
.I prognum |
| 33 |
is not registered. |
| 34 |
If |
| 35 |
.I prognum |
| 36 |
is registered but not with version |
| 37 |
.IR versnum , |
| 38 |
it will still return a port number (for some version of the program) |
| 39 |
indicating that the program is indeed registered. |
| 40 |
The version mismatch will be detected upon the first call to the service. |
| 41 |
.SH ATTRIBUTES |
| 42 |
For an explanation of the terms used in this section, see |
| 43 |
.BR attributes (7). |
| 44 |
.TS |
| 45 |
allbox; |
| 46 |
lbx lb lb |
| 47 |
l l l. |
| 48 |
Interface Attribute Value |
| 49 |
T{ |
| 50 |
.na |
| 51 |
.nh |
| 52 |
.BR getrpcport () |
| 53 |
T} Thread safety MT-Safe env locale |
| 54 |
.TE |
| 55 |
.SH STANDARDS |
| 56 |
BSD. |
| 57 |
.SH HISTORY |
| 58 |
BSD, Solaris. |