Linux Standard Base Core Specification 4.1 | ||
---|---|---|
<<< Previous | Next >>> |
If the process has appropriate privilege, the bindresvport() function shall bind a socket to an anonymous privileged IP port, that is, arbitrarily selected from the range 512 through 1023.
If the bind is successful and sin
is not NULL
, and the port number
bound to is returned in the sin_port
member of sin.
Any caller-supplied value of sin_port
is ignored.
If sin is NULL
,
the address family is taken to be
AF_INET
and an available
privileged port is bound to.
Since there is no sockaddr_in
structure, the port number chosen cannot be returned.
The getsockname() may be used to
query for this information.
On success, 0 is returned.
On error, -1 is returned and
errno
is set to indicate the error.
bindresvport() may fail in the same way as bind() in POSIX 1003.1-2001 (ISO/IEC 9945-2003). The following additional or differing failures may occur:
Note: At this time, only
AF_INET
is supported. Applications should be prepared for either theEAFNOSUPPORT
orEPFNOSUPPORT
error to be indicated.
<<< Previous | Home | Next >>> |
bind_textdomain_codeset | Up | bindtextdomain |