__seterrno is now a common function available on all platforms with slightly

different calling conventions.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3038 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2004-05-13 21:56:31 +00:00
parent d44cdad9ce
commit bfdfd83fde
4 changed files with 9 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
;
;
; common iocb setup routine for read, write
; expects __fastcall__ parameters (int fd, void *buf, int count)
;
@@ -47,7 +47,7 @@ iocberr:jsr incsp4 ; pop args
; this routine updates errno. do a JMP here right after calling
; CIOV. we expect status in Y.
;
.export __do_oserror,__seterrno,__inviocb
.export __do_oserror,__inviocb
__do_oserror:
sty __oserror ; save os dependent error code
retminus:
@@ -55,17 +55,11 @@ retminus:
tax ; return -1
rts
__seterrno:
sta __errno
stx __errno+1
rts
;
; sets EINVAL error code and returns -1
;
__inviocb:
lda #<EINVAL
ldx #>EINVAL
jsr __seterrno
jmp retminus ; return -1