Thread View: news.software.nntp
2 messages
2 total messages
Started by Don Lewis
Wed, 20 Jul 1994 07:34
gethostby*() failure diagnostics (was Re: pardon a simple(?) question...)
Author: Don Lewis
Date: Wed, 20 Jul 1994 07:34
Date: Wed, 20 Jul 1994 07:34
27 lines
2095 bytes
2095 bytes
In article <30gm2c$5tp@rodan.UU.NET>, Rich Salz <rsalz@uunet.uu.net> wrote: >In <30enum$30q@sunrise.gv.ssi1.com> gdonl@gv.ssi1.com (Don Lewis) writes: [ nnrpd prints a message based on errno when gethostbyaddr() fails ] >>Nnrpd should be reporting the value of h_errno in this case rather than >>relying on perror() or its equivalent. > >Err, well, I dunno. > >Is h_errno really standard? I don't think so, but I suppose I could be >convinced otherwise. I don't know if it is standard, but it seems to be really common. It's documented in the man pages on HPUX and Apollo DomainOS. The Apollo man page mentions herror(), which seems to be a perror() equivalent. Both h_errno and herror() are mentioned in the man page included in the beta distribution of BIND 4.9.3. The SunOS 4.1.x man page does not document h_errno, but it's defined in the include file <netdb.h>. I don't have any other Un*x boxes handy that I can examine. None of the man pages document errno being set if gethostby*() fails. -- Don "Truck" Lewis Silicon Systems Internet: gdonl@gv.ssi1.com 138 New Mohawk Road Phone: +1 916 478-8284 FAX: +1 916 478-8251 Nevada City, CA 95959
Re: gethostby*() failure diagnostics (was Re: pardon a simple(?) question...)
Author: Neil Rickert
Date: Wed, 20 Jul 1994 12:42
Date: Wed, 20 Jul 1994 12:42
39 lines
2611 bytes
2611 bytes
In article <30ik1j$ctt@sunrise.gv.ssi1.com> gdonl@gv.ssi1.com (Don Lewis) writes: >In article <30gm2c$5tp@rodan.UU.NET>, Rich Salz <rsalz@uunet.uu.net> wrote: >>In <30enum$30q@sunrise.gv.ssi1.com> gdonl@gv.ssi1.com (Don Lewis) writes: > >[ nnrpd prints a message based on errno when gethostbyaddr() fails ] > >>>Nnrpd should be reporting the value of h_errno in this case rather than >>>relying on perror() or its equivalent. >> >>Err, well, I dunno. >> >>Is h_errno really standard? I don't think so, but I suppose I could be >>convinced otherwise. Rich is right to avoid h_errno here. >I don't know if it is standard, but it seems to be really common. It's >documented in the man pages on HPUX and Apollo DomainOS. The Apollo >man page mentions herror(), which seems to be a perror() equivalent. >Both h_errno and herror() are mentioned in the man page included in >the beta distribution of BIND 4.9.3. The SunOS 4.1.x man page does not >document h_errno, but it's defined in the include file <netdb.h>. I >don't have any other Un*x boxes handy that I can examine. One must be careful about interpreting man pages and header files. In practice, h_errno is a diagnostic from the resolver library. If host lookups are done differently, then it does not apply. On a SunOS 4.1.x system set up according to vendor recommendations, gethostbyname() uses a NIS lookup. The NIS server in turn might use the resolver. But when this happens, h_errno is available to the NIS server, but not to the client making the lookup via a network connection to the NIS server. >None of the man pages document errno being set if gethostby*() fails. This is probably correct. If you are not doing a direct resolver lookup, a nameserver timeout may be indistinguishable from "unknown host".
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads