Re: (failed) packages
- To: Paul Emsley <firstname.lastname@example.org>
- Cc: email@example.com
- Subject: Re: (failed) packages
- From: firstname.lastname@example.org (Thomas Bushnell, BSG)
- Date: 04 Oct 2001 23:58:43 -0700
- Message-id: <email@example.com>
- In-reply-to: <firstname.lastname@example.org>
- References: <m2n.s.15FrRl-000xU8@chiark.greenend.org.uk> <email@example.com> <firstname.lastname@example.org> <20010630135938.A551@22.214.171.124> <email@example.com>
Paul Emsley <firstname.lastname@example.org> writes:
> OK then, does one conditionalise on (e.g.) MAXHOSTNAMELEN:
> #ifdef MAXHOSTNAMELEN
> /* do it the traditional way */
> /* do it the Hurd way, typically using realloc() */
> for each occurance of MAXHOSTNAMELEN (or whatever)?
I see you didn't get an answer.
The answer is:
Use PATH_MAX. (If you have MAXHOSTNAMELEN but not PATH_MAX, then just
#define PATH_MAX MAXHOSTNAMELEN.)
If PATH_MAX is undefined, use pathconf. If pathconf returns -1 (as it
will on the Hurd), do it dynamically, with realloc or whatever else is
Of course, it's also reasonable to just always do it dynamically.