Advertisement
Guest User

Untitled

a guest
Jun 6th, 2011
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include<unistd.h>
  2. #include<stdio.h>
  3. #include<stdlib.h>
  4. #include<signal.h>
  5. #include<errno.h>
  6. int main(void){
  7. char buf[9001];
  8. struct sigaction int_handler = {.sa_handler=SIG_IGN};
  9. sigaction(SIGINT,&int_handler,0);
  10. while(1){
  11. if(read(0,buf,sizeof(buf))<0){
  12. if(errno==EINTR){
  13. puts("eintr");
  14. }else{
  15. printf("%d\n",errno);
  16. }
  17. }
  18. }
  19. puts("end");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement