Added a new sysctl () interface to the Linux Kernel.
1999-03-21 Martin Baulig <martin@home-of-linux.org> Added a new sysctl () interface to the Linux Kernel. * kernel/sysctl: Imported. * libgtop-sysdeps.m4: If `--enable-hacker-mode' is given, check for my new sysctl () interface.
This commit is contained in:
committed by
Martin Baulig
parent
4a0344182f
commit
d2e3577784
@@ -1,3 +1,12 @@
|
|||||||
|
1999-03-21 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
Added a new sysctl () interface to the Linux Kernel.
|
||||||
|
|
||||||
|
* kernel/sysctl: Imported.
|
||||||
|
|
||||||
|
* libgtop-sysdeps.m4: If `--enable-hacker-mode' is given, check
|
||||||
|
for my new sysctl () interface.
|
||||||
|
|
||||||
1999-03-20 Martin Baulig <martin@home-of-linux.org>
|
1999-03-20 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
Removed all traces of my old table () Linux kernel hack.
|
Removed all traces of my old table () Linux kernel hack.
|
||||||
|
@@ -138,7 +138,7 @@
|
|||||||
|
|
||||||
#undef NEED_LIBGTOP
|
#undef NEED_LIBGTOP
|
||||||
|
|
||||||
#undef HAVE_LINUX_TABLE
|
#undef HAVE_LINUX_SYSCTL
|
||||||
#undef HAVE_LIBGTOP_SMP
|
#undef HAVE_LIBGTOP_SMP
|
||||||
|
|
||||||
#undef HAVE_XAUTH
|
#undef HAVE_XAUTH
|
||||||
|
@@ -15,6 +15,44 @@ AC_DEFUN([LIBGTOP_HACKER_TESTS],[
|
|||||||
|
|
||||||
case "$host_os" in
|
case "$host_os" in
|
||||||
linux*)
|
linux*)
|
||||||
|
AC_ARG_WITH(linux-sysctl,
|
||||||
|
[ --with-linux-sysctl Use the sysctl () interface from Martin Baulig],[
|
||||||
|
linux_sysctl="$withval"],[linux_sysctl=auto])
|
||||||
|
if test $linux_sysctl = yes ; then
|
||||||
|
AC_CHECK_HEADER(linux/libgtop.h, linux_sysctl=yes, linux_sysctl=no)
|
||||||
|
elif test $linux_sysctl = auto ; then
|
||||||
|
AC_MSG_CHECKING(for LibGTop sysctl support in Linux Kernel)
|
||||||
|
AC_TRY_RUN([
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
#include <linux/libgtop.h>
|
||||||
|
|
||||||
|
#define SIZE(x) sizeof(x)/sizeof(x[0])
|
||||||
|
|
||||||
|
int name[2] = { CTL_LIBGTOP, LIBGTOP_VERSION };
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
unsigned version;
|
||||||
|
size_t size = sizeof (version);
|
||||||
|
|
||||||
|
if (sysctl (name, SIZE (name), &version, &size, NULL, 0))
|
||||||
|
exit (1);
|
||||||
|
else if (version < 1)
|
||||||
|
exit (2);
|
||||||
|
else
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
], linux_sysctl=yes, linux_sysctl=no, linux_sysctl=no)
|
||||||
|
AC_MSG_RESULT($linux_sysctl)
|
||||||
|
fi
|
||||||
|
if test $linux_sysctl = yes ; then
|
||||||
|
AC_DEFINE(HAVE_LINUX_SYSCTL)
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(LINUX_SYSCTL, test $linux_sysctl = yes)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
])
|
])
|
||||||
@@ -69,8 +107,13 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
|
|||||||
|
|
||||||
case "$host_os" in
|
case "$host_os" in
|
||||||
linux*)
|
linux*)
|
||||||
|
if test x$linux_sysctl = xyes ; then
|
||||||
|
libgtop_sysdeps_dir=kernel
|
||||||
|
libgtop_use_machine_h=no
|
||||||
|
else
|
||||||
libgtop_sysdeps_dir=linux
|
libgtop_sysdeps_dir=linux
|
||||||
libgtop_use_machine_h=no
|
libgtop_use_machine_h=no
|
||||||
|
fi
|
||||||
libgtop_have_sysinfo=yes
|
libgtop_have_sysinfo=yes
|
||||||
libgtop_need_server=no
|
libgtop_need_server=no
|
||||||
;;
|
;;
|
||||||
|
Reference in New Issue
Block a user