summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/net/getaddrinfo.310
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libc/net/getaddrinfo.3 b/src/lib/libc/net/getaddrinfo.3
index b82dda5937..7c3bfe40d7 100644
--- a/src/lib/libc/net/getaddrinfo.3
+++ b/src/lib/libc/net/getaddrinfo.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getaddrinfo.3,v 1.40 2005/03/12 00:02:07 claudio Exp $ 1.\" $OpenBSD: getaddrinfo.3,v 1.41 2005/07/05 22:21:16 dlg Exp $
2.\" $KAME: getaddrinfo.3,v 1.36 2005/01/05 03:23:05 itojun Exp $ 2.\" $KAME: getaddrinfo.3,v 1.36 2005/01/05 03:23:05 itojun Exp $
3.\" 3.\"
4.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") 4.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
@@ -288,7 +288,7 @@ structure(s).
288The following code tries to connect to 288The following code tries to connect to
289.Dq Li www.kame.net 289.Dq Li www.kame.net
290service 290service
291.Dq Li http 291.Dq Li www
292via a stream socket. 292via a stream socket.
293It loops through all the addresses available, regardless of address family. 293It loops through all the addresses available, regardless of address family.
294If the destination resolves to an IPv4 address, it will use an 294If the destination resolves to an IPv4 address, it will use an
@@ -310,7 +310,7 @@ const char *cause = NULL;
310memset(&hints, 0, sizeof(hints)); 310memset(&hints, 0, sizeof(hints));
311hints.ai_family = PF_UNSPEC; 311hints.ai_family = PF_UNSPEC;
312hints.ai_socktype = SOCK_STREAM; 312hints.ai_socktype = SOCK_STREAM;
313error = getaddrinfo("www.kame.net", "http", &hints, &res0); 313error = getaddrinfo("www.kame.net", "www", &hints, &res0);
314if (error) { 314if (error) {
315 errx(1, "%s", gai_strerror(error)); 315 errx(1, "%s", gai_strerror(error));
316 /*NOTREACHED*/ 316 /*NOTREACHED*/
@@ -341,7 +341,7 @@ freeaddrinfo(res0);
341.Ed 341.Ed
342.Pp 342.Pp
343The following example tries to open a wildcard listening socket onto service 343The following example tries to open a wildcard listening socket onto service
344.Dq Li http , 344.Dq Li www ,
345for all the address families available. 345for all the address families available.
346.Bd -literal -offset indent 346.Bd -literal -offset indent
347struct addrinfo hints, *res, *res0; 347struct addrinfo hints, *res, *res0;
@@ -354,7 +354,7 @@ memset(&hints, 0, sizeof(hints));
354hints.ai_family = PF_UNSPEC; 354hints.ai_family = PF_UNSPEC;
355hints.ai_socktype = SOCK_STREAM; 355hints.ai_socktype = SOCK_STREAM;
356hints.ai_flags = AI_PASSIVE; 356hints.ai_flags = AI_PASSIVE;
357error = getaddrinfo(NULL, "http", &hints, &res0); 357error = getaddrinfo(NULL, "www", &hints, &res0);
358if (error) { 358if (error) {
359 errx(1, "%s", gai_strerror(error)); 359 errx(1, "%s", gai_strerror(error));
360 /*NOTREACHED*/ 360 /*NOTREACHED*/