* configure.ac: Check for LO_FLAGS_AUTOCLEAR and LO_FLAGS_PARTSCAN
declarations.
* loop.c (loop_flags_options): Use LO_FLAGS_AUTOCLEAR and
LO_FLAGS_PARTSCAN only when appropriate declarations are available.
(loop_ioctl): Use LOOP_SET_CAPACITY only when it is defined.
PTRACE_SETOPTIONS
]),,, [#include <sys/ptrace.h>])
+AC_CHECK_DECLS(m4_normalize([
+ LO_FLAGS_AUTOCLEAR,
+ LO_FLAGS_PARTSCAN
+]),,, [#include <linux/loop.h>])
+
AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <stdlib.h>
static const struct xlat loop_flags_options[] = {
{ LO_FLAGS_READ_ONLY, "LO_FLAGS_READ_ONLY" },
+#if HAVE_DECL_LO_FLAGS_AUTOCLEAR
{ LO_FLAGS_AUTOCLEAR, "LO_FLAGS_AUTOCLEAR" },
-#ifdef LO_FLAGS_PARTSCAN
+#endif
+#if HAVE_DECL_LO_FLAGS_PARTSCAN
{ LO_FLAGS_PARTSCAN, "LO_FLAGS_PARTSCAN" },
#endif
{ 0, NULL },
return 1;
case LOOP_CLR_FD:
+#ifdef LOOP_SET_CAPACITY
case LOOP_SET_CAPACITY:
+#endif
#ifdef LOOP_CTL_GET_FREE
/* newer loop-control stuff */
case LOOP_CTL_GET_FREE: