[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: one user space progamming problem

E1. read data from one fifo and display it;
E2. Check if there is input from keyboard, if there is then handle it, otherwise do nothing.

E1 should always be in execution, while E2 is event driven (when I input something it should be capable of detecting and handling.)

If you want to simply check stdin, use select or poll. If U want to use other libraries to handle terminal (ncurses? slang?), U'll have to check it's docs to find apropriate functions.

  if( feof(stdin)){

this way doesn't work, kbd() is never called. How can I poll to see if there is input or not while I can do something else, like read() ?

Reply to: