From 02d6072dfb775f84e58aca210e59bba654932e14 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 5 Apr 2017 22:26:06 +0200 Subject: [PATCH 1/2] configure: relax the liblzma check a bit Ubuntu 16.04 LTS ships 5.1.0a which works fine, so let's downgrade the minimal version. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7311c120741fd..d26d9322f49f3 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AM_PATH_LIBGCRYPT([1.4.5],, AC_MSG_ERROR([*** libgcrypt was not found.])) AC_SUBST([LIBGCRYPT_CFLAGS]) AC_SUBST([LIBGCRYPT_LIBS]) -PKG_CHECK_MODULES(LIBLZMA, [liblzma >= 5.2.2], +PKG_CHECK_MODULES(LIBLZMA, [liblzma >= 5.1.0], [], [AC_MSG_ERROR([*** lzma library not found])]) PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.32.0], From 72391e782a3aeb2726d3c5bbbfc61adf949baed4 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Fri, 19 May 2017 23:55:36 +0200 Subject: [PATCH 2/2] Provide definitions for struct file_clone_range and FICLONERANGE These are not available in the header files shipped with Ubuntu 16.04, so let's do the missing.h dance. --- configure.ac | 5 +++++ src/util.h | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index d26d9322f49f3..d407ad870ff72 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,11 @@ AC_CHECK_DECLS([ #include ]]) +AC_CHECK_TYPES([struct file_clone_range], + [], [], [[ +#include +]]) + AC_CHECK_SIZEOF(uid_t) AC_CHECK_SIZEOF(gid_t) AC_CHECK_SIZEOF(pid_t) diff --git a/src/util.h b/src/util.h index 988cb4f546ead..a95db43791b8e 100644 --- a/src/util.h +++ b/src/util.h @@ -14,6 +14,7 @@ #include #include +#include #define new(t, n) ((t*) malloc((n) * sizeof(t))) #define new0(t, n) ((t*) calloc((n), sizeof(t))) @@ -550,6 +551,19 @@ static inline const char *yes_no(bool b) { #define CGROUP2_SUPER_MAGIC 0x63677270 #endif +#ifndef FICLONERANGE +#define FICLONERANGE _IOW(0x94, 13, struct file_clone_range) +#endif + +#ifndef HAVE_STRUCT_FILE_CLONE_RANGE +struct file_clone_range { + __s64 src_fd; + __u64 src_offset; + __u64 src_length; + __u64 dest_offset; +}; +#endif + #define PTR_TO_INT(p) ((int) ((intptr_t) (p))) #define INT_TO_PTR(u) ((void *) ((intptr_t) (u))) #define PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p)))