How can I get control of the stdin, stdout and stderr streams in gcc.??
We can redirect the error and output to separate files for sure, but is there a way that i can control the stdin such that whenever my program is executing and there is a moment when the stdin waits for a input(either from the user keyboard or any file), it sets a signal / changes the value of a variable or something like that so that i can get to know that now the stdin is waiting for the input, so that i can proceed accordingly and do something (e.g.show user a message or anything)
The other way i can think of doing it is continously polling the stdin stream somehow and whenever it waits for input, do my action. But again I don't know how to do this.?
Let me know if the question is not clear enough.