From c96f129304692df0292ed9e6fc5b29fde559188d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Sun, 9 Oct 1994 22:02:06 +0000 Subject: [PATCH] Updated to convert errno return in syscall if conversion tabel present. --- sys/amd64/amd64/trap.c | 8 +++++++- sys/i386/i386/trap.c | 8 +++++++- sys/kern/subr_trap.c | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 98e280286634..e2d91a97eaba 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.35 1994/10/01 02:56:05 davidg Exp $ + * $Id: trap.c,v 1.36 1994/10/08 22:19:50 phk Exp $ */ /* @@ -664,6 +664,12 @@ syscall(frame) error = (*callp->sy_call)(p, args, rval); + if (p->p_sysent->sv_errsize) + if (error >= p->p_sysent->sv_errsize) + error = -1; /* XXX */ + else + error = p->p_sysent->sv_errtbl[error]; + switch (error) { case 0: diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 98e280286634..e2d91a97eaba 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.35 1994/10/01 02:56:05 davidg Exp $ + * $Id: trap.c,v 1.36 1994/10/08 22:19:50 phk Exp $ */ /* @@ -664,6 +664,12 @@ syscall(frame) error = (*callp->sy_call)(p, args, rval); + if (p->p_sysent->sv_errsize) + if (error >= p->p_sysent->sv_errsize) + error = -1; /* XXX */ + else + error = p->p_sysent->sv_errtbl[error]; + switch (error) { case 0: diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 98e280286634..e2d91a97eaba 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.35 1994/10/01 02:56:05 davidg Exp $ + * $Id: trap.c,v 1.36 1994/10/08 22:19:50 phk Exp $ */ /* @@ -664,6 +664,12 @@ syscall(frame) error = (*callp->sy_call)(p, args, rval); + if (p->p_sysent->sv_errsize) + if (error >= p->p_sysent->sv_errsize) + error = -1; /* XXX */ + else + error = p->p_sysent->sv_errtbl[error]; + switch (error) { case 0: