when I tried to perform recvfrom using the code below:
Code:
flag = sigprocmask(SIG_SETMASK, &oset, NULL);
if (flag != 0 && flag == -1){
perror("Error: Unblocking alarm failed \n");
close(sock_fd);
exit(1);
}
Frame *ACK = (Frame*) malloc(sizeof(Frame));
flag = recvfrom(sock_fd, ACK, sizeof(Frame), 0, (struct sockaddr *) 0, (socklen_t *) 0);
if (flag == -1)
{
perror("Error: Receiving ACK failed \n");
close(sock_fd);
exit(1);
}
I got an "Interrupted system call" error. Before this I have the unblocked SIGALARM, is this the reason why? Is there a way to keep SIGALARM unblocked and not receiving this error when calling recvfrom?