Jeffrey Hiess wrote:
On the topic of the original post, I am hesitant to write platform
specific code to avoid suspending. Instead, I was pondering the idea
of forking a sub process which would call getchar() (and suspend) and
then main process could monitor the sub process for a signal to take
action. My multi-threading coding skills are a bit rusty, but it seems
like this would work.
Jeffrey...
It sounds like news:comp.unix.programmer might be a good place to
ask this question. If you have access to "Advanced Programming in
the UNIX Environment" by Richard Stevens, you might find it
helpful. You might find
http://www.iedu.com/mrd/c/getch.c
(written with help from APUE to run under Linux) interesting.
Note that your code will (necesarily) be less portable than a
standard-compliant program that uses getchar() - the price for
being just a bit chummier with the operating system.
--
Morris Dovey
West Des Moines, Iowa USA
C links at
http://www.iedu.com/c
Read my lips: The apple doesn't fall far from the tree.