You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value of this macro is an integer constant expression that represents the maximum length of a file name string. It is defined in stdio.h.
Unlike PATH_MAX, this macro is defined even if there is no actual limit imposed. In such a case, its value is typically a very large number. This is always the case on GNU/Hurd systems.
Usage Note: Don’t use FILENAME_MAX as the size of an array in which to store a file name! You can’t possibly make an array that big! Use dynamic allocation (see Memory Allocation) instead.
should we make FILENAME_MAX a little smaller(eg: 256)?
The text was updated successfully, but these errors were encountered:
Since the struct is expected to be rarely used (we use only one instance of the struct in the h2o server), I do not think that it is worth complicating the code to use dynamic allocation.
chenbd
added a commit
to chenbd/h2o
that referenced
this issue
Jan 6, 2018
https://github.com/h2o/h2o/blob/master/include/h2o/memory.h#L136
on my system it is 4096. seems it's more than enough.
https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html
Macro: int FILENAME_MAX
The value of this macro is an integer constant expression that represents the maximum length of a file name string. It is defined in stdio.h.
Unlike PATH_MAX, this macro is defined even if there is no actual limit imposed. In such a case, its value is typically a very large number. This is always the case on GNU/Hurd systems.
Usage Note: Don’t use FILENAME_MAX as the size of an array in which to store a file name! You can’t possibly make an array that big! Use dynamic allocation (see Memory Allocation) instead.
should we make
FILENAME_MAX
a little smaller(eg: 256)?The text was updated successfully, but these errors were encountered: