patches/strace/4.5.17/160-undef-syscall.patch
author Johannes Stezenbach <js@sig21.net>
Tue Oct 30 00:22:25 2012 +0000 (2012-10-30)
changeset 3097 5c67476c7342
parent 747 d3e603e7c17c
permissions -rw-r--r--
scripts/functions: fix endless loop in debug-shell with IO redirection

CT_DEBUG_INTERACTIVE is disabled when stdin, stdout or
stderr are redirected, but the check is only done at
the start of the build and doesn't catch when individual
build commands use redirection. When stdin is redirected
it will cause the debug shell to exit immediately, causing
and endless loop. Thus, save the stdin/our/err file handles
and restore them before invoking the debug shell.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Message-Id: <20121030102225.GA8303@sig21.net>
Patchwork-Id: 195409
     1 Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/160-undef-syscall.patch
     2 -= BEGIN original header =-
     3 diff -dur strace-4.5.16.orig/linux/syscallent.h strace-4.5.16/linux/syscallent.h
     4 -= END original header =-
     5 diff -durN strace-4.5.17.orig/linux/syscallent.h strace-4.5.17/linux/syscallent.h
     6 --- strace-4.5.17.orig/linux/syscallent.h	2008-07-18 03:23:49.000000000 +0200
     7 +++ strace-4.5.17/linux/syscallent.h	2008-10-24 21:30:13.000000000 +0200
     8 @@ -130,7 +130,11 @@
     9  	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
    10  	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
    11  	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
    12 -	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
    13 +	{ 2,	TD,	sys_socketcall,		"socketcall"
    14 +#ifdef __NR_socketcall
    15 +	    , SYS_socketcall
    16 +#endif
    17 +								}, /* 102 */
    18  	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
    19  	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
    20  	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
    21 @@ -145,7 +149,11 @@
    22  	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
    23  	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
    24  	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
    25 -	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
    26 +	{ 6,	0,	sys_ipc,		"ipc"
    27 +#ifdef __NR_ipc
    28 +	    , SYS_ipc
    29 +#endif
    30 +								}, /* 117 */
    31  	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
    32  	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
    33  	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
    34 @@ -282,7 +290,11 @@
    35  	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
    36  	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
    37  	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
    38 -	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
    39 +	{ 1,	TP,	sys_exit,		"exit_group"
    40 +#ifdef __NR_exit_group
    41 +	    , __NR_exit_group
    42 +#endif
    43 +								}, /* 252 */
    44  	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
    45  	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
    46  	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
    47 diff -durN strace-4.5.17.orig/syscall.c strace-4.5.17/syscall.c
    48 --- strace-4.5.17.orig/syscall.c	2008-10-24 21:30:13.000000000 +0200
    49 +++ strace-4.5.17/syscall.c	2008-10-24 21:30:13.000000000 +0200
    50 @@ -2452,14 +2452,18 @@
    51  	switch (known_scno(tcp)) {
    52  #ifdef LINUX
    53  #if !defined (ALPHA) && !defined(MIPS) && !defined(HPPA)
    54 +#ifdef __NR_socketcall
    55  	case SYS_socketcall:
    56  		decode_subcall(tcp, SYS_socket_subcall,
    57  			SYS_socket_nsubcalls, deref_style);
    58  		break;
    59 +#endif
    60 +#ifdef __NR_ipc
    61  	case SYS_ipc:
    62  		decode_subcall(tcp, SYS_ipc_subcall,
    63  			SYS_ipc_nsubcalls, shift_style);
    64  		break;
    65 +#endif
    66  #endif /* !(ALPHA || MIPS || HPPA) */
    67  #endif /* LINUX */
    68  #ifdef SVR4