child process and parent process

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
In need of some credit
In need of some credit
Posts: 1
Joined: Fri Jul 29, 2016 8:47 pm

child process and parent process

Post by MeIn »

Below is the code to send signals form parent process to child process. I want to send signals from child process to parent process in this code.
can someone help me for this.

Code: Select all

#include <stdio.h>
#include <signal.h>

 /* routines child will call upon sigtrap */
void sigint();
void sigquit();

{ int pid;

  /* get child process */
   if ((pid = fork()) < 0) {
   if (pid == 0)
     { /* child */
       signal(SIGQUIT, sigquit);
       for(;;); /* loop for ever */
  else /* parent */
     {  /* pid hold id of child */
       printf("\nPARENT: sending SIGINT\n\n");
       sleep(3); /* pause for 3 secs */
       printf("\nPARENT: sending SIGQUIT\n\n");

void sigint()

{  signal(SIGINT,sigint); /* reset signal */
   printf("CHILD: I have received a SIGINT\n");

void sigquit()

{ printf("My DADDY has Killed me!!!\n");
Last edited by doublemax on Fri Jul 29, 2016 10:24 pm, edited 1 time in total.
Reason: Added code tags
User avatar
Posts: 16490
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: child process and parent process

Post by doublemax »

The key word that you need to Google for this is "inter process communication".

What i found: ... 05-ipc.pdf
Use the source, Luke!
Post Reply