about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-06-12 14:32:08 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-06-12 14:32:08 +0200
commit744e829637162bb7d5029632aacf341c64b86990 (patch)
treef298a035ddf1000ace1e12b8e854b601885b054c /sysdeps/unix/sysv
parent5dad6ffbb2b76215cfcd38c3001778536ada8e8a (diff)
downloadglibc-744e829637162bb7d5029632aacf341c64b86990.tar.gz
glibc-744e829637162bb7d5029632aacf341c64b86990.tar.xz
glibc-744e829637162bb7d5029632aacf341c64b86990.zip
Linux: Deprecate <sys/sysctl.h> and sysctl
Now that there are no internal users of __sysctl left, it is possible
to add an unconditional deprecation warning to <sys/sysctl.h>.

To avoid a test failure due this warning in check-install-headers,
skip the test for sys/sysctl.h.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/sys/sysctl.h5
-rw-r--r--sysdeps/unix/sysv/linux/sysctl.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/sys/sysctl.h b/sysdeps/unix/sysv/linux/sys/sysctl.h
index 0f6e71ba7e..be34555668 100644
--- a/sysdeps/unix/sysv/linux/sys/sysctl.h
+++ b/sysdeps/unix/sysv/linux/sys/sysctl.h
@@ -18,6 +18,8 @@
 #ifndef	_SYS_SYSCTL_H
 #define	_SYS_SYSCTL_H	1
 
+#warning "The <sys/sysctl.h> header is deprecated and will be removed."
+
 #include <features.h>
 #define __need_size_t
 #include <stddef.h>
@@ -66,7 +68,8 @@ __BEGIN_DECLS
 
 /* Read or write system parameters.  */
 extern int sysctl (int *__name, int __nlen, void *__oldval,
-		   size_t *__oldlenp, void *__newval, size_t __newlen) __THROW;
+		   size_t *__oldlenp, void *__newval, size_t __newlen) __THROW
+  __attribute_deprecated__;
 
 __END_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/sysctl.c b/sysdeps/unix/sysv/linux/sysctl.c
index 33afdd918b..0f18c69abe 100644
--- a/sysdeps/unix/sysv/linux/sysctl.c
+++ b/sysdeps/unix/sysv/linux/sysctl.c
@@ -17,8 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
-#include <string.h>	/* For the real memset prototype.  */
-#include <sys/sysctl.h>
+#include <linux/sysctl.h>
 
 #include <sysdep.h>
 #include <sys/syscall.h>
@@ -39,5 +38,4 @@ __sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
 
   return INLINE_SYSCALL (_sysctl, 1, &args);
 }
-libc_hidden_def (__sysctl)
 weak_alias (__sysctl, sysctl)