SyntaxFix
Write A Post
Hire A Developer
Questions
There is no portable way to do this, but select() might be a good way. See http://c-faq.com/osdep/readavail.html for more possible solutions.