summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2011-08-16 21:36:16 +0000
committerDenys Vlasenko <dvlasenk@redhat.com>2011-08-23 12:53:00 +0200
commit25caa318eedf38200cd7660320d95bf4662c6c5b (patch)
treec7bcc4d59ef1fa6a0dd492d54419db05498384ea
parent44f87efc676467ab47972feec49af4f7f34356bf (diff)
downloadstrace-25caa318eedf38200cd7660320d95bf4662c6c5b.tar.gz
Fix compilation on linux 2.4.x
* configure.ac: Check for BLKGETSIZE64. * block.c (block_ioctl): Check for HAVE_BLKGETSIZE64.
-rw-r--r--block.c2
-rw-r--r--configure.ac9
2 files changed, 10 insertions, 1 deletions
diff --git a/block.c b/block.c
index 4a3b42890..14453a42d 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 6b88df879..0a4f8916a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -323,6 +323,15 @@ AC_CHECK_DECLS([
PTRACE_EVENT_VFORK_DONE,
PTRACE_EVENT_EXIT],,, [#include <sys/ptrace.h>])
+AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <stdlib.h>
+#include <linux/fs.h>], [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])