<?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; Mohit Jain</title>
	<atom:link href="https://www.emblogic.com/blog/author/mohitjain0491/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>Execl file replacement</title>
		<link>https://www.emblogic.com/blog/09/execl-file-replacement/</link>
		<comments>https://www.emblogic.com/blog/09/execl-file-replacement/#comments</comments>
		<pubDate>Tue, 02 Sep 2014 11:44:30 +0000</pubDate>
		<dc:creator><![CDATA[Mohit Jain]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11448</guid>
		<description><![CDATA[Sir I have made two files in home/vivek/process directory named fork.c and add.c and I had made one child process and then call execl function by giving its path/file name then file name and then NULL argument. But it is &#8230; <a href="https://www.emblogic.com/blog/09/execl-file-replacement/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Sir I have made two files in home/vivek/process directory named fork.c and add.c and I had made one child process and then call execl function by giving its path/file name then file name and then NULL argument. But it is not executing execl function and gave output as it is giving in child and parent. I have attached my code blelow</p>
<p># include<br />
# include<br />
# include<br />
#include<br />
#include</p>
<p>int main()<br />
{<br />
	pid_t pid;<br />
	int n,k;<br />
	pid=fork();<br />
	if(pid&gt;0)<br />
	{<br />
		wait(&amp;k);<br />
		WIFEXITED(k);<br />
		n=2;<br />
		printf(&#8220;\nmy argument is=%d\n&#8221;,WEXITSTATUS(k));<br />
		printf(&#8220;\ni am a parent and my id=%d\n&#8221;,getpid());<br />
	}<br />
	else<br />
	{<br />
		execl(&#8220;./add.c&#8221;,&#8221;add&#8221;,NULL);<br />
		n=4;<br />
		printf(&#8220;\ni am a child and my id=%d\n&#8221;,getpid());<br />
	}<br />
	return(n);<br />
}</p>
<p>#include</p>
<p>int main()<br />
{<br />
	int a,b,sum;<br />
	a=3;<br />
	b=6;<br />
	printf(&#8220;\nenter value of a=&#8221;);<br />
	scanf(&#8220;%d&#8221;,&amp;a);<br />
	printf(&#8220;\nenter value of b=&#8221;);<br />
	scanf(&#8220;%d&#8221;,&amp;b);<br />
	printf(&#8220;\nfinal result&#8221;);<br />
	sum=a+b;<br />
	printf(&#8220;\nsum=%d\n&#8221;,sum);<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/09/execl-file-replacement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
