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

If the process has appropriate privilege, the bindresvport() function shall bind a socket to a privileged IP port.

Return Value

On success, 0 is returned. On error, -1 is returned and the global variable errno is set appropriately.

Errors

EPERM

The process did not have appropriate privilege.

EPFNOSUPPORT

Address of sin did not match address family of sd.