patches/strace/4.5.16/350-strace-statfs64-check.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Apr 26 21:31:05 2008 +0000 (2008-04-26)
changeset 454 372b2f397baa
permissions -rw-r--r--
Configure tsocks with a simple heuristic.

Consider the proxy has to be in a 'local' network. It means it is directly
reachable by the local machine, even if the local machine has to hop through
one or more gates to reach the proxy (often the case in enterprise networks
where class A 10.0.0.0/8 is in fact sub-divided into smaller networks, each
one of them in a different location, eg. 10.1.0.0/16 in a place, while
10.2.0.0/16 would be on the other side of the world). Not being in the same
subnet does not mean the proxy is not available.

So we will build a mask with at most high bits set, which defines a network
that has both the local machine and the proxy. Because a machine may have
more than one interface, build a mask for each of them, removing 127.0.0.1
which is added automagically by tsocks, and removing duplicate masks.

If all of this does not work, then it means the local machine can NOT in fact
reach the proxy, which in turn means the user mis-configured something (most
probably a typo...).

/trunk/scripts/crosstool.sh | 61 52 9 0 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 9 deletions(-)
yann@428
     1
diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4
yann@428
     2
--- strace-4.5.16.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
yann@428
     3
+++ strace-4.5.16/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
yann@428
     4
@@ -210,6 +210,26 @@
yann@428
     5
 fi
yann@428
     6
 ])
yann@428
     7
yann@428
     8
+dnl ### A macro to determine whether statfs64 is defined.
yann@428
     9
+AC_DEFUN([AC_STATFS64],
yann@428
    10
+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
yann@428
    11
+AC_CACHE_VAL(ac_cv_type_statfs64,
yann@428
    12
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
yann@428
    13
+#include <linux/types.h>
yann@428
    14
+#include <sys/statfs.h>
yann@428
    15
+#else
yann@428
    16
+#include <sys/vfs.h>
yann@428
    17
+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
yann@428
    18
+AC_MSG_RESULT($ac_cv_type_statfs64)
yann@428
    19
+if test "$ac_cv_type_statfs64" = yes
yann@428
    20
+then
yann@428
    21
+	AC_DEFINE([HAVE_STATFS64], 1,
yann@428
    22
+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
yann@428
    23
+fi
yann@428
    24
+])
yann@428
    25
+
yann@428
    26
+
yann@428
    27
+
yann@428
    28
 dnl ### A macro to determine if off_t is a long long
yann@428
    29
 AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
yann@428
    30
 [AC_MSG_CHECKING(for long long off_t)
yann@428
    31
diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
yann@428
    32
--- strace-4.5.16.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
yann@428
    33
+++ strace-4.5.16/configure.ac	2007-07-14 19:25:25.000000000 +0200
yann@428
    34
@@ -169,6 +169,7 @@
yann@428
    35
 		  struct stat.st_level,
yann@428
    36
 		  struct stat.st_rdev])
yann@428
    37
 AC_STAT64
yann@428
    38
+AC_STATFS64
yann@428
    39
yann@428
    40
 AC_TYPE_SIGNAL
yann@428
    41
 AC_TYPE_UID_T
yann@428
    42
diff -dur strace-4.5.16.orig/file.c strace-4.5.16/file.c
yann@428
    43
--- strace-4.5.16.orig/file.c	2007-01-15 21:25:52.000000000 +0100
yann@428
    44
+++ strace-4.5.16/file.c	2007-07-14 19:25:25.000000000 +0200
yann@428
    45
@@ -1636,7 +1636,7 @@
yann@428
    46
 	return 0;
yann@428
    47
 }
yann@428
    48
yann@428
    49
-#ifdef LINUX
yann@428
    50
+#ifdef HAVE_STATFS64
yann@428
    51
 static void
yann@428
    52
 printstatfs64(tcp, addr)
yann@428
    53
 struct tcb *tcp;