alpha, ia64, mips, nios2, powerpc, sparc: always check for syscall error

On architectures that use dedicated registers to report syscall errors,
check for syscall error condition regardless of SYSCALL_NEVER_FAILS flag
in the syscall entry.  On architectures that use negated errno
semantics, there is no way to distinguish a syscall error from a valid
return code that looks like a syscall error, and the check for
SYSCALL_NEVER_FAILS flag remains the only way to tell one case
from another.

* linux/alpha/get_error.c (get_error): Ignore check_errno.
* linux/ia64/get_error.c: Likewise.
* linux/mips/get_error.c: Likewise.
* linux/nios2/get_error.c: Likewise.
* linux/powerpc/get_error.c: Likewise.
* linux/sparc/get_error.c: Likewise.
* linux/sparc64/get_error.c: Likewise.
This commit is contained in:
Дмитрий Левин 2015-12-27 00:18:51 +00:00
parent 0297e0c067
commit 552f2f62fd
7 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
static void
get_error(struct tcb *tcp, const bool check_errno)
{
if (check_errno && alpha_a3) {
if (alpha_a3) {
tcp->u_rval = -1;
tcp->u_error = alpha_r0;
} else {

View File

@ -10,7 +10,7 @@ get_error(struct tcb *tcp, const bool check_errno)
tcp->u_rval = err;
}
} else {
if (check_errno && ia64_regs.gr[10]) {
if (ia64_regs.gr[10]) {
tcp->u_rval = -1;
tcp->u_error = ia64_regs.gr[8];
} else {

View File

@ -1,7 +1,7 @@
static void
get_error(struct tcb *tcp, const bool check_errno)
{
if (check_errno && mips_REG_A3) {
if (mips_REG_A3) {
tcp->u_rval = -1;
tcp->u_error = mips_REG_V0;
} else {

View File

@ -8,7 +8,7 @@ get_error(struct tcb *tcp, const bool check_errno)
* the system call success, r7=1 indicates an error. The positive
* errno value written in r2.
*/
if (check_errno && nios2_regs.regs[7]) {
if (nios2_regs.regs[7]) {
tcp->u_rval = -1;
tcp->u_error = nios2_regs.regs[2];
} else {

View File

@ -1,7 +1,7 @@
static void
get_error(struct tcb *tcp, const bool check_errno)
{
if (check_errno && (ppc_regs.ccr & 0x10000000)) {
if (ppc_regs.ccr & 0x10000000) {
tcp->u_rval = -1;
tcp->u_error = ppc_regs.gpr[3];
} else {

View File

@ -1,7 +1,7 @@
static void
get_error(struct tcb *tcp, const bool check_errno)
{
if (check_errno && sparc_regs.psr & PSR_C) {
if (sparc_regs.psr & PSR_C) {
tcp->u_rval = -1;
tcp->u_error = sparc_regs.u_regs[U_REG_O0];
} else {

View File

@ -1,7 +1,7 @@
static void
get_error(struct tcb *tcp, const bool check_errno)
{
if (check_errno && sparc_regs.tstate & 0x1100000000UL) {
if (sparc_regs.tstate & 0x1100000000UL) {
tcp->u_rval = -1;
tcp->u_error = sparc_regs.u_regs[U_REG_O0];
} else {