test-netdb.c
Roland McGrath
roland@frob.com
Mon Aug 27 12:14:00 GMT 2001
> Roland, why did you make this change?
To avoid using MAXHOSTNAMELEN and to test the ENAMETOOLONG error functionality.
My immediate motivation was to be able to compile the test program on the Hurd.
> According to the Austin Draft the previous version was fine. The only
> change might be to use HOST_NAME_MAX instead of MAXHOSTNAMELEN.
HOST_NAME_MAX falls under "Runtime Invariant Values (Possibly Indeterminate)",
like ARG_MAX. So it need not be defined and sysconf can return -1
(and that will be the case on Hurd, where there is no arbitrary limit).
> On a Linux system gethostname (NULL, 0) will return 0 without setting
> ENAMETOOLONG,
Please see sysdeps/unix/sysv/gethostname.c; I did test the change
on Linux before I made the commit.
More information about the Libc-hacker
mailing list