2003-06-26 Roland McGrath <roland@redhat.com>

* syscall.c (get_scno) [S390 || S390X]: Fix old vs new mode detection.
	From Michael Holzheu <HOLZHEU@de.ibm.com>.
This commit is contained in:
Roland McGrath 2003-06-26 22:23:28 +00:00
parent ee911635e7
commit 2f924cafae

View File

@ -734,14 +734,6 @@ struct tcb *tcp;
#ifdef LINUX
#if defined(S390) || defined(S390X)
if (upeek(pid, PT_GPR2, &syscall_mode) < 0)
return -1;
if (syscall_mode != -ENOSYS) {
/*
* Since kernel version 2.5.44 the scno gets passed in gpr2.
*/
scno = syscall_mode;
}
if (tcp->flags & TCB_WAITEXECVE) {
/*
* When the execve system call completes successfully, the
@ -761,7 +753,16 @@ struct tcb *tcp;
tcp->flags &= ~TCB_WAITEXECVE;
return 0;
}
else {
if (upeek(pid, PT_GPR2, &syscall_mode) < 0)
return -1;
if (syscall_mode != -ENOSYS) {
/*
* Since kernel version 2.5.44 the scno gets passed in gpr2.
*/
scno = syscall_mode;
} else {
/*
* Old style of "passing" the scno via the SVC instruction.
*/