Re: (failed) packages
- To: Paul Emsley <email@example.com>
- Cc: firstname.lastname@example.org
- Subject: Re: (failed) packages
- From: email@example.com (Thomas Bushnell, BSG)
- Date: 04 Oct 2001 23:58:43 -0700
- Message-id: <firstname.lastname@example.org>
- In-reply-to: <email@example.com>
- References: <m2n.s.15FrRl-000xU8@chiark.greenend.org.uk> <firstname.lastname@example.org> <email@example.com> <20010630135938.A551@22.214.171.124> <firstname.lastname@example.org>
Paul Emsley <email@example.com> 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.