[fpc-devel] rtl_do_close is not called in the embedded and freertos targets
christo.crause at gmail.com
Tue Aug 22 08:32:48 CEST 2023
On Tue, Aug 22, 2023 at 8:05 AM Kostas Michalopoulos via fpc-devel
<fpc-devel at lists.freepascal.org> wrote:
> I was looking at the RTL code to see if the embedded target could be
> used as a workaround for unsupported OSes (e.g. some custom kernel) and
> noticed that there are some global function pointers used as callbacks
> for system-specific functionality - which is neat.
> However i also noticed that the do_close procedure in sysfile.inc
> doesn't do anything (it is empty) and nothing calls the rtl_do_close
> callback (the other do_xxx procedures do call the equivalent rtl_do_xxx
> if they are set). I don't have any actual program to test that out, it
> was just something i noticed by reading the code but it seems like a bug
> to me as i can't see a way to close a file handle otherwise.
For what it's worth, I agree with your assessment. Obviously file
handling is not used or tested much with embedded/freeRTOS targets.
I suggest creating a pull request with your fix.
More information about the fpc-devel