Defining PATH_MAX for a filesystem?

前端 未结 6 1581
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-04 02:09

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_M

6条回答
  •  后悔当初
    2021-02-04 02:41

    POSIX allows _PC_PATH_MAX to vary based on the current directory, but that doesn't mean that systems which don't vary it aren't compliant.

    The real reason for PATH_MAX existing is that the kernel copies the pathname into kernelspace before doing any actual work with it.

    Your assertion that there is a PATH_MAX-related field in statvfs is just wrong. That's related to NAME_MAX, which is a different thing.

提交回复
热议问题