LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   RS232 programming (sigaction problem) (https://www.linuxquestions.org/questions/linux-networking-3/rs232-programming-sigaction-problem-388102/)

lucky6969b 11-30-2005 08:45 PM

RS232 programming (sigaction problem)
 
Hi there,
I've got an application on hand. This app involves a structure called sigaction
But when I set this variable in C++ mode, I've got the following error

unittest.cpp: In function 'int main(int, char**)':
unittest.cpp:73: error: no match for 'operator=' in 'saio.sigaction::sa_mask = 0'
/usr/include/bits/sigset.h:31: note: candidates are: __sigset_t& __sigset_t::operator=(const __sigset_t&)

Code snippnet
.....
saig.sa_mask = 0;
....
etc

Thanks
Jack

lucky6969b 11-30-2005 09:08 PM

Sorry, this is a network program. But I just dropped it in the wrong place
Thanks
Jack

Koteck 04-05-2008 02:06 PM

I've got this error when compiling the following example code:


void signal_handler_IO(int status)
{
...
}
...
void main()
{
struct sigaction saio;
...
saio.sa_handler = signal_handler_IO;
saio.sa_mask = 0; // problematic instruction
saio.flags = 0;
...
}


the solution is to replace:
saio.sa_mask = 0;
by:
sigemptyset(&(saio.sa_mask));


it seems to be a low-level implementation problem of the struct sigaction which internally manages 'unions' and differs from one platform to another


All times are GMT -5. The time now is 09:39 PM.