build-sys: don't check for swapon() number of arguments
The syscall swapon() with two arguments is supported since Linux 1.3.2 and it's really long time ago... Let's assume that all libc header files have been already fixed. Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
10211619dc
commit
cf9b16f1d4
18
configure.ac
18
configure.ac
|
@ -343,20 +343,6 @@ AC_CHECK_MEMBERS([struct termios.c_line],,,
|
||||||
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
|
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
|
||||||
[#include <sys/stat.h>])
|
[#include <sys/stat.h>])
|
||||||
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
||||||
[[
|
|
||||||
#ifdef HAVE_SYS_SWAP_H
|
|
||||||
# include <sys/swap.h>
|
|
||||||
#endif
|
|
||||||
#include <unistd.h>
|
|
||||||
]],
|
|
||||||
[[swapon("/dev/null", 0);]])],
|
|
||||||
[AC_DEFINE([SWAPON_HAS_TWO_ARGS], [1], [Is swapon() declared with two parameters?])
|
|
||||||
],
|
|
||||||
[AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
|
AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
|
||||||
|
|
||||||
AC_CHECK_DECL([llseek],
|
AC_CHECK_DECL([llseek],
|
||||||
|
@ -1431,10 +1417,14 @@ AM_CONDITIONAL([BUILD_FSTRIM], [test "x$build_fstrim" = xyes])
|
||||||
|
|
||||||
UL_BUILD_INIT([swapon], [check])
|
UL_BUILD_INIT([swapon], [check])
|
||||||
UL_REQUIRES_LINUX([swapon])
|
UL_REQUIRES_LINUX([swapon])
|
||||||
|
UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapon])], [swapon])
|
||||||
|
UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapoff])], [swapoff])
|
||||||
UL_REQUIRES_BUILD([swapon], [libblkid])
|
UL_REQUIRES_BUILD([swapon], [libblkid])
|
||||||
UL_REQUIRES_BUILD([swapon], [libmount])
|
UL_REQUIRES_BUILD([swapon], [libmount])
|
||||||
UL_REQUIRES_BUILD([swapon], [libsmartcols])
|
UL_REQUIRES_BUILD([swapon], [libsmartcols])
|
||||||
AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes])
|
AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes])
|
||||||
|
AC_CHECK_FUNCS([swapon])
|
||||||
|
AC_CHECK_FUNCS([swapoff])
|
||||||
|
|
||||||
|
|
||||||
UL_BUILD_INIT([lsblk], [check])
|
UL_BUILD_INIT([lsblk], [check])
|
||||||
|
|
|
@ -14,8 +14,7 @@
|
||||||
#include "swapprober.h"
|
#include "swapprober.h"
|
||||||
#include "swapon-common.h"
|
#include "swapon-common.h"
|
||||||
|
|
||||||
#ifndef SWAPON_HAS_TWO_ARGS
|
#if !defined(HAVE_SWAPOFF) && defined(SYS_swapoff)
|
||||||
/* libc is insane, let's call the kernel */
|
|
||||||
# include <sys/syscall.h>
|
# include <sys/syscall.h>
|
||||||
# define swapoff(path) syscall(SYS_swapoff, path)
|
# define swapoff(path) syscall(SYS_swapoff, path)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -59,8 +59,7 @@
|
||||||
# define SWAP_FLAG_PRIO_SHIFT 0
|
# define SWAP_FLAG_PRIO_SHIFT 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SWAPON_HAS_TWO_ARGS
|
#if !defined(HAVE_SWAPON) && defined(SYS_swapon)
|
||||||
/* libc is insane, let's call the kernel */
|
|
||||||
# include <sys/syscall.h>
|
# include <sys/syscall.h>
|
||||||
# define swapon(path, flags) syscall(SYS_swapon, path, flags)
|
# define swapon(path, flags) syscall(SYS_swapon, path, flags)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue