|
|
HP-UX Reference > Bbindresvport(3N)HP-UX 11i Version 2: December 2007 Update |
|
NAMEbindresvport() — bind socket to privileged IP port SYNOPSIS#include <sys/types.h> #include <netinet/in.h> int bindresvport(int sd, struct sockaddr_in *sin); DESCRIPTIONThe bindresvport() function binds a socket descriptor to a privileged IP port; that is, a port number in the range 0 to 1023. sd is a socket descriptor that was previously defined by a successful call to socket() (see socket(2)). Upon successful completion of bindresvport(), the sin_port field in the struct pointed to by sin contains the number of the privileged port bound to the sd socket. Due to the need to protect the port numbers used by various networking commands, bindresvport() only returns a port number within a smaller subrange in the range of 0 to 1023. Only superuser can bind to a privileged port. RETURN VALUEbindresvport() returns the following values:
ERRORSIf bindresvport() fails, errno is set to one of the following values:
|
|