Re: sysconf - exposing constants to userspace

Jeff Sipek
2004-02-19T21:31:16Z

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 19 February 2004 15:48, Tim Hockin wrote:
> 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?

I think that making something in /sys would make the most sense, with one
constant per file. We could dump the consts files to for example /sys/consts,
or make a logical directory structure to make navigation easier.

Jeff.

- --
UNIX is user-friendly ... it's just selective about who it's friends are
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFANSsEwFP0+seVj/4RAgiaAJ9ka5sUjXEE+xNazblPO73/ovnsrACgpZPX
kGZV3gEplJpx24eL62AuQqA=
=3HMU
-----END PGP SIGNATURE-----