Re: [hatari-devel] TOS use of PRG_ssize vs Hatari's

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On Sonntag, 22. Oktober 2023 18:54:01 CEST Troed S�berg wrote:

> I haven't verified if lseek throws an error or whether it just seeks to EOF


It will immediately return with an error code if you try to seek beyond the file size: https://github.com/th-otto/tos1x/blob/43ad10e2fee7fe5c974b46a715934e4de3210ae1/bdos/fsopnclo.c#L850-L854


EmuTOS behaves the same:


https://github.com/emutos/emutos/blob/967649a5d81275f600e162e91739a0b423671343/bdos/fsio.c#L360-L361


(don't get confused by the different error code names, they have the same value)


Since the program loader has just read the text & data segments, the fileptr will therefor just don't move, and the code will behave as if the symbol table was empty. However emutos behaves differently here, and checks the return code of the seek, and will return it to the application.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/