Re: MAXHOSTNAMLEN
On Tue, Oct 24, 2000 at 10:59:49AM +0000, martin.stenzel@d2mail.de wrote:
>
>
> Hi,
>
>
> I am just wondering whether the values for
>
> MAXHOSTNAMELEN = 64
> and
> MAXPATHLEN = 512
>
> are correct for the Hurd.
No. There are no correct values for them. The correct thing is not to
provide any values, which is what we do.
PATH_MAX:
Posixly correct software should in this case with pathconf("...", _PC_PATH_MAX)
which will return -1 on the Hurd, which means no limit, and you have to
handle any length memory can take (malloc/realloc/loop).
MAXHOSTNAMELEN:
Any length can occure, and you should check for ENAMETOOLONG and realloc a
larger buffer. See inetutils source gethostname implementation, or other
places which do it correct.
> When compiling progs that need these values I had to exchange the variables with the values.
Well, this works as a hack but the proper way is described above.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann GNU http://www.gnu.org marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de
Reply to: