diff options
author | Theodore Ts'o <tytso@mit.edu> | 2021-01-29 01:03:36 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-01-29 01:10:29 -0500 |
commit | 35b67cab5c3ea4b7f32a6f516f058fe944aa9f4e (patch) | |
tree | 40e5a2752f43f6425942c0d192d545bb638a514e | |
parent | 3fb16e742420bf0a5bf9f4e0937b1336245a1011 (diff) | |
download | e2fsprogs-35b67cab5c3ea4b7f32a6f516f058fe944aa9f4e.tar.gz |
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 <tytso@mit.edu>
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | e2fsck/util.c | 10 |
3 files changed, 1 insertions, 12 deletions
@@ -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 3e93c3042..141c4d9c0 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 e0623e4c8..0a7cafe60 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -37,10 +37,6 @@ #include <errno.h> #endif -#ifdef HAVE_SYS_SYSCTL_H -#include <sys/sysctl.h> -#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?" |