> --- "Jacques A. Vidrine" <[EMAIL PROTECTED]> wrote:

> > Regardless, the next version of POSIX specifies HOST_NAME_MAX.  We
> > should probably be using HOST_NAME_MAX instead of MAXHOSTNAMELEN
> > in the Heimdal sources, or at least do something such as

Note that no system is required to define HOST_NAME_MAX, specifically,
if there is no maximum.  The situation is just like that for
PATH_NAME_MAX.  

You are supposed to check for a compile-time constant, which might not
be defined.  You can check for a run-time constant with sysconf, and
on the Hurd it will return -1, indicating the absence of any limit.

If you want the program to be Posix compliant, then you cannot assume
that HOST_NAME_MAX is always defined.

The correct thing to do is to use the referenced xgethostname, which
calls gethostname in a loop in order to get a big enough buffer.

Thomas

_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to