I am learning about signals. In the following code, how can I keep printing the prompt inside the while loop after the CTRL-C signal has been entered. Also how to terminate the process with the CTRL-D signal.
int main(int argc, char *argv[]){
struct sigaction sh;
sh.sa_handler = sigint_handler;
sigemptyset(&sh.sa_mask);
sh.sa_flags = 0;
sigaction(SIGINT, &sh, NULL);
while(1)
{
printf("Some prompt: ");
}
return 0;
}