bindresvport

Name

bindresvport -- bind socket to privileged IP port

Synopsis

#include <sys/types.h>
#include <rpc.rpc.h>

int bindresvport(int sd, struct sockaddr_in *sin);

Description

The bindresvport() function is used to bind a socket to a privileged IP port. This function can be used only by root.

Return Value

On success, zero is returned. On failure, -1 is returned, and errno is set appropriately.

Errors

EPFNOSUPPORT

Address of second argument provided did not match address family of first argument.