EmbLogic's Blog

Completed creating a new process using fork, how orphan process works, wait by parent till child exit

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
—————————-
revision 1.4
date: 2014/09/18 17:37:44;  author: root;  state: Exp;  lines: +2 -0
print child and its parent id
check that orphan process have 1 as a parent id
use sleep command to make sure that child not become orphan
—————————-
revision 1.3
date: 2014/09/18 17:34:40;  author: root;  state: Exp;  lines: +2 -2
get pid of child
print pid of parent
—————————-
revision 1.2
date: 2014/09/18 17:30:58;  author: root;  state: Exp;  lines: +11 -1
create a child process using fork
define the body of child and parent using if and else
—————————-
revision 1.1
date: 2014/09/18 17:27:22;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: fork2.c,v
Working file: fork2.c
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
description:
use multiple fork to create more child and parent process
—————————-
revision 1.3
date: 2014/09/19 12:49:25;  author: root;  state: Exp;  lines: +5 -0
*** empty log message ***
—————————-
revision 1.2
date: 2014/09/19 12:03:53;  author: root;  state: Exp;  lines: +2 -3
create more process using multiple fork statement
—————————-
revision 1.1
date: 2014/09/19 11:11:06;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: orphan.c,v
Working file: orphan.c
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
description:
program to make a process orphan
—————————-
revision 1.4
date: 2014/09/20 09:36:08;  author: root;  state: Exp;  lines: +4 -2
make child orphan and verify with output
—————————-
revision 1.3
date: 2014/09/19 13:54:25;  author: root;  state: Exp;  lines: +19 -10
use if else to notify when the child became orphan
—————————-
revision 1.2
date: 2014/09/19 13:42:45;  author: root;  state: Exp;  lines: +4 -3
get child id
print parent id
—————————-
revision 1.1
date: 2014/09/19 13:16:57;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: wait.c,v
Working file: wait.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
parent will wait till the child exit()
—————————-
revision 1.1
date: 2014/09/20 14:26:58;  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>