Subject: Re: UT_HOSTSIZE vs. MAXHOSTNAMELEN
To: Brian Stark <bstark@siemens-psc.com>
From: Johan Danielsson <joda@pdc.kth.se>
List: current-users
Date: 10/01/1999 22:56:06
Brian Stark <bstark@siemens-psc.com> writes:
> Does anyone know why the value for UT_HOSTSIZE (defined as 16 in
> /usr/include/utmp.h) does not match the value for MAXHOSTNAMELEN
> (defined as 256 in /usr/include/sys/param.h)?
Because it has always been that way. You need to change the utmp file
format if you want to increase it, and there are different ways to
make old applications happy. There was a thread about this some time
ago (on current-users, or perhaps one of tech-*).
> For example the IP address string:
>
> 123.123.123.123
>
> requires 15 characters, plus one extra character for the null terminator
> so 16 characters seems to make sense...
I think it's (16) just an arbitratry number. The utmp fields are not
zero terminated.
/Johan