<div dir="ltr">Hey!<div><br></div><div style>I am still a newbie to kernel development. I was reading about signals and signal handlers. The signal function describe as follows:<br><br><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">sighandler_t </span><b style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">signal</b><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium"> (</span><var style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">int signum, sighandler_t action</var><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">)<br>
</span><br>As per my understanding, when the signal denoted by signum occurs/is raised, the action is taken which can be either <span style="color:rgb(0,0,0);font-family:monospace;font-size:medium">SIG_DFL, </span><span style="color:rgb(0,0,0);font-family:monospace;font-size:medium">SIG_IGN or a function/handler</span><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><font size="3">. </font>What i don't understand is, when we write for example </font></span><font color="#000000" face="arial, helvetica, sans-serif">signal(SIGPROF, handler); isn't this supposed to be asynchronous? however the code is executed sequentially. So, when this function is encountered, it is executed and when a signal is raised, how does it know what to do?<br>
<br>This might sound foolish, bear with me.<br><br>Thanks<br>Rahul Gandhi</font></div></div>