EmbLogic's Blog

Process management(Replacing process using fork and execl)

RCS file: ./1execl.c,v
Working file: ./1execl.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
basic implementation of process replacement
—————————-
revision 1.3 locked by: root;
date: 2014/10/15 20:31:02; author: root; state: Exp; lines: +15 -5
implement return mechanism
print return value by using WEXITSTATUS(state_value)
—————————-
revision 1.2
date: 2014/10/15 19:16:05; author: root; state: Exp; lines: +1 -1
implement execl call to replace parent’s child by hello.c
observe that the replaced process has the same pid and ppid as the old parent’s child
include command’s line arguments in execl
—————————-
revision 1.1
date: 2014/10/15 18:47:07; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./2execl.c,v
Working file: ./2execl.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
Program to practice to send argument in replaced process by command line argument in main file of parent process.
—————————-
revision 1.1 locked by: root;
date: 2014/10/15 21:25:31; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./3execl.c,v
Working file: ./3execl.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
Pass the file descriptor in by convert in string format using sprint over the replaced child process from parent proces and accept in int format using sscanf.
—————————-
revision 1.2 locked by: root;
date: 2014/10/16 16:52:48; author: root; state: Exp; lines: +1 -1
write in parent process
read in replaced child process
—————————-
revision 1.1
date: 2014/10/16 16:49:24; author: root; state: Exp;
Initial revision
=============================================================================
[root@VIPIN process_replacment]#

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>