* sysconf - exposing constants to userspace
@ 2004-02-19 20:48 Tim Hockin
2004-02-19 21:30 ` Jeff Sipek
0 siblings, 1 reply; 8+ messages in thread
From: Tim Hockin @ 2004-02-19 20:48 UTC (permalink / raw)
To: Linux Kernel mailing list
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sysconf - exposing constants to userspace
2004-02-19 20:48 sysconf - exposing constants to userspace Tim Hockin
@ 2004-02-19 21:30 ` Jeff Sipek
2004-02-20 0:20 ` Jamie Lokier
0 siblings, 1 reply; 8+ messages in thread
From: Jeff Sipek @ 2004-02-19 21:30 UTC (permalink / raw)
To: thockin, Linux Kernel mailing list
-----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-----
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sysconf - exposing constants to userspace
2004-02-19 21:30 ` Jeff Sipek
@ 2004-02-20 0:20 ` Jamie Lokier
2004-02-20 0:21 ` Tim Hockin
2004-02-20 0:29 ` Jeff Sipek
0 siblings, 2 replies; 8+ messages in thread
From: Jamie Lokier @ 2004-02-20 0:20 UTC (permalink / raw)
To: Jeff Sipek; +Cc: thockin, Linux Kernel mailing list
Jeff Sipek wrote:
> 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.
Isn't that very similar to the /proc/sys/kernel we have now?
-- Jamie
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sysconf - exposing constants to userspace
2004-02-20 0:20 ` Jamie Lokier
@ 2004-02-20 0:21 ` Tim Hockin
2004-02-20 0:35 ` Chris Wright
2004-02-20 0:29 ` Jeff Sipek
1 sibling, 1 reply; 8+ messages in thread
From: Tim Hockin @ 2004-02-20 0:21 UTC (permalink / raw)
To: Jamie Lokier; +Cc: Jeff Sipek, Linux Kernel mailing list
On Fri, Feb 20, 2004 at 12:20:34AM +0000, Jamie Lokier wrote:
> Jeff Sipek wrote:
> > 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.
>
> Isn't that very similar to the /proc/sys/kernel we have now?
sysctls are all writable (unless I am missing something). A lot of these
things are not really tunables.
--
Tim Hockin
Sun Microsystems, Linux Software Engineering
thockin@sun.com
All opinions are my own, not Sun's
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sysconf - exposing constants to userspace
2004-02-20 0:20 ` Jamie Lokier
2004-02-20 0:21 ` Tim Hockin
@ 2004-02-20 0:29 ` Jeff Sipek
2004-02-20 0:34 ` Tim Hockin
2004-02-20 0:52 ` Chris Wright
1 sibling, 2 replies; 8+ messages in thread
From: Jeff Sipek @ 2004-02-20 0:29 UTC (permalink / raw)
To: Jamie Lokier; +Cc: thockin, Linux Kernel mailing list
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 19 February 2004 19:20, Jamie Lokier wrote:
> Jeff Sipek wrote:
> > 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.
>
> Isn't that very similar to the /proc/sys/kernel we have now?
If I understand the original post correctly, the numbers that we don't make
available to userspace are compile time constants. For example, since I can't
think of anything better, NR_CPUS. It is set during the config process, but
one cannot read the number from userspace while running that kernel. I know
that there are better examples, but I just can't think of any at the moment.
If I missed the point of the original post, please ignore me.
Jeff.
- --
Trust me, you don't want me doing _anything_ first thing in the morning.
- Linus Torvalds
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFANVUBwFP0+seVj/4RArdbAJ4tsq5cyDJ+058h1D6JDli1nsmP9ACeJnoN
pxE9BuRBNND271SGp81SMHM=
=rmLE
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sysconf - exposing constants to userspace
2004-02-20 0:29 ` Jeff Sipek
@ 2004-02-20 0:34 ` Tim Hockin
2004-02-20 0:52 ` Chris Wright
1 sibling, 0 replies; 8+ messages in thread
From: Tim Hockin @ 2004-02-20 0:34 UTC (permalink / raw)
To: Jeff Sipek; +Cc: Jamie Lokier, Linux Kernel mailing list
On Thu, Feb 19, 2004 at 07:29:45PM -0500, Jeff Sipek wrote:
> If I understand the original post correctly, the numbers that we don't make
> available to userspace are compile time constants. For example, since I can't
> think of anything better, NR_CPUS. It is set during the config process, but
> one cannot read the number from userspace while running that kernel. I know
> that there are better examples, but I just can't think of any at the moment.
>
> If I missed the point of the original post, please ignore me.
No, you got it. BUt I was specifically thinking of POSIX sysconf stuff,
like NGROUPS_MAX. See <linux/limits.h>.
--
Tim Hockin
Sun Microsystems, Linux Software Engineering
thockin@sun.com
All opinions are my own, not Sun's
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sysconf - exposing constants to userspace
2004-02-20 0:21 ` Tim Hockin
@ 2004-02-20 0:35 ` Chris Wright
0 siblings, 0 replies; 8+ messages in thread
From: Chris Wright @ 2004-02-20 0:35 UTC (permalink / raw)
To: Tim Hockin; +Cc: Jamie Lokier, Jeff Sipek, Linux Kernel mailing list
* Tim Hockin (thockin@sun.com) wrote:
> sysctls are all writable (unless I am missing something). A lot of these
> things are not really tunables.
no, they actually have a mode. some are 0444.
thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: sysconf - exposing constants to userspace
2004-02-20 0:29 ` Jeff Sipek
2004-02-20 0:34 ` Tim Hockin
@ 2004-02-20 0:52 ` Chris Wright
1 sibling, 0 replies; 8+ messages in thread
From: Chris Wright @ 2004-02-20 0:52 UTC (permalink / raw)
To: Jeff Sipek; +Cc: Jamie Lokier, thockin, Linux Kernel mailing list
* Jeff Sipek (jeffpc@optonline.net) wrote:
> If I understand the original post correctly, the numbers that we don't make
> available to userspace are compile time constants. For example, since I can't
> think of anything better, NR_CPUS. It is set during the config process, but
> one cannot read the number from userspace while running that kernel. I know
> that there are better examples, but I just can't think of any at the moment.
like /proc/sys/kernel/version? ;-)
later,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-02-20 0:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-19 20:48 sysconf - exposing constants to userspace Tim Hockin
2004-02-19 21:30 ` Jeff Sipek
2004-02-20 0:20 ` Jamie Lokier
2004-02-20 0:21 ` Tim Hockin
2004-02-20 0:35 ` Chris Wright
2004-02-20 0:29 ` Jeff Sipek
2004-02-20 0:34 ` Tim Hockin
2004-02-20 0:52 ` Chris Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox