Concerning programming something that makes system calls to Linux and that creates multiple process, I know how to send a message to another process using the method kill() (I think it's strange that a message-sending function is called something like that), but I don't understand how to make use of that message.
More specifically from what I understand, the "signal" you send with that function is just any arbitrary number that means whatever you want it to mean. Then in the code, the child process should have an if statement or something checking some variable to see if a certain value has been stored there, and then it should react accordingly. What I do not understand (and the man -S2 kill documentation in Linux didn't help much with this) is what variable the information is stored in. Or if it's less of a variable and more of an event, how do I check for the event?
Of course there is a little suspicion I have that I might be misunderstanding the signal argument of kill(). Since the documentation on kill() was lacking, I guess I should ask if in the library that you pull that function from, whether there are several predefined values that are intended to be passed as signals, such as SIGQUIT and SIGKILL, at which point Linux will take a certain appropriate course of action.
Can anybody please clarify this for me? Thanks!