This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: test-netdb.c


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]