patches/strace/4.5.19/130-statfs64-check.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Oct 08 23:37:12 2010 +0200 (2010-10-08)
branch1.8
changeset 2150 f97a8ad2b172
permissions -rw-r--r--
cc/gcc: fix C++ headers location

In case we build the C++ compiler, we have to tell gcc where to put the C++
headers, or else it will try to # put it in prefix/tuple/include, which we
make a symlink to sysroot/usr/include during the build, and that we delete
(the symlink!) after the build, but gcc will not look in sysroot/usr/inlcude
for C++ headers by default.

Implements a fix suggested by: Bryan Hundven <bryanhundven@gmail.com>

Reported-by: Anthony Foiani <anthony.foiani@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from a0924619112015bdaa81a0a2313d21ef38607bc2)
yann@1613
     1
diff -durN strace-4.5.19.orig/acinclude.m4 strace-4.5.19/acinclude.m4
yann@1613
     2
--- strace-4.5.19.orig/acinclude.m4	2004-04-14 04:45:53.000000000 +0200
yann@1613
     3
+++ strace-4.5.19/acinclude.m4	2009-10-28 18:47:18.000000000 +0100
yann@1613
     4
@@ -210,6 +210,26 @@
yann@1613
     5
 fi
yann@1613
     6
 ])
yann@1613
     7
 
yann@1613
     8
+dnl ### A macro to determine whether statfs64 is defined.
yann@1613
     9
+AC_DEFUN([AC_STATFS64],
yann@1613
    10
+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
yann@1613
    11
+AC_CACHE_VAL(ac_cv_type_statfs64,
yann@1613
    12
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
yann@1613
    13
+#include <linux/types.h>
yann@1613
    14
+#include <sys/statfs.h>
yann@1613
    15
+#else
yann@1613
    16
+#include <sys/vfs.h>
yann@1613
    17
+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
yann@1613
    18
+AC_MSG_RESULT($ac_cv_type_statfs64)
yann@1613
    19
+if test "$ac_cv_type_statfs64" = yes
yann@1613
    20
+then
yann@1613
    21
+	AC_DEFINE([HAVE_STATFS64], 1,
yann@1613
    22
+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
yann@1613
    23
+fi
yann@1613
    24
+])
yann@1613
    25
+
yann@1613
    26
+
yann@1613
    27
+
yann@1613
    28
 dnl ### A macro to determine if off_t is a long long
yann@1613
    29
 AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
yann@1613
    30
 [AC_MSG_CHECKING(for long long off_t)
yann@1613
    31
diff -durN strace-4.5.19.orig/configure.ac strace-4.5.19/configure.ac
yann@1613
    32
--- strace-4.5.19.orig/configure.ac	2009-10-12 21:54:43.000000000 +0200
yann@1613
    33
+++ strace-4.5.19/configure.ac	2009-10-28 18:47:18.000000000 +0100
yann@1613
    34
@@ -187,6 +187,7 @@
yann@1613
    35
 		  struct stat.st_level,
yann@1613
    36
 		  struct stat.st_rdev])
yann@1613
    37
 AC_STAT64
yann@1613
    38
+AC_STATFS64
yann@1613
    39
 
yann@1613
    40
 AC_TYPE_SIGNAL
yann@1613
    41
 AC_TYPE_UID_T
yann@1613
    42
diff -durN strace-4.5.19.orig/file.c strace-4.5.19/file.c
yann@1613
    43
--- strace-4.5.19.orig/file.c	2009-10-21 15:44:04.000000000 +0200
yann@1613
    44
+++ strace-4.5.19/file.c	2009-10-28 18:47:18.000000000 +0100
yann@1613
    45
@@ -1688,7 +1688,7 @@
yann@1613
    46
 	return 0;
yann@1613
    47
 }
yann@1613
    48
 
yann@1613
    49
-#ifdef LINUX
yann@1613
    50
+#ifdef HAVE_STATFS64
yann@1613
    51
 static void
yann@1613
    52
 printstatfs64(struct tcb *tcp, long addr)
yann@1613
    53
 {