summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoritojun <>2001-01-26 13:31:35 +0000
committeritojun <>2001-01-26 13:31:35 +0000
commitca4d453ef6c4607ea4865cb4e6f305b6895451fd (patch)
tree5a6b44a9772057517a597023375ee3e4d85e5e00
parentc985671921b8b1a0cfb9de6fc8eda0bf97d6401d (diff)
downloadopenbsd-ca4d453ef6c4607ea4865cb4e6f305b6895451fd.tar.gz
openbsd-ca4d453ef6c4607ea4865cb4e6f305b6895451fd.tar.bz2
openbsd-ca4d453ef6c4607ea4865cb4e6f305b6895451fd.zip
wording updates. typo in example (s/err1/errx/).
sync with latest kame.
-rw-r--r--src/lib/libc/net/getaddrinfo.331
1 files changed, 16 insertions, 15 deletions
diff --git a/src/lib/libc/net/getaddrinfo.3 b/src/lib/libc/net/getaddrinfo.3
index 01bfb3cef8..28632dcee3 100644
--- a/src/lib/libc/net/getaddrinfo.3
+++ b/src/lib/libc/net/getaddrinfo.3
@@ -1,5 +1,5 @@
1.\" $OpenBSD: getaddrinfo.3,v 1.13 2000/12/24 00:30:54 aaron Exp $ 1.\" $OpenBSD: getaddrinfo.3,v 1.14 2001/01/26 13:31:35 itojun Exp $
2.\" $KAME: getaddrinfo.3,v 1.22 2000/08/09 21:16:17 itojun Exp $ 2.\" $KAME: getaddrinfo.3,v 1.27 2001/01/26 13:27:56 itojun Exp $
3.\" 3.\"
4.\" Copyright (c) 1983, 1987, 1991, 1993 4.\" Copyright (c) 1983, 1987, 1991, 1993
5.\" The Regents of the University of California. All rights reserved. 5.\" The Regents of the University of California. All rights reserved.
@@ -258,12 +258,12 @@ Here are pitfall cases you may encounter:
258.Bl -bullet 258.Bl -bullet
259.It 259.It
260.Fn getaddrinfo 260.Fn getaddrinfo
261will raise error if members in 261will raise an error if members of the
262.Fa hints 262.Fa hints
263structure is not consistent. 263structure are not consistent.
264For example, for internet address families, 264For example, for internet address families,
265.Fn getaddrinfo 265.Fn getaddrinfo
266will raise error if you specify 266will raise an error if you specify
267.Dv SOCK_STREAM 267.Dv SOCK_STREAM
268to 268to
269.Fa ai_socktype 269.Fa ai_socktype
@@ -277,10 +277,10 @@ If you specify a
277which is defined only for certain 277which is defined only for certain
278.Fa ai_socktype , 278.Fa ai_socktype ,
279.Fn getaddrinfo 279.Fn getaddrinfo
280will raise error because the arguments are not consistent. 280will raise an error because the arguments are not consistent.
281For example, 281For example,
282.Fn getaddrinfo 282.Fn getaddrinfo
283will raise error if you ask for 283will raise an error if you ask for
284.Dq Li tftp 284.Dq Li tftp
285service on 285service on
286.Dv SOCK_STREAM . 286.Dv SOCK_STREAM .
@@ -292,11 +292,11 @@ while you set
292to 292to
293.Dv SOCK_RAW , 293.Dv SOCK_RAW ,
294.Fn getaddrinfo 294.Fn getaddrinfo
295will raise error, because service names are not defined for the internet 295will raise an error, because service names are not defined for the internet
296.Dv SOCK_RAW 296.Dv SOCK_RAW
297space. 297space.
298.It 298.It
299If you specify numeric 299If you specify a numeric
300.Fa servname , 300.Fa servname ,
301while leaving 301while leaving
302.Fa ai_socktype 302.Fa ai_socktype
@@ -304,7 +304,7 @@ and
304.Fa ai_protocol 304.Fa ai_protocol
305unspecified, 305unspecified,
306.Fn getaddrinfo 306.Fn getaddrinfo
307will raise error. 307will raise an error.
308This is because the numeric 308This is because the numeric
309.Fa servname 309.Fa servname
310does not identify any socket type, and 310does not identify any socket type, and
@@ -347,10 +347,11 @@ If the argument is not one of the
347values, the function still returns a pointer to a string whose contents 347values, the function still returns a pointer to a string whose contents
348indicate an unknown error. 348indicate an unknown error.
349.\" 349.\"
350.Sh EXTENSION 350.Ss Extension for scoped IPv6 address
351The implementation allows experimental numeric IPv6 address notation with 351The implementation allows experimental numeric IPv6 address notation with
352scope identifier. 352scope identifier.
353By appending atmark and scope identifier to addresses, you can fill 353By appending the percent character and scope identifier to addresses,
354you can fill
354.Li sin6_scope_id 355.Li sin6_scope_id
355field for addresses. 356field for addresses.
356This would make management of scoped address easier, 357This would make management of scoped address easier,
@@ -405,7 +406,7 @@ hints.ai_family = PF_UNSPEC;
405hints.ai_socktype = SOCK_STREAM; 406hints.ai_socktype = SOCK_STREAM;
406error = getaddrinfo("www.kame.net", "http", &hints, &res0); 407error = getaddrinfo("www.kame.net", "http", &hints, &res0);
407if (error) { 408if (error) {
408 err1(1, "%s", gai_strerror(error)); 409 errx(1, "%s", gai_strerror(error));
409 /*NOTREACHED*/ 410 /*NOTREACHED*/
410} 411}
411s = -1; 412s = -1;
@@ -449,7 +450,7 @@ hints.ai_socktype = SOCK_STREAM;
449hints.ai_flags = AI_PASSIVE; 450hints.ai_flags = AI_PASSIVE;
450error = getaddrinfo(NULL, "http", &hints, &res0); 451error = getaddrinfo(NULL, "http", &hints, &res0);
451if (error) { 452if (error) {
452 err1(1, "%s", gai_strerror(error)); 453 errx(1, "%s", gai_strerror(error));
453 /*NOTREACHED*/ 454 /*NOTREACHED*/
454} 455}
455nsock = 0; 456nsock = 0;
@@ -575,7 +576,7 @@ The implementation first appeared in WIDE Hydrangea IPv6 protocol stack kit.
575.Sh STANDARDS 576.Sh STANDARDS
576The 577The
577.Fn getaddrinfo 578.Fn getaddrinfo
578function is defined IEEE POSIX 1003.1g draft specification, 579function is defined in IEEE POSIX 1003.1g draft specification,
579and documented in 580and documented in
580.Dq Basic Socket Interface Extensions for IPv6 581.Dq Basic Socket Interface Extensions for IPv6
581.Pq RFC2553 . 582.Pq RFC2553 .