Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fd_set read_fds;
- struct timeval tv;
- while(1){
- tv.tv_sec = 3;
- tv.tv_usec = 0;
- FD_ZERO(&read_fds);
- FD_SET(0,&read_fds);
- FD_SET(pipelogin,&read_fds);
- nfd = select(1,&read_fds,NULL,NULL,&tv);
- if(nfd==0)
- printf("Waiting...");
- if(FD_ISSET(0,&read_fds))
- comandos();
- if(FD_ISSET(pipelogin,&read_fds))
- VerificaLogin(pipelogin);
- }
Add Comment
Please, Sign In to add comment