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

Re: one user space progamming problem

weiyun lv napisał(a):
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() ?

kbd() would be called after eof of stdin, which would happen if someone pressed ^D if the program was run in terminal. If you want to wait for data, you need to use select or poll, as I had written before. Look at the examples in libc docs (info libc, chapter 13.8).

Reply to: