2 ; Ullrich von Bassewitz, 2003-08-12
4 ; Helper functions for several high level file functions.
12 ; ----------------------------------------------------------------------------
13 ; int __fastcall__ _directerrno (unsigned char code);
14 ; /* Set errno to a specific error code, clear _oserror and return -1. Used
19 jsr __seterrno ; Set errno, returns with A = 0
20 sta __oserror ; Clear __oserror
21 beq fail ; Branch always
23 ; ----------------------------------------------------------------------------
24 ; int __fastcall__ _mappederrno (unsigned char code);
25 ; /* Set _oserror to the given platform specific error code. If it is a real
26 ; ** error code (not zero) set errno to the corresponding system error code
27 ; ** and return -1. Otherwise return zero.
28 ; ** Used by the library.
32 sta __oserror ; Store the error code
33 tax ; Did we have an error?
35 jsr __osmaperrno ; Map os error into errno code
36 jsr __seterrno ; Save in errno
37 fail: lda #$FF ; Return -1
42 ; ----------------------------------------------------------------------------