From 25caa318eedf38200cd7660320d95bf4662c6c5b Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 16 Aug 2011 21:36:16 +0000 Subject: [PATCH] Fix compilation on linux 2.4.x * configure.ac: Check for BLKGETSIZE64. * block.c (block_ioctl): Check for HAVE_BLKGETSIZE64. --- block.c | 2 +- configure.ac | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 4a3b4289..14453a42 100644 --- a/block.c +++ b/block.c @@ -194,7 +194,7 @@ block_ioctl(struct tcb *tcp, long code, long arg) } break; -#ifdef BLKGETSIZE64 +#ifdef HAVE_BLKGETSIZE64 /* return an uint64_t */ case BLKGETSIZE64: if (exiting(tcp)) { diff --git a/configure.ac b/configure.ac index 6b88df87..0a4f8916 100644 --- a/configure.ac +++ b/configure.ac @@ -323,6 +323,15 @@ AC_CHECK_DECLS([ PTRACE_EVENT_VFORK_DONE, PTRACE_EVENT_EXIT],,, [#include ]) +AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +#include +#include ], [return !BLKGETSIZE64;])], + [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])] + if test $ac_cv_have_blkgetsize64 = yes; then + AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.]) + fi) + AC_PATH_PROG([PERL], [perl]) AC_CONFIG_FILES([Makefile tests/Makefile])