<?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; process replacement</title>
	<atom:link href="https://www.emblogic.com/blog/tag/process-replacement/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>Replacing a Process Image</title>
		<link>https://www.emblogic.com/blog/01/replacing-a-process-image/</link>
		<comments>https://www.emblogic.com/blog/01/replacing-a-process-image/#comments</comments>
		<pubDate>Fri, 15 Jan 2016 10:40:34 +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[exec]]></category>
		<category><![CDATA[execl]]></category>
		<category><![CDATA[execv]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[process replacement]]></category>
		<category><![CDATA[Replacing a Process Image]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=13167</guid>
		<description><![CDATA[Replacing a Process Image ========================= - The exec function replaces current process with a new process. - The path of new process is specified as argument to exec. - It is defined in header : #include&#60;unistd.h&#62; - Last argument of &#8230; <a href="https://www.emblogic.com/blog/01/replacing-a-process-image/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Replacing a Process Image<br />
=========================<br />
- The exec function replaces current process with a new process.<br />
- The path of new process is specified as argument to exec.<br />
- It is defined in header :<br />
#include&lt;unistd.h&gt;<br />
- Last argument of function should be NULL.<br />
- It has 6 types of functions, whose prototype are :-<br />
(i) Complete path is specified<br />
int execl(const char * path, const char * arg0,const char * arg1,&#8230;,NULL);<br />
(ii) If file is at one of default paths<br />
int execlp(const char * file, const char * arg0,const char * arg1,&#8230;,NULL);<br />
(iii) If arguments are given as an vector(array)<br />
int execv(const char *path,char *const argv[]);<br />
(iv) If arguments are given as an vector(array) and file is at one of default paths<br />
int execvp(const char* file, char *const argv[]);<br />
(v) int execle(const char *path, const char * arg0, const char * arg1,&#8230;,NULL, char *const envp[]);<br />
(vi) int execve(const char *path, char *const argv[],char *const envp[] );</p>
<p>- The suffix p means to search PATH environmental variable.</p>
<p>- If the exec is executed successfully the statements after it will not be executed.<br />
- It is because the current process is replaced.<br />
- The arguments given to exec are used by main() function of new process as command line argument.<br />
- If exec fails, it returns -1<br />
- The open file descriptors remain open after the exec command.<br />
- These file descriptors can be passed to exec as command and can be used by the replaced process to read/write from opened file.<br />
- The argument is passed to exec as character.<br />
- For this sprintf() is used.<br />
- And for getting the file descriptors back , atoi() or integer typecasting can be used on the arguments of main().</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/replacing-a-process-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Process replacement using execl</title>
		<link>https://www.emblogic.com/blog/09/process-replacement-using-execl/</link>
		<comments>https://www.emblogic.com/blog/09/process-replacement-using-execl/#comments</comments>
		<pubDate>Mon, 22 Sep 2014 13:09:46 +0000</pubDate>
		<dc:creator><![CDATA[Joon Vichitra]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>
		<category><![CDATA[execl]]></category>
		<category><![CDATA[ipc]]></category>
		<category><![CDATA[process replacement]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11514</guid>
		<description><![CDATA[RCS file: p_replace.c,v Working file: p_replace.c head: 1.2 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 2;    selected revisions: 2 description: program to replace the child process using execl() &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.2 date: 2014/09/22 10:22:30;  author: &#8230; <a href="https://www.emblogic.com/blog/09/process-replacement-using-execl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: p_replace.c,v<br />
Working file: p_replace.c<br />
head: 1.2<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 2;    selected revisions: 2<br />
description:<br />
program to replace the child process using execl()<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/22 10:22:30;  author: root;  state: Exp;  lines: +9 -1<br />
use wait statement so that parent will wait till the child completed its execution<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/22 10:06:47;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>RCS file: child.c,v<br />
Working file: child.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 />
sample program which replace the child when call by child through execl()<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/22 10:06:07;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/09/process-replacement-using-execl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
