swap.configure

来自「Util-linux 软件包包含许多工具。其中比较重要的是加载、卸载、格式化、分」· CONFIGURE 代码 · 共 37 行

CONFIGURE
37
字号
# Find out whether we can include <sys/swap.h># and whether libc thinks that swapon() has two arguments.# Prepare testCC=${CC-cc}compile="$CC -o conftest conftest.c >/dev/null 2>&1"rm -f conftest conftest.c swapargs.h# What include files shall we try?# Unfortunately, recent versions of swap.h use PAGE_SIZE and hence need page.h# It is used only in mkswap, not in swapon/swapoff, so we might just pick any# random value (like #define PAGE_SIZE 4096) instead of including page.h.SWAPH=PAGEH=if [ -f /usr/include/sys/swap.h ]; then	SWAPH="#include <sys/swap.h>"	if [ -f /usr/include/asm/page.h ]; then		PAGEH="#include <asm/page.h>"	fifiecho $PAGEH > conftest.cecho $SWAPH >> conftest.cecho '#include <unistd.h>main(){ exit(0); swapon("/dev/null", 0); }' >> conftest.ceval $compileif test -s conftest && ./conftest 2>/dev/null; then	echo "#define SWAPON_HAS_TWO_ARGS" > swapargs.h	echo $PAGEH >> swapargs.h	echo $SWAPH >> swapargs.helse	echo > swapargs.h	echo "Your libc thinks that swapon has 1 arg only." 1>&2firm -f conftest conftest.c

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?