я тоже думал что все должно быть просто, однако:
#include <unistd.h>
#include <fcntl.h>
#include <sys/times.h>
#include <sys/time.h>
#include <sys/select.h>
#include <iostream>
fd_set in;
int main()
{
FD_ZERO(&in);
FD_SET(0,&in);
std::cout<<"Start cycle."<<std::endl;
while(true)
{
int t=select(0,&in,0,0,0);
if(t>0)
{
char c;
std::cout<<"Try to read char."<<std::endl;
read(0,&c,1);
std::cout<<c<<" readed."<<std::endl;
if(c=='!')break;
}
else
{
std::cout<<"Error."<<std::endl;
return 1;
}
}
}
по выводу вижу что из select так и не выходит...что делаю не так?