Hi, first of all, I'm sorry about my previous posts. I'll be less lazy (I just tried to be coincise, maybe too much). So the significant source code follows (probably it is just necessary to look at my_signal.h source code:
my_signal.h:
Code:
#include <signal.h>
#include <sys/wait.h>
typedef void Sigfunc(int);
Sigfunc* signal(int , Sigfunc *);
void manage_zombie (int segnale);
my_signal.c:
Code:
#include "basic.h"
#include "my_signal.h"
Sigfunc * signal(int signo, Sigfunc *func){
struct sigaction act, oact;
act.sa_handler = func;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
if (signo != SIGALRM) {
act.sa_flags |= SA_RESTART;
}
if (sigaction(signo, &act, &oact) < 0)
return(SIG_ERR);
return(oact.sa_handler);
}
basic.h
Code:
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
I'm wondering if this is the case described by Grumpy.
In particular, I'm a little confuse in my_signal.h:
- it includes "signal.h"
- it declares a "signal" function
why does not the compile complain about that?
Thanks,
Massimo