Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/net/getaddrinfo.3
Show All 12 Lines | |||||
.\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, | .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, | ||||
.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||||
.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE | .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE | ||||
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||||
.\" PERFORMANCE OF THIS SOFTWARE. | .\" PERFORMANCE OF THIS SOFTWARE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd December 21, 2015 | .Dd September 13, 2017 | ||||
.Dt GETADDRINFO 3 | .Dt GETADDRINFO 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm getaddrinfo , | .Nm getaddrinfo , | ||||
.Nm freeaddrinfo | .Nm freeaddrinfo | ||||
.Nd socket address structure to host and service name | .Nd socket address structure to host and service name | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/types.h | .In sys/types.h | ||||
▲ Show 20 Lines • Show All 316 Lines • ▼ Show 20 Lines | |||||
.Fn freeaddrinfo | .Fn freeaddrinfo | ||||
function. | function. | ||||
The | The | ||||
.Fa ai | .Fa ai | ||||
pointer should be a | pointer should be a | ||||
.Li addrinfo | .Li addrinfo | ||||
structure created by a call to | structure created by a call to | ||||
.Fn getaddrinfo . | .Fn getaddrinfo . | ||||
.Sh IMPLEMENTATION NOTES | |||||
The | |||||
.Li freeaddrinfo(NULL) | |||||
call behavior is unspecified both by | |||||
.St -susv4 | |||||
and | |||||
.Dv "RFC 3493" . | |||||
Current implementation ignores the | |||||
.Dv NULL | |||||
argument for compatibility with a code which relies on the details | |||||
of implementations of other operating systems. | |||||
bjk: I would suggest something like:
The behavior of
.Li freeadrinfo(NULL)
is left unspecified by… | |||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
.Fn getaddrinfo | .Fn getaddrinfo | ||||
returns zero on success or one of the error codes listed in | returns zero on success or one of the error codes listed in | ||||
.Xr gai_strerror 3 | .Xr gai_strerror 3 | ||||
if an error occurs. | if an error occurs. | ||||
.Sh EXAMPLES | .Sh EXAMPLES | ||||
The following code tries to connect to | The following code tries to connect to | ||||
.Dq Li www.kame.net | .Dq Li www.kame.net | ||||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |
I would suggest something like:
The behavior of
.Li freeadrinfo(NULL)
is left unspecified by both
.St -susv4
and
.Dv "RFC 3493" .
The current implementation ignores a
.Dv NULL
argument for compatibility with programs that rely on the implementation
details of other operating systems.
A potential alternative to ".Li freeaddrinfo(NULL)" is "a .Dv NULL argument to .Nm" (with appropriate newlines).