davidgiven / ack

The Amsterdam Compiler Kit
http://tack.sf.net
Other
420 stars 59 forks source link

Add unlink(2) implementation for CP/M. #235

Open ibara opened 3 years ago

ibara commented 3 years ago

Hello --

When compiling C code for CP/M, unlink is accepted by the compiler via the unistd.h header but then fails when linking due to an undefined reference for _unlink.

This PR adds an unlink implementation for CP/M.

I am not 100% sure the errno = EIO is the correct errno for when cpm_delete_file returns 0xff, but this is good enough for my needs.

Thanks!

davidgiven commented 3 years ago

Thanks very much! I've left a couple of comments.

ibara commented 3 years ago

Hello --

Thanks. (However, I don't see any comments anywhere...)

davidgiven commented 3 years ago

That is, github review comments, not code comments! They should show up in the github UI here, above this message: https://github.com/davidgiven/ack/pull/235

ibara commented 3 years ago

Embarrassingly, my GitHub UI appears to be broken (though I am using Chrome on Windows atm): there is no github review anywhere for me...

tkchia commented 2 years ago

Hello @ibara, hello @davidgiven,

I do not see any GitHub review comments either (?). Meanwhile I have a few queries of my own on this PR:

(My knowledge of the CP/M interface is admittedly quite limited — but I had been looking at Microsoft's GW-BASIC implementation of the KILL command for deleting files, which uses CP/M-like FCBs under MS-DOS 1.x.)

Thank you!

ibara commented 2 years ago

My knowledge of the CP/M interface is also limited. I freely and fully admit to stealing this code from another library file (maybe open?) and modifying it until it did the right thing for my use case. I am sure it needs lots of improvement!

davidgiven commented 2 years ago

Very very belatedly someone told me that github doesn't actually send reviews until you do something unobvious. Hopefully I've done that now. Sorry for the delay.