Re: kernel features MIB



Sounds pretty rad.

* John Baldwin <jhb@xxxxxxxxxxx> [071227 15:20] wrote:
One of the things we have at work is a kern.features sysctl MIB that contains
nodes to indicate if a named feature is present. For example, on i386 we
have kern.features.pae and we auto enable -DPAE for kernel modules if the
currently running kernel is using PAE using that sysctl.

One of the patches I want to commit soon is support for handling
shm_open/shm_unlink directly in the kernel via swap-backed VM objects (the
long-heralded memfd stuff). I would like to have the sysctl MIB so that
libc's for older releases (e.g. libc.so.6) could use the syscalls if they are
available so that shm segments are shared between compat apps (e.g. 4.x or
6.x) and up-to-date apps.

At work we don't have a pretty API for this at all, but I'm thinking for
FreeBSD we can do this:

FEATURE(foo, "description of foo")

which is a macro to create the 'kern.features.foo' node and set it to 1. Then
we could have a routine in libc:

int feature_present(const char *name);

That returns a boolean to indicate if a given feature is present or not by
invoking sysctlbyname(3), etc.

Any objections to the idea?

--
John Baldwin
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"

--
- Alfred Perlstein
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • kernel features MIB
    ... One of the things we have at work is a kern.features sysctl MIB that contains ... nodes to indicate if a named feature is present. ... have kern.features.pae and we auto enable -DPAE for kernel modules if the ... available so that shm segments are shared between compat apps (e.g. 4.x or ...
    (freebsd-arch)
  • Re: kernel features MIB
    ... have kern.features.pae and we auto enable -DPAE for kernel modules if the ... I would like to have the sysctl MIB so that ... available so that shm segments are shared between compat apps (e.g. 4.x or ... That returns a boolean to indicate if a given feature is present or not by ...
    (freebsd-arch)
  • Re: kernel features MIB
    ... nodes to indicate if a named feature is present. ... on i386 we have kern.features.pae and we auto enable -DPAE for kernel modules if the currently running kernel is using PAE using that sysctl. ... I would like to have the sysctl MIB so that libc's for older releases could use the syscalls if they are available so that shm segments are shared between compat apps and up-to-date apps. ...
    (freebsd-arch)