patches/strace/4.5.16/550-strace-undef-syscall.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/linux/syscallent.h strace-4.5.16/linux/syscallent.h
yann@428
     2
--- strace-4.5.16.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
yann@428
     3
+++ strace-4.5.16/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
yann@428
     4
@@ -130,7 +130,11 @@
yann@428
     5
 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
yann@428
     6
 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
yann@428
     7
 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
yann@428
     8
-	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
yann@428
     9
+	{ 2,	TD,	sys_socketcall,		"socketcall"
yann@428
    10
+#ifdef __NR_socketcall
yann@428
    11
+	    , SYS_socketcall
yann@428
    12
+#endif
yann@428
    13
+								}, /* 102 */
yann@428
    14
 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
yann@428
    15
 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
yann@428
    16
 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
yann@428
    17
@@ -145,7 +149,11 @@
yann@428
    18
 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
yann@428
    19
 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
yann@428
    20
 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
yann@428
    21
-	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
yann@428
    22
+	{ 6,	0,	sys_ipc,		"ipc"
yann@428
    23
+#ifdef __NR_ipc
yann@428
    24
+	    , SYS_ipc
yann@428
    25
+#endif
yann@428
    26
+								}, /* 117 */
yann@428
    27
 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
yann@428
    28
 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
yann@428
    29
 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
yann@428
    30
@@ -282,7 +290,11 @@
yann@428
    31
 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
yann@428
    32
 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
yann@428
    33
 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
yann@428
    34
-	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
yann@428
    35
+	{ 1,	TP,	sys_exit,		"exit_group"
yann@428
    36
+#ifdef __NR_exit_group
yann@428
    37
+	    , __NR_exit_group
yann@428
    38
+#endif
yann@428
    39
+								}, /* 252 */
yann@428
    40
 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
yann@428
    41
 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
yann@428
    42
 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
yann@428
    43
diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
yann@428
    44
--- strace-4.5.16.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
yann@428
    45
+++ strace-4.5.16/syscall.c	2007-07-14 19:30:16.000000000 +0200
yann@428
    46
@@ -2383,14 +2383,18 @@
yann@428
    47
 	switch (known_scno(tcp)) {
yann@428
    48
 #ifdef LINUX
yann@428
    49
 #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
yann@428
    50
+#ifdef __NR_socketcall
yann@428
    51
 	case SYS_socketcall:
yann@428
    52
 		decode_subcall(tcp, SYS_socket_subcall,
yann@428
    53
 			SYS_socket_nsubcalls, deref_style);
yann@428
    54
 		break;
yann@428
    55
+#endif
yann@428
    56
+#ifdef __NR_ipc
yann@428
    57
 	case SYS_ipc:
yann@428
    58
 		decode_subcall(tcp, SYS_ipc_subcall,
yann@428
    59
 			SYS_ipc_nsubcalls, shift_style);
yann@428
    60
 		break;
yann@428
    61
+#endif
yann@428
    62
 #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
yann@428
    63
 #if defined (SPARC) || defined (SPARC64)
yann@428
    64
 	case SYS_socketcall: