All pastes #12079 Raw Edit

Something

public text v1 · immutable
#12079 ·published 2005-05-18 19:24 UTC
rendered paste body
#include  <stdio.h>
#include  <signal.h>
#include  <sys/types.h>



void sighand(int);


int  main(void)
{
        struct sigaction act;

        bzero(&act, sizeof(act));

        act.sa_handler = sighand;
        act.sa_flags = SA_NOMASK | SA_NODEFER;

        printf("%d\n",sigaction(SIGUSR1, &act, NULL));

        signal(SIGUSR1, sighand);
        raise(SIGUSR1);
        while (1)
             pause();
}

void  sighand(int sig)
{
        printf(".");
        fflush(stdout);
        raise(SIGUSR1);
        while (1);
}