generic: Add test to check for mounting a huge sparse dm device
[xfstests-dev.git] / acinclude.m4
1 dnl Copyright (C) 2016 Free Software Foundation, Inc.
2 dnl This file is free software; the Free Software Foundation
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
5 AC_DEFUN([AC_PACKAGE_WANT_LINUX_FIEMAP_H],
6   [ AC_CHECK_HEADERS([linux/fiemap.h], [ have_fiemap=true ], [ have_fiemap=false ])
7     AC_SUBST(have_fiemap)
8   ])
9
10 AC_DEFUN([AC_PACKAGE_WANT_LINUX_PRCTL_H],
11   [ AC_CHECK_HEADERS([sys/prctl.h], [ have_prctl=true ], [ have_prctl=false ])
12     AC_SUBST(have_prctl)
13   ])
14
15 AC_DEFUN([AC_PACKAGE_WANT_LINUX_FS_H],
16   [ AC_CHECK_HEADER([linux/fs.h])
17   ])
18
19 AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
20   [ AC_MSG_CHECKING([for fallocate])
21     AC_TRY_LINK([
22 #define _GNU_SOURCE
23 #define _FILE_OFFSET_BITS 64
24 #include <fcntl.h>
25 #include <linux/falloc.h> ],
26       [ fallocate(0, 0, 0, 0); ],
27       [ have_fallocate=true; AC_MSG_RESULT(yes) ],
28       [ have_fallocate=false; AC_MSG_RESULT(no) ])
29     AC_SUBST(have_fallocate)
30   ])
31
32 AC_DEFUN([AC_PACKAGE_WANT_OPEN_BY_HANDLE_AT],
33   [ AC_MSG_CHECKING([for open_by_handle_at])
34     AC_TRY_LINK([
35 #define _GNU_SOURCE
36 #include <fcntl.h>
37       ],
38       [
39           struct file_handle fh;
40           open_by_handle_at(0, &fh, 0);
41       ],
42       [ have_open_by_handle_at=true; AC_MSG_RESULT(yes) ],
43       [ have_open_by_handle_at=false; AC_MSG_RESULT(no) ])
44     AC_SUBST(have_open_by_handle_at)
45   ])