EmbLogic's Blog

process replacement followed by inter process comm. using file

This is the output:

[root@localhost ipc]# ./p_comm
File Open Successfully
This is Parent with id=31340
This is child with id=31341
This is a new program which replaced the child
Write By Child:: Success
Read by Parent: Success
    Child Said:Hello Parent
Write by Parent: Success
Read By Child:: Success
    Parent said:Hi Child How are you?
Write By Child:: Success
Read by Parent: Success
    Child Said:I am Fine. U Tell?
Write by Parent: Success
Read By Child:: Success
    Parent said:We are also fine.Ok Bye
Child exit successfully and code is 0

Log File

RCS file: RCS/p_comm.c,v
Working file: p_comm.c
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
description:
program to communicate between two process through a file
done- opening a file in rdwr mode
convert int fd into string to make compatiple with execl argument
—————————-
revision 1.4
date: 2014/09/22 12:46:24;  author: root;  state: Exp;  lines: +13 -3
done:both read and write by parent in the same file
Note: Before executing this program make sure that “child_comm.c” file must be in the same directory
—————————-
revision 1.3
date: 2014/09/22 12:10:56;  author: root;  state: Exp;  lines: +9 -4
1st read by the parent and then reply back to child by writing into the same file
—————————-
revision 1.2
date: 2014/09/22 11:53:56;  author: root;  state: Exp;  lines: +10 -4
read the message written by child in a file
—————————-
revision 1.1
date: 2014/09/22 11:23:57;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/child_comm.c,v
Working file: child_comm.c
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
description:
program which will replace the child to do inter process comm through file
get fd through argv[0] and than convert into integer using atoi
—————————-
revision 1.4
date: 2014/09/22 12:48:25;  author: root;  state: Exp;  lines: +12 -2
done:child repalace itself with this file using execl and this program then communicate with parent
note:this program is linked with p_comm.c
—————————-
revision 1.3
date: 2014/09/22 12:11:48;  author: root;  state: Exp;  lines: +9 -2
1st write the msg for parent and then read the msg from parent using the same file
—————————-
revision 1.2
date: 2014/09/22 11:40:06;  author: root;  state: Exp;  lines: +4 -3
got message which is to be written in file through argv[1]
write the message into file
—————————-
revision 1.1
date: 2014/09/22 11:32:27;  author: root;  state: Exp;
Initial revision
=============================================================================

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>