Hi, I wasn't sure where to post this, here or in the Linux section, but I guess it's more related to C
I'm having quite a headache trying to communicate two processes which have no relation (one is not the child of the other). I use SIGUSR1 for this purpose. i just want to send one signal from process 1 to process 2 so that this last process prints something in the console. Instead, it prints "User defined signal 1" and exits. I know this is the default behaviour but i'm installing a signal handler which supposedly just prints something. Here is part of the code:
This is the signal handler function:
Code:
void signalHandler (int sig) {
printf ("PRINT\n");
}
This is where I install the signal handler (I do this in main):
Code:
signal (SIGUSR1, signalHandler);
And now this is where I try to send a signal to the other process (id is that process id):
Code:
kill (id, SIGUSR1);
All of this is written in the process which sends the signal. The other process has nothing related to signals. Of this I am doubting, perhaps it should have something. Anyway, my objective is to have the program which receives the signal print "PRINT" as shown in signalHandler.
Thanks