Re: libc6! Cross compilation issues
Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> writes:
> Okay, understood. At a later step, we may want to add code for all
> suboptimal programs. For now, let me ask a further question: What about
> MAXHOSTNAMELEN? If there is no fixed value for this, how can I determine the
> value at run time?
You don't need to, because there's only one hostname. So you just
use gethostname, which will tell you if your buffer was not enough,
and you can expand. It was never right (if it ever happened) to
assume that any other host than the current one has a hostname that
will fit in MAXHOSTNAMELEN.
The DNS actually does specify a maximum hostname, but it would be
foolish to build that into any actual program.