Tfe

Ongi etorri tfe-ren webgunera...

Old stuff/ecole_etude_fac_de_pau/licence_3/projet_commun_se/backup12/test.c

(Deskargatu)
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>

void fonction(int n)
{
    printf("Youpi\n");
}


int main()
{
    printf("ok\n");
    struct sigaction action;
    action .sa_sigaction = NULL;
    action.sa_flags=0;
    action.sa_handler = fonction;
    sigemptyset(&action.sa_mask);
    if(sigaction(SIGALRM, &action, NULL) == -1)
    {
	perror("blonde sigaction");
	exit(-1);
    }
    while(1) { pause(); }
    return 1;
}