Some older systems (such as RHEL6) lack SEEK_HOLE and SEEK_DATA
which virFileInData relies on. Provide a stub for these systems.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
[], [], [[#include <linux/ethtool.h>
]])
+AC_CHECK_DECLS([SEEK_HOLE], [], [],
+ [#include <sys/types.h>
+ #include <unistd.h>])
+
+
dnl Our only use of libtasn1.h is in the testsuite, and can be skipped
dnl if the header is not present. Assume -ltasn1 is present if the
dnl header could be found.
}
+#if HAVE_DECL_SEEK_HOLE
/**
* virFileInData:
* @fd: file to check
return ret;
}
+#else /* !HAVE_DECL_SEEK_HOLE */
+
+int
+virFileInData(int fd ATTRIBUTE_UNUSED,
+ int *inData ATTRIBUTE_UNUSED,
+ long long *length ATTRIBUTE_UNUSED)
+{
+ errno = ENOSYS;
+ virReportSystemError(errno, "%s",
+ _("sparse files not supported"));
+ return -1;
+}
+
+#endif /* !HAVE_DECL_SEEK_HOLE */
+
/**
* virFileReadValueInt: