I'm presently writing a filesystem. The statvfs
(and even the statfs
) structs contain a field specifying the maximum length of a name in that path. As PATH_MAX
is defined in the pathconf
manpage (getconf
), this means it is defined on a per-directory basis (and thus, determined by the underlying filesystem). How does one specify this value?
PATH_MAX
mostly behaves as a property of the file system function call interface, so I don't think it makes much sense to have it vary across directories.
For example, renaming or moving a directory with large directory trees in it may make the longest absolute pathname longer and it would be complicated and inefficient to limit that.
Instead, PATH_MAX
serves to allow the kernel to copy passed pathnames to temporary unpaged memory, which can then be processed without needing to allow for a page fault at each access. Allocating huge amounts of such memory may block most other things the kernel is doing or even cause kernel panics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With