bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: heimdal on GNU HURD


From: Thomas Bushnell, BSG
Subject: Re: heimdal on GNU HURD
Date: 28 Sep 2001 19:18:04 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

> --- "Jacques A. Vidrine" <n@nectar.com> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]