openat: Increase OPENAT_BUFFER_SIZE from 512 to at least 1024
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Jan 2011 18:26:56 +0000 (10:26 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Jan 2011 18:27:23 +0000 (10:27 -0800)
commit03dd3ccd9a02d8406571243b74c6afb08f90ba2b
tree3f88d7f01f2410f8b352d5512158b1c2731714c2
parent9040dc9567e2b0c9268f5a1e5c84173c0db6d37a
openat: Increase OPENAT_BUFFER_SIZE from 512 to at least 1024

This avoids heap allocation for file names whose lengths are in
the range 512..1023, with the upper bound increasing to at most
4031 depending on the platform's PATH_MAX.  (We do not want
pathmax.h here as it might supply a non-constant PATH_MAX.)
* lib/openat-priv.h (SAFER_ALLOCA_MAX, SAFER_ALLOCA): New macros.
Perhaps they should be moved to malloca.h?
(OPENAT_BUFFER_SIZE): Use them.
ChangeLog
lib/openat-priv.h