I wrote a simple Perl script which will run in while loop and exit whenever any signal is send to this Perl script. I wrote a c program which creates a thread using the pthread_create() and in its start routine, it's using popen to execute that Perl script:
popen("/usr/bin/perl myprog.pl");
I am using the sigtrap in the Perl script to catch any signal it receives. Now I want to send signal (TERM) from my C program to this Perl process executed by the thread. How can I do that? Is there any way to send a signal to popen'ed processes. Please let me know if need more details.