POSIX determines that many of these restrictions are optional. If the FOO limit is not defined in limits.h , this means that the system may not have such a limit, or the limit may change at run time or depends on the path to which it is applied. In these cases, you use the pathconf , fpathconf or sysconf and the _PC_* and _SC_* macros, as in:
path_max = pathconf("/", _PC_PATH_MAX);
or
page_size = sysconf(_SC_PAGE_SIZE);
Unfortunately, GNU (the GNU C library) defines many restrictions as runtime-variable when they are actually constant on Linux, in some (in my opinion, very erroneous) I hope that someday the restrictions will be removed and the applications will be immediately able to take advantage of the elimination of restrictions. However, for application and kernel reliability, it is actually much better to have fixed limits if they are large enough (like Linux limitations).
R .. Nov 24 '10 at 15:41 2010-11-24 15:41
source share