sysconf - exposing constants to userspace

Tim Hockin
2004-02-19T20:53:32Z

What is the preferred way to expose "constants" to userland? I quoty-finger
"constants" because they may be defined as constants to any given kernel,
they are not necessarily constant over time.

There are things which can be changed as constants which would currently
require a libc recompile. For example NGROUPS_MAX :). Since it just got
merged, anyone who wants to use it will have to recompile their libc to get
the new value of NGROUPS_MAX.

I found an old old patch to do this via read-only sysctl() entries. Should
I resurrect that patch? Or maybe just do a sys_sysconf() entry? Or should
I just shut up and tell users to cope with recompiling libc?

--
Tim Hockin
Sun Microsystems, Linux Software Engineering
thockin@sun.com
All opinions are my own, not Sun's