LWN.net Logo

Re-deprecating sysctl()

Re-deprecating sysctl()

Posted Aug 30, 2007 9:41 UTC (Thu) by addw (guest, #1771)
Parent article: Re-deprecating sysctl()

<blockquote>we shall see whether three years is sufficient warning for such a change or not.</blockquote><p>
Probably not. Someone putting in a new machine today will, reasonably, expect it to work for the lifetime of the hardware - say 7 years.
<p>
What ought to be done is for the kernel to log that sysctl() has been used and by what program. This will allow the identification of programs that will break when sysctl() is eventually killed.


(Log in to post comments)

Re-deprecating sysctl()

Posted Aug 30, 2007 10:10 UTC (Thu) by nix (subscriber, #2304) [Link]

Every program will emit this log message: glibc calls sysctl() at startup.

Re-deprecating sysctl()

Posted Aug 30, 2007 15:45 UTC (Thu) by jzbiciak (✭ supporter ✭, #5246) [Link]

Indeed, from an strace of ls:

    _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbfffe41c, 31, (nil), 0}) = 0

Seems like it'd be easy to filter out *that* specific use (getting the kernel version number), and report all the other uses. This also argues that the kernel will probably need to support this specific sysctl even if it deprecates and ultimately removes other sysctl support. After all, we have statically linked binaries out there.

Re-deprecating sysctl()

Posted Aug 30, 2007 20:01 UTC (Thu) by ebiederm (subscriber, #35028) [Link]

And that is what I implemented in my patch.

A printk that logs when you use it and with which program and that
filters out the glibc usage.

Not that the glibc usage is a big deal because it is just a check for
non-SMP to optimize pthreads so any value gives you correctly running
code.

Eric

Re-deprecating sysctl()

Posted Aug 30, 2007 17:49 UTC (Thu) by jwb (guest, #15467) [Link]

Changes in the upstream kernel do not break existing installations. If you don't want your software to change, don't install a new kernel.

Re-deprecating sysctl()

Posted Aug 30, 2007 18:14 UTC (Thu) by bronson (subscriber, #4806) [Link]

In other words, it's a Linux 3.0 change?

Re-deprecating sysctl()

Posted Aug 30, 2007 23:47 UTC (Thu) by nix (subscriber, #2304) [Link]

Current Linux still runs a lot of statically linked programs dating from
1992, modulo occasional a.out-related breakage. I don't see why that
should ever change (perhaps because a.out support finally gets dumped: I'm
not sure how useful it is to be able to run programs which predate Windows
3.1...)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds