# phpman > man > getrpcport(3)

[GETRPCPORT(3)](https://www.chedong.com/phpMan.php/man/GETRPCPORT/3/markdown)            BSD Library Functions Manual            [GETRPCPORT(3)](https://www.chedong.com/phpMan.php/man/GETRPCPORT/3/markdown)

## NAME
     **getrpcport** — get RPC port number

## SYNOPSIS
     _int_
     **getrpcport**(_char_ _*host_, _int_ _prognum_, _int_ _versnum_, _int_ _proto_);

## DESCRIPTION
     The **getrpcport**() function returns the port number for version _versnum_ of the RPC program
     _prognum_ running on _host_ and using protocol _proto_.  It returns 0 if it cannot contact the
     portmapper, or if _prognum_ is not registered.  If _prognum_ is registered but not with version
     _versnum_, it will still return a port number (for some version of the program) indicating that
     the program is indeed registered.  The version mismatch will be detected upon the first call to
     the service.

## AVAILABILITY
     The **getrpcport**() function is part of libtirpc.

BSD                             October 6, 1987                            BSD
