There are many drivers that have to open serial ports to communicate with different devices. Each of these drivers has to implement all of the requisite serial port management code on its own, which isn't terrible when you're only worried about supporting one OS. But with the effort to port to win32, as well as some of the oddities popping up with qnx, it might be a good idea to write a cross-platform serial library (libplayerserial?) that handles all of the low-level serial port setup and management. Then some kind of serial port can be abstracted up to the drivers. It would prevent an #ifdef mess in each driver by handling file descriptors, handles, and platform specific quirks in one place. It could also cut down development time dramatically on new drivers.