Networking Forums

Networking Forums > Computer Networking > Linux Networking > getnameinfo() errors

Reply
Thread Tools Display Modes

getnameinfo() errors

 
 
Gisle Vanem
Guest
Posts: n/a

 
      11-18-2003, 08:09 PM
How come we must use gai_strerror() to get error-text from
getaddrinfo(), but strerror() from getnameinfo().

What where the designers thinking? Is there some logic to this?

--
Gisle V.

Unscramble (E-Mail Removed) to reply by email.
Ref. http://www.rot13.org
 
Reply With Quote
 
 
 
 
Michael Fuhr
Guest
Posts: n/a

 
      11-18-2003, 09:50 PM
"Gisle Vanem" <(E-Mail Removed)> writes:

> How come we must use gai_strerror() to get error-text from
> getaddrinfo(), but strerror() from getnameinfo().
>
> What where the designers thinking? Is there some logic to this?


Error reporting for getaddrinfo() and getnameinfo() is the same:

* If the return value is 0 then the function was successful.

* If the return value is EAI_SYSTEM then the error code is in
errno and you can use strerror() to get the error text.

* Otherwise use gai_strerror() on the return value to get the
error text.

The RETURN VALUE section of the getnameinfo() manual page on Linux
is a bit misleading, although the ERRORS section does mention that
EAI_SYSTEM means that the error code is in errno.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
regarding getaddrinfo and getnameinfo amitkeerti Linux Networking 3 08-05-2007 06:35 PM
getnameinfo() and localhost dkishenko@gmail.com Windows Networking 0 10-25-2006 07:54 AM
DNS Errors Craig Network Routers 0 12-20-2005 07:52 PM
UDP and NAT errors Doug Laidlaw Linux Networking 2 06-26-2005 10:51 AM
RAS - VPN - TCP Errors =?Utf-8?B?QmFycmllIHZhbiBIYWFybGVt?= Windows Networking 1 04-29-2004 02:56 PM



1 2 3 4 5 6 7 8 9 10 11