Hehe, I guess what I was asking is if there was a way to force the serial port open into canonical mode processing, but I guess I'll do it char by char. I probably would have done something similar to your code there, but in 20 lines instead of 1.

A design question: Currently I have Empire running as a daemon, listening to the IrDA port for input. When it detects input on the IrDA port, it reads the IrDA input into a buffer, then forks to allow a thread to process that input while the main process keeps listening to the IrDA port for more input. This allows the forked process to take it's time inserting tunes into the playlist because the player crashes if you try to add too many tunes to the playlist at one time.

Now that I must listen not only to the IrDA port but the serial port for input too, should I fork a new main process to listen to the serial port for input, or should I try to integrate the serial port listener in with the IrDA listener? The IrDA listener portion blocks for a fraction of a second, so I'd have to do some gymnastics to get around it, but it could be done. The easiest way would be to fork a serial port listening thread, and have it fork it's own sub-processes to handle input when it deems the time is right (it has gotten a complete serial port message).
_________________________
Mark Cushman