According to POSIX.1, neither PATH_MAX nor NAME_MAX have to be defined as constants (see Limits on File System Capacity). To be portable, a program should instead use pathconf() to determine the maximum limits.
LSB defines PATH_MAX but not NAME_MAX (see Data Definitions for libc). Therefore, the minimum requirement is that at least the use of the NAME_MAX constant is removed from the code.
I noticed that the code in the log service contains constructs like this:
In the example above, NAME_MAX can simply be removed. The reason is that a pathname also includes the filename (unless it refers to a directory).
changeset: 7262:bd45f18efb09
tag: tip
user: Vu Minh Nguyen vu.m.nguyen@dektech.com.au
date: Thu Jan 21 09:47:49 2016 +0700
summary: log: Use pathconf() instead of NAME_MAX [#279]
rev: bd45f18efb09e1a4425e4c12dd6c93e784e9ffd1
Related
Tickets:
#279