Red Hat Bugzilla – Bug 21346
OPEN_MAX not defined in limits.h
Last modified: 2007-04-18 12:30:02 EDT
OPEN_MAX is defined in linux/limits.h but limits.h doesn't include
linux/limits.h. Maybe limits.h should include bits/local_lim.h which
OPEN_MAX is intentionally not defined because it is no longer
constant in Linux, it is runtime changeable.
/usr/include/bits/local_lim.h does include linux/limits.h but
undefines this for this reason.
Use sysconfig(_SC_OPEN_MAX) to query the same information.
Sorry, but not defining OPEN_MAX *is* a bug -- some programs use this macro for
various purposes, and it is defined by POSIX standard. Removing it causes
portability problems (most programs don't need so many files anyway).
Additionally, this macro is mentioned in glibc.info (at least in redhat-7.1).