Patches for select and pselect for Minix 2.0.3 - Version 0.1 Jose M. Gomez (jmgomez@linuxmail.org) - October 1st, 2003 Description ----------- This is a patch for Minix 2.0.3 that implements the select and pselect system calls. This implementation is independent from the one in the patch adding select for minix 2.0.2, although there are some details like the format of the SELECT message which are inspired from there. This implementation of select and pselect supports the following devices and operations: - Regular files: read and write depending on the access mode the file was open with. - Terminal: read an write on console. - Pipes: read, write and exception (checking closed pipe). - TCP/IP: read, write and exception (urgend data) on TCP and read and write on UDP, IP, Ethernet and PSIP. The implementation of pselect is "native", i.e. it doesn't contain the race condition when pselect is implemented using two sigprocmask calls and a select in between them (as shown in the manpage select_tut(2) on a linux system). Installation ------------ Just uncompress and untar to some directory and execute the script apply_patches.sh. The tests are in the directory tests/ and can be compiled using the provided makefile by typing 'make'. Todo ---- There are a number of things that need more work and will be solved eventually: - Support ptys and rs232 terminals as well. - Check why after waking up a select waiting for urgent data on a tcp connection, it keeps receiving more urg data although none is sent. (test08). - Add tests creating a simple echo server for ethernet, ip and psip, as in tests04 and test06. The use of select in any of these cases is completely untested at the moment. - Have a proper look at the implementation of the do_user_procmask function in mm/signal.c and see if something nicer can be done to check whether signal arrived or not without sending messages back to FS. - manpage? I think that's all. Anyway if there are any bugs lurking about or there is something to be corrected or improved please send me an email with your corrections, criticisms, suggestions or ideas.I'd be really happy as well if you find this patch useful and want to tell me so. ---- Jose M. Gomez jmgomez@linuxmail.org