Skip to content

Commit

Permalink
Merge pull request #12 from zonque/ubuntu
Browse files Browse the repository at this point in the history
Ubuntu
  • Loading branch information
poettering committed May 22, 2017
2 parents 2d38d58 + 72391e7 commit 08e753a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion configure.ac
Expand Up @@ -34,6 +34,11 @@ AC_CHECK_DECLS([
#include <linux/random.h>
]])

AC_CHECK_TYPES([struct file_clone_range],
[], [], [[
#include <linux/fs.h>
]])

AC_CHECK_SIZEOF(uid_t)
AC_CHECK_SIZEOF(gid_t)
AC_CHECK_SIZEOF(pid_t)
Expand All @@ -42,7 +47,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],
Expand Down
14 changes: 14 additions & 0 deletions src/util.h
Expand Up @@ -14,6 +14,7 @@
#include <unistd.h>

#include <linux/magic.h>
#include <linux/types.h>

#define new(t, n) ((t*) malloc((n) * sizeof(t)))
#define new0(t, n) ((t*) calloc((n), sizeof(t)))
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 08e753a

Please sign in to comment.