#include "csapp.h"

void sigint_handler(int sig) /* SIGINT handler */
{
    // Doesn't do anything but interrupt the call to pause() below.
}

int main(void)
{
    struct sigaction sa;
    // Sensible defaults. Use these unless you have a reason not to.
    sigemptyset(&sa.sa_mask);
    sa.sa_flags = SA_RESTART;
    // The handler for SIGINT will be sigint_handler.
    sa.sa_handler = sigint_handler;
    if (sigaction(SIGINT, &sa, 0) != 0)
      unix_error("signal error");

    // Wait for the receipt of a signal.
    pause();

    puts("Ctrl-C received, exiting.");
    return 0;
}
