I have created a named pipe (mkfifo) in process 1 and written something on it. Now I can read the content written by process 1 in process 2.
Now I can to something (like listen) by which process 2 comes to know that process 1 has written some thing.
I have created a named pipe (mkfifo) in process 1 and written something on it. Now I can read the content written by process 1 in process 2.
Now I can to something (like listen) by which process 2 comes to know that process 1 has written some thing.
To complete the comment of Joachim.
You should consider using select or poll
I don't know if I really got your question but, if you want to process 2 know when process 1 write something, I suggest you use a signal from the process 1 to warn process 2 that things are ready to be read.(there are another ways to do this as well)
Since you got both process IDs(pid) you can use kill to send your ready message, so from the process that has done writting, it will be like that:
kill(pid, SIGINT)
And then handle Interrupt signal as you wish:
struct sigaction sigtohandle;
memset (&sigtohandle, 0, sizeof (sigtohandle));
sigtohandle.sa_handler = &read_process;
sigaction (SIGINT, &sigtohandle, NULL);
So you will have a function called read_process() on the signal receiver process that is supposed do the job you desire.
You can read more about processes and signals here:
http://advancedlinuxprogramming.com/alp-folder/alp-ch03-processes.pdf