RE: [PATCH] Build on Debian GNU/Hurd
- From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
- Date
- Sep 22, 2006, 17:22 UTC
- Message-ID
- <000001c6de6b$a9994920$c47eedc1@ramsay1.demon.co.uk>
- In-Reply-To
- <Pine.LNX.4.64.0609211050390.4388@g5.osdl.org>
On Thurs Sept 21 at 18:54, Linus Torvalds wrote:
Show 31 quoted lines
> On Thu, 21 Sep 2006, Ramsay Jones wrote: > > > > IMHO, setting the value in the Makefile, for systems that don't define > > PATH_MAX, is a much better solution. In fact, that is what I thought was > > already being done. > > Well, considering that we _can_ test defines, why not just do it > automatically. > > In other words, instead of this patch: > > > > - > > > -#ifndef PATH_MAX > > > -# define PATH_MAX 4096 > > > -#endif > > > +#include <limits.h> > > Just make the code read > > #include <limits.h> > > /* > * Insane systems don't have a fixed PATH_MAX, it's POSIX > * compliant but not worth worrying about, so if we didn't > * get PATH_MAX from <limits.h>, just make up our own > */ > #ifndef PATH_MAX > # define PATH_MAX 4096 > #endif > > and after that we can just ignore the issue forever more.
Yes, that would certainly be a solution. (Of course, setting the value in the Makefile would still be a better solution ;-) However, ...
Show 6 quoted lines
> > The thing is, it's not like we even really _care_ what PATH_MAX is all > that deeply. We just want to get some random value that is reasonable. > > Linus >
... given the above, a better solution is: don't use PATH_MAX. Simply #define a new symbol in a suitable git header file and globally replace uses of PATH_MAX with the new symbol. Job done.
All the best,
Ramsay