Commit Graph

6 Commits

Author SHA1 Message Date
Stephen Heumann 505f1c2804 lseek: make seeking to an offset before end of file work properly.
The direction specified by the offset was essentially reversed when calling lseek with whence==2 (seek to offset from end of file). Therefore, specifying a negative offset with whence==2 would fail, rather than seeking before the end of the file as it should.

(The ORCA/C manual is not totally clear about this behavior, but the new behavior is consistent with the POSIX spec and all other implementations I'm aware of, including traditional Unix and APW C. Note that Unix/POSIX allows seeking beyond the end of the file, but GS/OS does not.)

There are also improvements to error handling, so lseek consistently reports EINVAL for invalid offsets.
2022-07-14 18:34:24 -05:00
Stephen Heumann a2bca0df04 Implement O_APPEND mode.
This was documented as supported, but not actually implemented.
2022-07-13 18:34:29 -05:00
Stephen Heumann ad273126dd Remove unnecessary instructions. 2022-07-13 18:27:24 -05:00
Stephen Heumann 84f471474a Use newer, more efficient ph2/ph4 macros throughout ORCALib.
These push DP values with pei, rather than lda+pha as in the old versions of the macros.
2022-06-30 19:01:47 -05:00
Kelvin Sherlock 578bda8439 CR -> LF 2017-10-31 13:14:07 -04:00
mikew50 954c3a02b5 ORCA libraries, from the Opus ][ CD 2017-10-01 18:00:58 -06:00