The POSIX.1 standard specifies a number of parameters that describe the limitations of the file system. It's possible for the system to have a fixed, uniform limit for a parameter, but this isn't the usual case. On most systems, it's possible for different file systems (and, for some parameters, even different files) to have different maximum limits. For example, this is very likely if you use NFS to mount some of the file systems from other machines.
Each of the following macros is defined in `limits.h' only if the
system has a fixed, uniform limit for the parameter in question. If the
system allows different file systems or files to have different limits,
then the macro is undefined; use
find out the limit that applies to a particular file. See section Using
Each parameter also has another macro, with a name starting with `_POSIX', which gives the lowest value that the limit is allowed to have on any POSIX system. See section Minimum Values for File System Limits.
These are alternative macro names for some of the same information.
NAME_MAX. It is defined in `dirent.h'.
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 the GNU system.
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 section Memory Allocation) instead.
Go to the first, previous, next, last section, table of contents.