2000-06-24 09:10:16 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 24.06.2000
|
|
|
|
;
|
|
|
|
; void _maperrno(void);
|
|
|
|
; /* Map an OS error to a system independent error code */
|
|
|
|
;
|
2008-04-13 17:35:15 +00:00
|
|
|
; Second entry setoserror maps the OS error code in A to an errno code
|
|
|
|
; and stores it into errno. _oserror is cleared.
|
|
|
|
|
2000-06-24 09:10:16 +00:00
|
|
|
|
2003-11-13 00:12:56 +00:00
|
|
|
.include "errno.inc"
|
2000-06-24 09:10:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
.code
|
|
|
|
|
|
|
|
__maperrno:
|
|
|
|
lda __oserror ; Get the error code
|
2008-04-15 06:44:46 +00:00
|
|
|
beq L9 ; Jump if no error
|
|
|
|
setoserror:
|
2000-06-24 09:10:16 +00:00
|
|
|
ldx #$00 ; Clear error
|
|
|
|
stx __oserror
|
|
|
|
jsr __osmaperrno ; Map the code
|
|
|
|
sta __errno
|
|
|
|
stx __errno+1
|
2008-04-15 06:44:46 +00:00
|
|
|
L9: rts
|
2000-06-24 09:10:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|