Subject: Wrong example in getaddrinfo(3)?
To: None <>
From: Olaf Seibert <>
List: current-users
Date: 02/10/2001 15:30:06
I think I found a cut&paste error in getaddrinfo(3):
(in both 1.5 and -current)

     The following example tries to open wildcard listening socket onto ser-
     vice ``http'', for all the address families available.

           error = getaddrinfo(NULL, "http", &hints, &res0);
           for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) {
                   s[nsock] = socket(res->ai_family, res->ai_socktype,
                   if (connect(s[nsock], res->ai_addr, res->ai_addrlen) < 0) {
			cause = "connect";


Should connect() not be bind() here?

___ Olaf 'Rhialto' Seibert - rhialto@polder --Soep van de dag, wat zal dat zijn
\X/     --wat kan dat wezen, beter maar het ergste vrezen -Boy Bensdorp