test-netdb.c
Ulrich Drepper
drepper@redhat.com
Mon Aug 27 13:41:00 GMT 2001
Roland McGrath <roland@frob.com> writes:
> The draft 7 Open Group spec seems to say that gethostname should truncate
> the result and return zero when the given buffer length is too short.
I agree that this is awful. It's another compromise API.
> I don't have a problem with that, but it is an incompatible change
> and could break programs that expect the ENAMETOOLONG behavior.
What's the alternative? Keeping the documented behavior means
stretching the wording of the specification. It more useful and I
don't expect it to cause problems in real applications. If the
application is testing the return value it#s good, it can react. If
it's not testing the return value it might use a truncated and
potentially unterminated string.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
More information about the Libc-hacker
mailing list