.global __errno, __oserror
.global __maperrno, __osmaperrno
.global __seterrno
+ .global oserrcheck, setoserror
; Error codes, must match the values in the C headers
.enum
; 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"
__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