mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-27 03:54:19 +08:00
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>
This commit is contained in:
parent
3fb16e7424
commit
35b67cab5c
2
configure
vendored
2
configure
vendored
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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! */
|
||||
@ -885,12 +881,6 @@ unsigned long long get_memory_size(void)
|
||||
unsigned long long size = 0;
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user