Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<unistd.h>
- #include<stdio.h>
- #include<stdlib.h>
- #include<signal.h>
- #include<errno.h>
- int main(void){
- char buf[9001];
- struct sigaction int_handler = {.sa_handler=SIG_IGN};
- sigaction(SIGINT,&int_handler,0);
- while(1){
- if(read(0,buf,sizeof(buf))<0){
- if(errno==EINTR){
- puts("eintr");
- }else{
- printf("%d\n",errno);
- }
- }
- }
- puts("end");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement