Fixes first part of PR#31184. addrsort() was not exposed to the rest of
libc as it turns out not to be usable for getaddrinfo(), so a different
sorter will be implemented for that.
but it is specified by IEEE Std 1003.1, 2004 Edition (POSIX) and
the X/Open standards (Issue 6 and XNS 5.2).
* revert change removing gethostent() from gethostbyname(3) man page
* delete kruft from gethnamaddr.c leaving only gethostent() as a
wrapper around _gethtent().
* revert recent changes to <netdb.h>
+ restore gethostent() prototype
+ restore freehostent() prototype; handle similar to non-shipped
getipnodby*() prototypes
+ use correct XOPEN_SOURCE version (520 not 500) for freeaddrinfo()
prototype; interface specified by XNS5.2 not XNS5
Reviewd by <christos> and <drochner>.
correct bad practice in the code - it uses two changing variables
to manage buffer (buf and buflen). we eliminate buflen and use
fixed point (ep) as the ending pointer.
this fix is critical.
for non-IPv4 address. obeys solaris8 practice.
XXX does not support scoped address extension, as gethostby* are not
scope-aware. always use getaddrinfo/getnameinfo.
XXX it is not very useful at this moment, if you define multiple entries for
single hostname. see PR 10713 for detail.
If an argument of a ctype function is outside "unsigned char"
and if it is not EOF, the behavior is undefined.
The isascii(3) is the sole exception of above and it was used to
be used to check a value was valid for other ctype functions in
ancient systems. On modern systems, the ctype functions take
all values of "unsigned char", and this check is obsolete and
even wrong for non-ASCII systems. However, we leave the isascii()
untouched for now, so as not to change the current behavior.
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.
the first two items result in the addition of code similar to the
following in various functions:
_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif