From 35b67cab5c3ea4b7f32a6f516f058fe944aa9f4e Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 29 Jan 2021 01:03:36 -0500 Subject: [PATCH] e2fsck: drop use of sysctl(2) Remove the use of the binary interface using the sysctl(2) system call since sys/sysctl.h has been deprecated. We can find the total memory available in the system using the POSIX standard sysconf(2) interface. Signed-off-by: Theodore Ts'o --- configure | 2 +- configure.ac | 1 - e2fsck/util.c | 10 ---------- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/configure b/configure index ade0ee1..9d41d06 100755 --- a/configure +++ b/configure @@ -10448,7 +10448,7 @@ fi done fi -for ac_header in dirent.h errno.h execinfo.h getopt.h malloc.h mntent.h paths.h semaphore.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h termio.h unistd.h utime.h attr/xattr.h linux/falloc.h linux/fd.h linux/fsmap.h linux/major.h linux/loop.h linux/types.h net/if_dl.h netinet/in.h sys/acl.h sys/disklabel.h sys/disk.h sys/file.h sys/ioctl.h sys/key.h sys/mkdev.h sys/mman.h sys/mount.h sys/prctl.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysctl.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h sys/xattr.h +for ac_header in dirent.h errno.h execinfo.h getopt.h malloc.h mntent.h paths.h semaphore.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h termio.h unistd.h utime.h attr/xattr.h linux/falloc.h linux/fd.h linux/fsmap.h linux/major.h linux/loop.h linux/types.h net/if_dl.h netinet/in.h sys/acl.h sys/disklabel.h sys/disk.h sys/file.h sys/ioctl.h sys/key.h sys/mkdev.h sys/mman.h sys/mount.h sys/prctl.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h sys/xattr.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/configure.ac b/configure.ac index 3e93c30..141c4d9 100644 --- a/configure.ac +++ b/configure.ac @@ -1010,7 +1010,6 @@ AC_CHECK_HEADERS(m4_flatten([ sys/sockio.h sys/stat.h sys/syscall.h - sys/sysctl.h sys/sysmacros.h sys/time.h sys/types.h diff --git a/e2fsck/util.c b/e2fsck/util.c index e0623e4..0a7cafe 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -37,10 +37,6 @@ #include #endif -#ifdef HAVE_SYS_SYSCTL_H -#include -#endif - #include "e2fsck.h" extern e2fsck_t e2fsck_global_ctx; /* Try your very best not to use this! */ @@ -886,12 +882,6 @@ unsigned long long get_memory_size(void) # elif defined(CTL_HW_UINT) unsigned int size = 0; # endif -# if defined(CTL_HW_INT64) || defined(CTL_HW_UINT) - size_t len = sizeof(size); - - if (sysctl(mib, 2, &size, &len, NULL, 0) == 0) - return (unsigned long long)size; -# endif return 0; #else # warning "Don't know how to detect memory on your platform?" -- 1.8.3.1