This is a child process used to receive messages and send it back to its father.Check the Full tutorial
#include <stdio.h>
#include <unistd.h>
#include <Ecore.h>
#define BUFFER_SIZE 1024
{
static int numberOfMessages = 0;
char message[BUFFER_SIZE];
if (!fgets(message, BUFFER_SIZE, stdin))
numberOfMessages++;
if (numberOfMessages < 3)
{
fprintf(stdout, "My father sent this message to me:%s\n", message);
fflush(stdout);
}
else
{
fprintf(stdout, "quit\n");
fflush(stdout);
}
}
int
main(void)
{
_fd_handler_cb,
NULL, NULL, NULL);
return EXIT_SUCCESS;
return EXIT_FAILURE;
}