Fix compilation on linux 2.4.x

* configure.ac: Check for BLKGETSIZE64.
* block.c (block_ioctl): Check for HAVE_BLKGETSIZE64.
This commit is contained in:
Дмитрий Левин 2011-08-16 21:36:16 +00:00 committed by Denys Vlasenko
parent 44f87efc67
commit 25caa318ee
2 changed files with 10 additions and 1 deletions

View File

@ -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)) {

View File

@ -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])