I'm trying to set up a signal handler so that I can catch catch SIGIO to handle async read operations from the serial port. I define my signal handler as:
and then define the signal action:Code:void signal_handler_IO (int status);
then to put it all together I got this from tldp:Code:struct sigaction saio;
the problem is when I compile I recieve an error "no match for `__sigset_t & = int'" on the line "saio.sa_mask = 0;". I've tried putting signals that I know to be valid in this space and even typecasting to sigset_t but the problem persists. Is there something I'm overlooking here?Code:/* install the signal handler before making the device asynchronous */ saio.sa_handler = signal_handler_IO; saio.sa_mask = 0; saio.sa_flags = 0; saio.sa_restorer = NULL; sigaction(SIGIO,&saio,NULL); /* allow the process to receive SIGIO */ fcntl(fd, F_SETOWN, getpid()); /* Make the file descriptor asynchronous (the manual page says only O_APPEND and O_NONBLOCK, will work with F_SETFL...) */ fcntl(fd, F_SETFL, FASYNC);
I'm using GCC version 2.95.4 on debian linux
thanks,
Devan


Reply With Quote