Home What is the scope of signals?
Reply: 0

What is the scope of signals?

user1009 Published in June 25, 2018, 7:56 am

What is the scope of a signal after I install it??

For example if I have in a function called A this code:

sa.sa_handler = &handle_manager_bd;
sa.sa_flags = SA_NODEFER | SA_RESTART; 
sa.sa_mask = my_mask;   
sigaction(SIGUSR1, &sa, NULL);

If after this i call B, which is another function in the same program, that process will get the signal and do the action specified by handle_manager_bd right??

Another example which i would like to understand is as follows: if I have installed the handler in a function A like before and after that I call a function C, which is contained in a header file like "c.h" included by the program which contains A with #include "c.h", if I don't install the signal handler in the function C the signal will be recognized because i already installed it in A or should i put again the code above in the function C like i did for A?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.533926 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO