DOS errors need to be mapped onto POSIX errors
A multi-threaded-style OS for the Spectrum +3
Brought to you by:
u6c87
Building a test-suite for file handling calls has exposed that syscalls such as open() cannot return ENOENT. The DOS error return is passed back to userland, resulting in constructs like this not behaving as expected:
if ((fd = open(FILE, O_RDONLY)) == -1) {
if (errno == ENOENT) {
printf("Expected outcome\n");
"Expected outcome" will never be printed as open() returns an errno of 87, which is the +3DOS error "File not found". This, and others, should be mapped to standard POSIX errno values. This particular one is an easy one, as it maps cleanly.
This currently breaks t_file01 test case.