My program goes through a loop like this:
... while(1){ read(sockfd,buf,sizeof(buf)); ... }
The read function blocks when it is waiting for
When your process receives a signal, read() will return and the value of errno will be set to EINTR.
read()
errno
EINTR