<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; fork</title>
	<atom:link href="https://www.emblogic.com/blog/tag/fork/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Orphan Process</title>
		<link>https://www.emblogic.com/blog/01/orphan-process/</link>
		<comments>https://www.emblogic.com/blog/01/orphan-process/#comments</comments>
		<pubDate>Fri, 15 Jan 2016 10:39:03 +0000</pubDate>
		<dc:creator><![CDATA[Ankur Garg]]></dc:creator>
				<category><![CDATA[Linux Internals and System Programming]]></category>
		<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>
		<category><![CDATA[c programming]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[orphan]]></category>
		<category><![CDATA[orphan process]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=13165</guid>
		<description><![CDATA[Orphan Process =============== If in a process, the parent process is terminated before the child process, the child process become orphan - It takes the lowest possible process as its parent - And its PPID is changed to the PID &#8230; <a href="https://www.emblogic.com/blog/01/orphan-process/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Orphan Process<br />
===============<br />
If in a process, the parent process is terminated before the child process, the child process become orphan<br />
- It takes the lowest possible process as its parent<br />
- And its PPID is changed to the PID of its new parent process.<br />
- Mostly the new parent process in init process (PID = 1).<br />
- It is because init adopts the orphan process.<br />
- The child is then terminated normally by the init process.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/orphan-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zombie or Defunct Process</title>
		<link>https://www.emblogic.com/blog/01/zombie-or-defunct-process/</link>
		<comments>https://www.emblogic.com/blog/01/zombie-or-defunct-process/#comments</comments>
		<pubDate>Fri, 15 Jan 2016 10:37:43 +0000</pubDate>
		<dc:creator><![CDATA[Ankur Garg]]></dc:creator>
				<category><![CDATA[Linux Internals and System Programming]]></category>
		<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>
		<category><![CDATA[c programming]]></category>
		<category><![CDATA[defunct]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[zombie]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=13163</guid>
		<description><![CDATA[Zombie or Defunct Process ========================== If a child proces tries to teminate,its association with parent remains until the parent terminates normally or calls wait. - The child process entry in process table is therfore not freed up immediately. - Althougth &#8230; <a href="https://www.emblogic.com/blog/01/zombie-or-defunct-process/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Zombie or Defunct Process<br />
==========================<br />
If a child proces tries to teminate,its association with parent remains until the parent terminates normally or calls wait.<br />
- The child process entry in process table is therfore not freed up immediately.<br />
- Althougth the process is no longer active, the child remains still in system because its exit code is needed to be stored in case of parent subsequently</p>
<p>calls wait.<br />
- The process becomes defunct or zombie process.<br />
- It is shown by &#8216;Z&#8217; or &#8216;Z+&#8217; in process table.</p>
<p>- If the parent is terminated abnormally, the zombie child process will not be terminated (which is not good).</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/zombie-or-defunct-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>waiting for a process</title>
		<link>https://www.emblogic.com/blog/01/waiting-for-a-process/</link>
		<comments>https://www.emblogic.com/blog/01/waiting-for-a-process/#comments</comments>
		<pubDate>Fri, 15 Jan 2016 10:36:05 +0000</pubDate>
		<dc:creator><![CDATA[Ankur Garg]]></dc:creator>
				<category><![CDATA[Linux Internals and System Programming]]></category>
		<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>
		<category><![CDATA[c programming]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[wait]]></category>
		<category><![CDATA[waiting for a process]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=13160</guid>
		<description><![CDATA[Waiting For a Process ===================== - Sometime we would like to find out when a child process has finished. - It is needed for parent process to wait until the child finishes before continuing by calling wait. - It has &#8230; <a href="https://www.emblogic.com/blog/01/waiting-for-a-process/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Waiting For a Process<br />
=====================<br />
- Sometime we would like to find out when a child process has finished.<br />
- It is needed for parent process to wait until the child finishes before continuing by calling wait.<br />
- It has prototype :<br />
pid_t wait(int *stat_loc);<br />
- It is declared in header :<br />
#include&lt;sys/wait.h&gt;<br />
- It has a return type pid_t which is declared in header :<br />
#include&lt;sys/types.h&gt;<br />
- The wait system call causes a parent process to pause until one of its child processes is stopped.<br />
- The wait returns PID of child process which is terminated.<br />
- The status information determine the exit status of child process (i.e  value returned from main or passed to exit)<br />
- If stat_loc is not a null pointer, the status information will be written to location to which it points.<br />
- The status information can be determined by using macros defined in header sys/wait.h</p>
<p>Macro                                        Defination<br />
WIFEXITED(stat_val)          Nonzero if child terminated normally<br />
WEXITSTATUS(stat_val)    If WIFEXITED is nonzero, this returns child exit code</p>
<p>WIFSIGNALED(stat_val)    Nonzero if child is terminated on an uncaught signal<br />
WTERMSIG(stat_val)           If WIFSIGNALED is nonzero, this returns signal number</p>
<p>WIFSTOPPED(stat_val)       Nonzero if the child has stopped<br />
WSTOPSIG(stat_val)            If WIFSTOPPED is nonzero, this returns signal number</p>
<p>- The wait() is used when a result of process done by child is used by the parent for further processing.<br />
- For eg :-<br />
In a program child process write to file1 and parent has to read from (the written data of)file1.<br />
If the scheduler runs read() command of the parent process before the write() command of child process, it reads nothing.<br />
- So, wait() is used before read() statement in parent process to avoid the unnecessory error.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/waiting-for-a-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Process Duplication using fork</title>
		<link>https://www.emblogic.com/blog/01/process-duplication-using-fork/</link>
		<comments>https://www.emblogic.com/blog/01/process-duplication-using-fork/#comments</comments>
		<pubDate>Fri, 15 Jan 2016 10:28:24 +0000</pubDate>
		<dc:creator><![CDATA[Ankur Garg]]></dc:creator>
				<category><![CDATA[Linux Internals and System Programming]]></category>
		<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>
		<category><![CDATA[c programming]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[process duplication]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=13158</guid>
		<description><![CDATA[Process Duplication using system call fork ============================== - A new process is created using fork(). - fork() is a system call. - fork duplicates the current process. - It creates a new entry in the process table with many of &#8230; <a href="https://www.emblogic.com/blog/01/process-duplication-using-fork/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Process Duplication using system call fork<br />
==============================<br />
- A new process is created using fork().<br />
- fork() is a system call.<br />
- fork duplicates the current process.<br />
- It creates a new entry in the process table with many of same</p>
<p>attributes as current process.<br />
- The new process (known as child process) is almost identical to</p>
<p>original process (known as parent process).<br />
- PPID (Parent Process Identification) of new process is PID of</p>
<p>original process.<br />
- PID (Process Identification) of new process is lowest PID</p>
<p>available after the PID of original process .Mostly it is 1 greater</p>
<p>than the original process(If available).<br />
- Prototype of fork :-<br />
pid_t fork(void);<br />
- Function fork() is declared in header:<br />
#include&lt;unistd.h&gt;<br />
- It has a return type pid_t .<br />
- System type pid_t is declared in header :<br />
#include&lt;sys/types.h&gt;<br />
- The Process counter of new process starts from fork() statement.<br />
- So, fork() is executed twice.<br />
- When fork() is executed by parent, it returns PID of child</p>
<p>process on success.<br />
- When fork() is executed by child, it returns 0 for success.<br />
- If fork fails, it returns -1.<br />
- Falure may be due to :-<br />
* Limit on the number of child processes that a parent may</p>
<p>have (CHILD_MAX), in which errno will be set to &#8220;EAGAIN&#8221;</p>
<p>* If process table or virtual memory is filled (not enough</p>
<p>space), errno variable will be set to &#8220;ENOMEM&#8221;.<br />
- The return value of fork() can be used to determine whether child</p>
<p>or parent is executing.<br />
- For eg. :-<br />
#include&lt;stdio.h&gt;<br />
#include&lt;unistd.h&gt;<br />
#include&lt;sys/types.h&gt;<br />
int main()<br />
{<br />
pid_t fret;<br />
printf(&#8220;Only parent execute\n&#8221;);<br />
fret = fork();//Fork statement<br />
printf(&#8220;Both parent and child execute this statement.\n&#8221;);<br />
switch(fork)<br />
{<br />
case -1 :<br />
perror(&#8220;fork&#8221;);<br />
exit(EXIT_FAILURE);<br />
break;<br />
case 0 :<br />
printf(&#8220;Child executing\n&#8221;);<br />
break;<br />
default :<br />
printf(&#8220;Parent executing\n&#8221;);<br />
break;<br />
}<br />
return 0;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/process-duplication-using-fork/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client,server and process communication project using signals</title>
		<link>https://www.emblogic.com/blog/09/clientserver-and-process-communication-project-using-signals/</link>
		<comments>https://www.emblogic.com/blog/09/clientserver-and-process-communication-project-using-signals/#comments</comments>
		<pubDate>Sat, 27 Sep 2014 13:41:24 +0000</pubDate>
		<dc:creator><![CDATA[Joon Vichitra]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>
		<category><![CDATA[client-server]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[signal]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11534</guid>
		<description><![CDATA[Welcome to the Project!! n1=12, n2=23 Performing addition action In Server:Sum=35 In CLIENT: Result=35 n1=20, n2=8 Performing Subtraction action In Server:Sub=12 In CLIENT2: Result=12 n1=5, n2=8 Performing Multiplication action In Server:Mul=40 In CLIENT3: Result=40 RCS file: RCS/server.c,v Working file: server.c &#8230; <a href="https://www.emblogic.com/blog/09/clientserver-and-process-communication-project-using-signals/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>Welcome to the Project!!</strong><br />
<strong>n1=12, n2=23 Performing addition action</strong><br />
<strong>In Server:Sum=35</strong><br />
<strong>In CLIENT: Result=35</strong><br />
<strong>n1=20, n2=8 Performing Subtraction action</strong><br />
<strong>In Server:Sub=12</strong><br />
<strong>In CLIENT2: Result=12</strong><br />
<strong>n1=5, n2=8 Performing Multiplication action</strong><br />
<strong>In Server:Mul=40</strong><br />
<strong>In CLIENT3: Result=40</strong></p>
<p>RCS file: RCS/server.c,v<br />
Working file: server.c<br />
head: 1.27<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 27;    selected revisions: 27<br />
description:<br />
program which act as a server to take the request of client<br />
done:created one child process and a pipe<br />
done:replace the child process with client1.c and send pfd[1] to the client as a command line argument<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.27<br />
date: 2014/09/27 13:32:08;  author: root;  state: Exp;  lines: +1 -1<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.26<br />
date: 2014/09/27 13:30:56;  author: root;  state: Exp;  lines: +1 -1<br />
fix child exit normally<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.25<br />
date: 2014/09/27 13:26:47;  author: root;  state: Exp;  lines: +5 -11<br />
remove extra printf<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.24<br />
date: 2014/09/27 13:20:47;  author: root;  state: Exp;  lines: +19 -6<br />
create 3rd client and process to perform multiplication<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.23<br />
date: 2014/09/27 13:07:11;  author: root;  state: Exp;  lines: +2 -2<br />
include client 2 also<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.22<br />
date: 2014/09/27 12:59:47;  author: root;  state: Exp;  lines: +1 -1<br />
send signal to client after reading the result from process pipe and writing the same into client pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.21<br />
date: 2014/09/27 12:54:04;  author: root;  state: Exp;  lines: +4 -2<br />
get the pid of child in parent process inorder to send the signal using kill<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.20<br />
date: 2014/09/27 12:48:34;  author: root;  state: Exp;  lines: +7 -6<br />
get the id of process child into pid1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.19<br />
date: 2014/09/27 05:37:45;  author: root;  state: Exp;  lines: +1 -0<br />
check char variable in switch case<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.18<br />
date: 2014/09/27 05:34:19;  author: root;  state: Exp;  lines: +1 -2<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.17<br />
date: 2014/09/27 05:27:32;  author: root;  state: Exp;  lines: +1 -1<br />
change the position of signal handler<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.16<br />
date: 2014/09/27 05:25:13;  author: root;  state: Exp;  lines: +1 -1<br />
use pause to synchronise<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.15<br />
date: 2014/09/27 05:18:07;  author: root;  state: Exp;  lines: +2 -2<br />
change the lable1 in front of fork<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.14<br />
date: 2014/09/27 05:12:04;  author: root;  state: Exp;  lines: +21 -3<br />
create 1 client and 1 process for subtraction operation<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.13<br />
date: 2014/09/26 19:00:34;  author: root;  state: Exp;  lines: +0 -1<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.12<br />
date: 2014/09/26 18:55:32;  author: root;  state: Exp;  lines: +2 -0<br />
write the result into client pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.11<br />
date: 2014/09/26 18:51:04;  author: root;  state: Exp;  lines: +5 -1<br />
define function to handle sigusr1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.10<br />
date: 2014/09/26 18:46:22;  author: root;  state: Exp;  lines: +2 -2<br />
use pause()<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.9<br />
date: 2014/09/26 17:57:33;  author: root;  state: Exp;  lines: +30 -86<br />
remake the program without using any sleep instruction<br />
use structure to read the data from client<br />
write the num1 and num2 into process adder pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8<br />
date: 2014/09/24 14:24:48;  author: root;  state: Exp;  lines: +0 -1<br />
change the o/p appearence<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/09/24 14:12:17;  author: root;  state: Exp;  lines: +42 -10<br />
read result from p1,p2,p3<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/09/24 13:08:55;  author: root;  state: Exp;  lines: +17 -3<br />
create one more child process to call process1.c<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/09/24 09:47:40;  author: root;  state: Exp;  lines: +31 -3<br />
read the data from all three client<br />
do switch case to perform different operation<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/24 08:38:36;  author: root;  state: Exp;  lines: +6 -6<br />
create 3 child of same parent to call diff-2 client<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/24 08:14:31;  author: root;  state: Exp;  lines: +18 -7<br />
crate another pipe for communication between server and process<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/24 06:39:04;  author: root;  state: Exp;  lines: +3 -0<br />
read the data through pipe sent by client1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/24 06:22:18;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: RCS/client1.c,v<br />
Working file: client1.c<br />
head: 1.15<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 15;    selected revisions: 15<br />
description:<br />
client process which will replace the child process<br />
done:create the structure for operand and operation, get the pipe write fd as a command line argument<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.15<br />
date: 2014/09/27 13:21:15;  author: root;  state: Exp;  lines: +0 -2<br />
remove unwanted printf<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.14<br />
date: 2014/09/27 13:07:36;  author: root;  state: Exp;  lines: +1 -1<br />
don&#8217;t work  by ignoring so get back on handling the SIGUSR1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.13<br />
date: 2014/09/27 13:03:41;  author: root;  state: Exp;  lines: +1 -2<br />
test on signal ignore<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.12<br />
date: 2014/09/27 13:00:28;  author: root;  state: Exp;  lines: +6 -1<br />
define the signal handler and use pause till the client get the result after writing the data into pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.11<br />
date: 2014/09/27 12:54:35;  author: root;  state: Exp;  lines: +1 -0<br />
get pid of itself<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.10<br />
date: 2014/09/27 05:34:35;  author: root;  state: Exp;  lines: +1 -0<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.9<br />
date: 2014/09/27 05:25:49;  author: root;  state: Exp;  lines: +1 -0<br />
send signal to parent using kill<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8<br />
date: 2014/09/26 18:55:49;  author: root;  state: Exp;  lines: +2 -1<br />
read the result from the server end<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/09/26 18:46:32;  author: root;  state: Exp;  lines: +1 -1<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/09/26 17:59:29;  author: root;  state: Exp;  lines: +15 -8<br />
use structure to write the data into pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/09/24 14:25:10;  author: root;  state: Exp;  lines: +0 -2<br />
change the o/p appearance<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/24 09:48:23;  author: root;  state: Exp;  lines: +6 -11<br />
write operater and two operand into pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/24 08:15:04;  author: root;  state: Exp;  lines: +3 -1<br />
send the data to server and exit()<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/24 06:39:32;  author: root;  state: Exp;  lines: +5 -1<br />
write the data into pipe so that server can read that<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/24 06:24:50;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: RCS/client2.c,v<br />
Working file: client2.c<br />
head: 1.10<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 10;    selected revisions: 10<br />
description:<br />
create client 2 to do the different mathematical operation<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.10<br />
date: 2014/09/27 13:21:39;  author: root;  state: Exp;  lines: +1 -4<br />
remove unwanted printf<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.9<br />
date: 2014/09/27 13:10:11;  author: root;  state: Exp;  lines: +3 -1<br />
remove syntex error<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8<br />
date: 2014/09/27 13:08:14;  author: root;  state: Exp;  lines: +3 -1<br />
write the signal handler<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/09/27 12:49:18;  author: root;  state: Exp;  lines: +1 -0<br />
use signal<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/09/27 05:34:37;  author: root;  state: Exp;  lines: +1 -0<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/09/27 05:26:00;  author: root;  state: Exp;  lines: +2 -1<br />
send signal SIGUSR1 to server<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/27 05:12:30;  author: root;  state: Exp;  lines: +19 -8<br />
client for subtraction<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/24 16:13:23;  author: root;  state: Exp;  lines: +0 -2<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/24 09:48:57;  author: root;  state: Exp;  lines: +7 -15<br />
write into pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/24 08:39:12;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: RCS/client3.c,v<br />
Working file: client3.c<br />
head: 1.4<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 4;    selected revisions: 4<br />
description:<br />
create client 3<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/27 13:21:49;  author: root;  state: Exp;  lines: +21 -7<br />
create client for multiplication with signal handler after writing the data<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/24 14:25:40;  author: root;  state: Exp;  lines: +0 -2<br />
change the o/p appearance<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/24 09:49:23;  author: root;  state: Exp;  lines: +6 -13<br />
whrite into pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/24 08:39:54;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: RCS/process1.c,v<br />
Working file: process1.c<br />
head: 1.6<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 6;    selected revisions: 6<br />
description:<br />
this is process program which do the operation on data and return the result<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/09/27 13:26:59;  author: root;  state: Exp;  lines: +0 -1<br />
remove extra printf<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/09/26 18:46:37;  author: root;  state: Exp;  lines: +2 -0<br />
send signal using kill<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/26 17:59:53;  author: root;  state: Exp;  lines: +6 -16<br />
get the num1 and num2 from server and perform the addition operation<br />
wrirte back the sum into pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/24 14:25:49;  author: root;  state: Exp;  lines: +0 -2<br />
change the o/p appearance<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/24 14:13:02;  author: root;  state: Exp;  lines: +8 -3<br />
write the result into pipe in interger form<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/24 13:09:17;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: RCS/process2.c,v<br />
Working file: process2.c<br />
head: 1.5<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 5;    selected revisions: 5<br />
description:<br />
process to perform &#8211; operation and writing the result back into the pipe<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/09/27 13:27:12;  author: root;  state: Exp;  lines: +0 -1<br />
remove extra printf<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/27 05:13:57;  author: root;  state: Exp;  lines: +1 -1<br />
use sub instead of sum<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/27 05:12:41;  author: root;  state: Exp;  lines: +7 -15<br />
processing end for subtraction<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/24 14:25:52;  author: root;  state: Exp;  lines: +0 -2<br />
change the o/p appearance<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/24 14:14:17;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: RCS/process3.c,v<br />
Working file: process3.c<br />
head: 1.3<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 3;    selected revisions: 3<br />
description:<br />
process 3 to perform multiplication<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/27 13:22:13;  author: root;  state: Exp;  lines: +7 -16<br />
process 3 for multiplication<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/24 14:25:55;  author: root;  state: Exp;  lines: +0 -2<br />
change the o/p appearance<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/24 14:14:52;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/09/clientserver-and-process-communication-project-using-signals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Completed creating a new process using fork, how orphan process works, wait by parent till child exit</title>
		<link>https://www.emblogic.com/blog/09/completed-creating-a-new-process-using-fork-how-orphan-process-works-wait-by-parent-till-child-exit/</link>
		<comments>https://www.emblogic.com/blog/09/completed-creating-a-new-process-using-fork-how-orphan-process-works-wait-by-parent-till-child-exit/#comments</comments>
		<pubDate>Mon, 22 Sep 2014 13:03:41 +0000</pubDate>
		<dc:creator><![CDATA[Joon Vichitra]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[ipc]]></category>
		<category><![CDATA[orphan]]></category>
		<category><![CDATA[parent child]]></category>
		<category><![CDATA[wait]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11512</guid>
		<description><![CDATA[RCS file: fork.c,v Working file: fork.c head: 1.4 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 4;    selected revisions: 4 description: program to create a duplicate process using fork &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.4 date: 2014/09/18 17:37:44;  author: &#8230; <a href="https://www.emblogic.com/blog/09/completed-creating-a-new-process-using-fork-how-orphan-process-works-wait-by-parent-till-child-exit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: fork.c,v<br />
Working file: fork.c<br />
head: 1.4<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 4;    selected revisions: 4<br />
description:<br />
program to create a duplicate process using fork<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/18 17:37:44;  author: root;  state: Exp;  lines: +2 -0<br />
print child and its parent id<br />
check that orphan process have 1 as a parent id<br />
use sleep command to make sure that child not become orphan<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/18 17:34:40;  author: root;  state: Exp;  lines: +2 -2<br />
get pid of child<br />
print pid of parent<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/18 17:30:58;  author: root;  state: Exp;  lines: +11 -1<br />
create a child process using fork<br />
define the body of child and parent using if and else<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/18 17:27:22;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: fork2.c,v<br />
Working file: fork2.c<br />
head: 1.3<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 3;    selected revisions: 3<br />
description:<br />
use multiple fork to create more child and parent process<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/19 12:49:25;  author: root;  state: Exp;  lines: +5 -0<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/19 12:03:53;  author: root;  state: Exp;  lines: +2 -3<br />
create more process using multiple fork statement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/19 11:11:06;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: orphan.c,v<br />
Working file: orphan.c<br />
head: 1.4<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 4;    selected revisions: 4<br />
description:<br />
program to make a process orphan<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/20 09:36:08;  author: root;  state: Exp;  lines: +4 -2<br />
make child orphan and verify with output<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/19 13:54:25;  author: root;  state: Exp;  lines: +19 -10<br />
use if else to notify when the child became orphan<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/19 13:42:45;  author: root;  state: Exp;  lines: +4 -3<br />
get child id<br />
print parent id<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/19 13:16:57;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: wait.c,v<br />
Working file: wait.c<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;    selected revisions: 1<br />
description:<br />
parent will wait till the child exit()<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/20 14:26:58;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/09/completed-creating-a-new-process-using-fork-how-orphan-process-works-wait-by-parent-till-child-exit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
