Comtrol eCos User Manual

Page 517

Advertising
background image

Chapter 38. TCP/IP Library Reference

continue;

}

if (bind(s[nsock], res->ai_addr, res->ai_addrlen)

<

0) {

cause = "bind";

close(s[nsock]);

continue;

}

(void) listen(s[nsock], 5);

nsock++;

}

if (nsock == 0) {

err(1, cause);

/*NOTREACHED*/

}

freeaddrinfo(res0);

DIAGNOSTICS

Error return status from getaddrinfo() is zero on success and non-zero on

errors.

Non-zero error codes are defined in

<

netdb.h>, and as follows:

EAI_ADDRFAMILY

Address family for nodename not supported.

EAI_AGAIN

Temporary failure in name resolution.

EAI_BADFLAGS

Invalid value for ai_flags.

EAI_FAIL

Non-recoverable failure in name resolution.

EAI_FAMILY

ai_family not supported.

EAI_MEMORY

Memory allocation failure.

EAI_NODATA

No address associated with nodename.

EAI_NONAME

nodename nor servname provided, or not known.

EAI_SERVICE

servname not supported for ai_socktype.

EAI_SOCKTYPE

ai_socktype not supported.

EAI_SYSTEM

System error returned in errno.

If called with proper argument, gai_strerror() returns a pointer to a

string describing the given error code.

If the argument is not one of

the EAI_xxx values, the function still returns a pointer to a string

whose contents indicate an unknown error.

SEE ALSO

getnameinfo(3), gethostbyname(3), getservbyname(3), hosts(5),

resolv.conf(5), services(5), hostname(7), named(8)

R. Gilligan, S. Thomson, J. Bound, and W. Stevens, Basic Socket Interface

Extensions for IPv6, RFC2553, March 1999.

Tatsuya Jinmei and Atsushi Onoe, An Extension of Format for IPv6 Scoped

Addresses, internet draft, draft-ietf-ipngwg-scopedaddr-format-02.txt,

work in progress material.

Craig Metz, "Protocol Independence Using the Sockets API", Proceedings of

the freenix track: 2000 USENIX annual technical conference, June 2000.

HISTORY

The implementation first appeared in WIDE Hydrangea IPv6 protocol stack

413

Advertising