mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2025-04-13 22:37:04 +00:00
Implement O_APPEND mode.
This was documented as supported, but not actually implemented.
This commit is contained in:
parent
ad273126dd
commit
a2bca0df04
13
fcntl.asm
13
fcntl.asm
@ -800,6 +800,7 @@ nbuff equ 3 new buffer pointer
|
||||
lda files,X
|
||||
beq lb0
|
||||
sta wrRefnum
|
||||
sta smRefnum
|
||||
stx filds
|
||||
lda files+2,X make sure the file is open for writing
|
||||
and #O_WRONLY+O_RDWR
|
||||
@ -851,7 +852,12 @@ lb0e sta [nbuff]
|
||||
long M
|
||||
lb0f move4 nbuff,wrDataBuffer set the data buffer start
|
||||
|
||||
lb0g OSWrite wrRec write the bytes
|
||||
lb0g ldx filds if the file is in O_APPEND mode then
|
||||
lda files+2,X
|
||||
and #O_APPEND
|
||||
beq lb0h
|
||||
OSSet_Mark smRec set mark to EOF
|
||||
lb0h OSWrite wrRec write the bytes
|
||||
bcc lb1 if an error occurred then
|
||||
lda #EIO errno = EIO
|
||||
sta >errno
|
||||
@ -875,4 +881,9 @@ wrRefnum ds 2
|
||||
wrDataBuffer ds 4
|
||||
wrRequestCount ds 4
|
||||
wrTransferCount ds 4
|
||||
|
||||
smRec dc i'3' SetMark record
|
||||
smRefnum ds 2
|
||||
smBase dc i'1' EOF-displacement mode
|
||||
smDisplacement dc i4'0' displacement = 0
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user