From 3293330f31eb235254247964351094b46c5a8b91 Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 13 Apr 2008 17:35:15 +0000 Subject: [PATCH] New entry point setoserror git-svn-id: svn://svn.cc65.org/cc65/trunk@3835 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- asminc/errno.inc | 1 + libsrc/common/maperrno.s | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/asminc/errno.inc b/asminc/errno.inc index 96b5bf94e..ef81036fc 100644 --- a/asminc/errno.inc +++ b/asminc/errno.inc @@ -7,6 +7,7 @@ .global __errno, __oserror .global __maperrno, __osmaperrno .global __seterrno + .global oserrcheck, setoserror ; Error codes, must match the values in the C headers .enum diff --git a/libsrc/common/maperrno.s b/libsrc/common/maperrno.s index 528888e7b..869acac6f 100644 --- a/libsrc/common/maperrno.s +++ b/libsrc/common/maperrno.s @@ -4,6 +4,9 @@ ; void _maperrno(void); ; /* Map an OS error to a system independent error code */ ; +; Second entry setoserror maps the OS error code in A to an errno code +; and stores it into errno. _oserror is cleared. + .include "errno.inc" @@ -13,6 +16,7 @@ __maperrno: lda __oserror ; Get the error code beq @L1 ; Jump if no error +setoserror: ldx #$00 ; Clear error stx __oserror jsr __osmaperrno ; Map the code -- 2.39.5