]> git.sur5r.net Git - cc65/blob - libsrc/atari/lseek.s
fixed setting of errno
[cc65] / libsrc / atari / lseek.s
1 ;
2 ; Christian Groessler, August 2000
3 ;
4 ; this file provides the lseek() function
5 ;
6 ; off_t __fastcall__ lseek(int fd, off_t offset, int whence);
7 ;
8
9
10         .export         _lseek
11         .import         incsp6,__errno,__oserror
12         .importzp       sreg
13         .include        "atari.inc"
14         .include        "../common/errno.inc"
15
16 .proc   _lseek
17
18 ; dummy implementation, return -1 and ENOSYS errno value
19         jsr     incsp6
20         lda     #<ENOSYS
21         sta     __errno
22         lda     #>ENOSYS
23         sta     __errno+1
24         ldx     #0
25         stx     __oserror
26         dex
27         txa
28         sta     sreg
29         sta     sreg+1
30         rts
31
32 .endproc