hello guyz plz help me in sorting our these problems of this script plz chek this is correct i m getting errors while compiling .. these are the errors
==========================================
sig2.c: In function `main':
sig2.c:10: `SIGINT' undeclared (first use in this function)
sig2.c:10: (Each undeclared identifier is reported only once
sig2.c:10: for each function it appears in.)
sig2.c:11: `SIGQUIT' undeclared (first use in this function)
sig2.c: In function `sigproc':
sig2.c:16: `SIGINT' undeclared (first use in this function)
==============================================
file
=================================================
[mohsin@localhost signals]$ vi sig2.c
#include <stdio.h>
void sigproc(void);
void quitproc(void);
main()
{
signal(SIGINT, sigproc);
signal(SIGQUIT, quitproc);
printf("ctrl-c disabled use ctrl-\\ to quit \n");
for(;
; /* infinite loop */}
void sigproc()
{ signal(SIGINT, sigproc); /* */
/* NOTE some versions of UNIX will reset signal to default
after each call. So for portability reset signal each time */
printf("you have pressed ctrl-c \n");
}
==================================
also i m searhing any examples for practicing basic signals in linux if any one of you find plz share ... in this forum
thnx alot