Re: what's the purpose of MAXHOSTNAMELEN?

From: Samuel Thibault
Date: Tue Dec 29 2009 - 14:35:59 EST


Robert P. J. Day, le Tue 29 Dec 2009 14:19:30 -0500, a écrit :
> so lots of people define it but no one uses it. it *is* exported to
> user space in /usr/include/asm/param.h, but i still have no idea what
> it's for in user space. obsolete?

It's like all these *MAX* #defines: they are a bad way to express the
system limitations. They are bad because they end up compiled-in, but
also because people understand them as "a typical allocation length" and
get lazy. The typical example is PATH_MAX, which is #defined to 4096.
A _lot_ of applications thus keep allocating 4KB for all paths.

See
http://www.gnu.org/software/hurd/hurd/porting/guidelines.html#PATH_MAX_tt_MAX_PATH_tt_MAXPATHL

If you could drop it (would be completely POSIX-compliant), that'd be a
great service to GNU/Hurd porters, but I bet you'll also get a lot of
angry people.

Samuel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/