[PATCH] Linux: Remove <sys/sysctl.h> and the sysctl function
Zack Weinberg
zackw@panix.com
Wed Mar 11 20:19:22 GMT 2020
On Wed, Mar 11, 2020 at 2:49 PM Zack Weinberg <zackw@panix.com> wrote:
> On Wed, Mar 11, 2020 at 2:36 PM Florian Weimer <fw@deneb.enyo.de> wrote:
> > > However, I think that glibc should continue to provide sysctl(3) and
> > > should actively work to make it more like the fully-supported
> > > sysctl(3) that the BSDs have. It follows that we should continue to
> > > install <sys/sysctl.h>. It would be reasonable for us to treat
> > > sysctlbyname() as the primary interface and provide compatibility
> > > MIB-to-name mappings only for the set of MIB vectors that were
> > > historically supported by Linux's sysctl(2).
> >
> > I'm sorry, but I strongly disagree with this. Our MIBs were never
> > compatible with the FreeBSD MIBs, resulting in application bugs due to
> > incomplete porting.
>
> To me that's a reason to fix the MIBs to provide source compatibility,
> not a reason to scrap the entire idea. Since the Linux kernel *has*
> abandoned the idea, we are free to rearrange things so that
> applications that expect the FreeBSD MIBs do in fact work.
I looked into this a bit more and concluded that we'd have to do a
whole bunch of research on which MIB vectors would actually be useful
to support. The existing set of constants for Linux (linux/sysctl.h)
is a mess and may no longer have a straightforward correspondence with
the /proc/sys hierarchy, never mind with FreeBSD or other. Also, I
had somehow gotten it into my head that we had part of an emulation on
top of /proc already, but in fact we don't.
So I withdraw my objections to your original patch. We can always put
sys/sysctl.h back in the future if someone does the work to write the
emulation.
zw
More information about the Libc-alpha
mailing list