EmbLogic's Blog

Inter Process Communication between two files successfully done.

RCS file: fd.c,v
Working file: fd.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
Here Inter Process Communication is performed between two files.
—————————-
revision 1.1 locked by: root;
date: 2015/02/27 12:12:43; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

Implemented the pipe for communicating b/w two processes for IPC

RCS file: replacing.c,v
Working file: replacing.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
opened the file
—————————-
revision 1.5 locked by: root;
date: 2015/02/26 10:54:29; author: root; state: Exp; lines: +4 -2
modification in open statement
—————————-
revision 1.4
date: 2015/02/26 10:30:24; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:40:14; author: root; state: Exp; lines: +4 -2
convert fd into char
and pass the fd by argument
—————————-
revision 1.2
date: 2015/02/26 09:11:08; author: root; state: Exp; lines: +2 -2
put \n in the end of printf()
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: hello.c,v
Working file: hello.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
—————————-
revision 1.6 locked by: root;
date: 2015/02/26 10:54:51; author: root; state: Exp; lines: +1 -1
print fd
—————————-
revision 1.5
date: 2015/02/26 10:30:26; author: root; state: Exp; lines: +4 -3
*** empty log message ***
—————————-
revision 1.4
date: 2015/02/26 09:45:17; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:43:11; author: root; state: Exp; lines: +1 -1
declare buff
—————————-
revision 1.2
date: 2015/02/26 09:41:10; author: root; state: Exp; lines: +5 -0
covert the fd into int
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
include stdio.h, stdlib.h, fcntl.h &unistd.h
—————————-
revision 1.1 locked by: root;
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: replacing.c,v
Working file: replacing.c
head: 1.10
branch:
locks: strict
root: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10; selected revisions: 10
description:
opened the file
—————————-
revision 1.10 locked by: root;
date: 2015/02/27 11:18:42; author: root; state: Exp; lines: +4 -2
convert rfd, wfd into char using sprintf
—————————-
revision 1.9
date: 2015/02/27 10:32:37; author: root; state: Exp; lines: +3 -2
*** empty log message ***
—————————-
revision 1.8
date: 2015/02/27 10:23:11; author: root; state: Exp; lines: +4 -2
gave command line arguments in execl()
—————————-
revision 1.7
date: 2015/02/27 10:08:16; author: root; state: Exp; lines: +12 -1
make pipe
try to write into another file using pipe
—————————-
revision 1.6
date: 2015/02/26 11:35:47; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2015/02/26 10:54:29; author: root; state: Exp; lines: +4 -2
modification in open statement
—————————-
revision 1.4
date: 2015/02/26 10:30:24; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:40:14; author: root; state: Exp; lines: +4 -2
convert fd into char
and pass the fd by argument
—————————-
revision 1.2
date: 2015/02/26 09:11:08; author: root; state: Exp; lines: +2 -2
put \n in the end of printf()
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: hello.c,v
Working file: hello.c
head: 1.10
branch:
locks: strict
root: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10; selected revisions: 10
description:
—————————-
revision 1.10 locked by: root;
date: 2015/02/27 11:29:15; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.9
date: 2015/02/27 11:19:16; author: root; state: Exp; lines: +5 -3
*** empty log message ***
—————————-
revision 1.8
date: 2015/02/27 10:23:49; author: root; state: Exp; lines: +9 -1
*** empty log message ***
—————————-
revision 1.7
date: 2015/02/27 10:09:03; author: root; state: Exp; lines: +6 -1
try to read
—————————-
revision 1.6
date: 2015/02/26 10:54:51; author: root; state: Exp; lines: +1 -1
print fd
—————————-
revision 1.5
date: 2015/02/26 10:30:26; author: root; state: Exp; lines: +4 -3
*** empty log message ***
—————————-
revision 1.4
date: 2015/02/26 09:45:17; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:43:11; author: root; state: Exp; lines: +1 -1
declare buff
—————————-
revision 1.2
date: 2015/02/26 09:41:10; author: root; state: Exp; lines: +5 -0
covert the fd into int
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
include stdio.h, stdlib.h, fcntl.h &unistd.h
—————————-
revision 1.2 locked by: root;
date: 2015/02/27 10:07:48; author: root; state: Exp; lines: +6 -0
gave the defination of message struture
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

Inter process communication using pipe successfully done.

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
This is header file
include stdio.h stdlib.h sys/types.h unistd.h
—————————-
revision 1.2 locked by: root;
date: 2015/02/27 10:26:23; author: root; state: Exp; lines: +5 -1
define struct message
—————————-
revision 1.1
date: 2015/02/27 09:26:47; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: adder.c,v
Working file: adder.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
this is adder.c file
execl will run this process
—————————-
revision 1.4 locked by: root;
date: 2015/02/27 10:53:04; author: root; state: Exp; lines: +12 -5
write sum into pipe through wfd
—————————-
revision 1.3
date: 2015/02/27 10:27:33; author: root; state: Exp; lines: +5 -0
read struct message m through rfd.
print each element of m
—————————-
revision 1.2
date: 2015/02/27 09:55:22; author: root; state: Exp; lines: +4 -2
pass rfd to execl
—————————-
revision 1.1
date: 2015/02/27 09:46:47; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: main.c,v
Working file: main.c
head: 1.8
branch:
locks: strict
root: 1.8
access list:
symbolic names:
keyword substitution: kv
total revisions: 8; selected revisions: 8
description:
This is main.c
child process is created using fork
—————————-
revision 1.8 locked by: root;
date: 2015/02/27 10:54:13; author: root; state: Exp; lines: +2 -0
close rfd and wfd
—————————-
revision 1.7
date: 2015/02/27 10:52:25; author: root; state: Exp; lines: +6 -4
read pipe through rfd
—————————-
revision 1.6
date: 2015/02/27 10:26:56; author: root; state: Exp; lines: +9 -2
write struct message m to wfd
—————————-
revision 1.5
date: 2015/02/27 09:55:15; author: root; state: Exp; lines: +3 -1
print rfd
—————————-
revision 1.4
date: 2015/02/27 09:46:33; author: root; state: Exp; lines: +1 -1
print hello.
—————————-
revision 1.3
date: 2015/02/27 09:30:46; author: root; state: Exp; lines: +4 -3
print the rfd and wfd
—————————-
revision 1.2
date: 2015/02/27 09:27:38; author: root; state: Exp; lines: +2 -1
create a pipe
print rfd and wfd
—————————-
revision 1.1
date: 2015/02/27 09:22:38; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Linux Internals and System Programming | Leave a comment

Program that reads until 0 is entered & reports even , odd integers & their averages.

#include
2 int main()
3 {
4 int num=0,evn=0,odd=0,even_sum=0,odd_sum=0;
5
6
7 for(;;)
8 {
9 printf(“enter the numbers\n”);
10 scanf(“%d”, &num);
11
12 if(num==0)
13 {
14 break;
15 }
16
17 else if(num%2==0)
18 {
19 evn++;
20 even_sum+= num;
21 }
22
23 else if(num%2!=0)
{
25 odd++;
26 odd_sum+=num;
27 }
28 }
29
30 printf(“the total no. of even numbers is %d\n”, evn);
31 printf(“the total no. of odd numbers is %d\n”, odd);
32 printf(“\neven Sum:%d”,even_sum);
33 printf(“\nodd sum:%d\n”,odd_sum);
34 printf(“the average of evn numbers is %d\n”,(int)(even_sum/evn));
35 printf(“the average of odd numbers is %d\n”, (int)(odd_sum/odd));
36
37 return 0;
38 }
39 p

1,4 Top

Posted in Uncategorized | Leave a comment

Program representing zombie state

RCS file: zoombie.c,v
Working file: zoombie.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 describes zombie state where the child process waits for parent process for its termination section.
—————————-
revision 1.1    locked by: root;
date: 2015/02/27 06:47:33;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Program representing Zombie state

RCS file: zombie.c,v
Working file: zombie.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 describes the zombie state where the child process waits for the parent process for its termination section.
----------------------------
revision 1.1	locked by: root;
date: 2015/02/27 06:46:59;  author: root;  state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment

inter process communication using file successfully done.

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
Header file
—————————-
revision 1.2 locked by: root;
date: 2015/02/26 14:25:18; author: root; state: Exp; lines: +2 -2
include

—————————-
revision 1.1
date: 2015/02/26 14:24:00; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: replace.c,v
Working file: replace.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
replace file
—————————-
revision 1.5 locked by: root;
date: 2015/02/26 14:50:03; author: root; state: Exp; lines: +1 -1
read from file
print file content
—————————-
revision 1.4
date: 2015/02/26 14:45:12; author: root; state: Exp; lines: +18 -18
open a file
pas file discriptor to execl() process
—————————-
revision 1.3
date: 2015/02/26 14:35:06; author: root; state: Exp; lines: +1 -1
new process is created in child using execl()
—————————-
revision 1.2
date: 2015/02/26 14:30:28; author: root; state: Exp; lines: +19 -19
new process is created using fork()
—————————-
revision 1.1
date: 2015/02/26 14:24:00; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: new.c,v
Working file: new.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
new process file
—————————-
revision 1.3 locked by: root;
date: 2015/02/26 14:47:43; author: root; state: Exp; lines: +13 -13
lseek file discriptor
read file
write into file
—————————-
revision 1.2
date: 2015/02/26 14:45:50; author: root; state: Exp; lines: +13 -13
print hello
—————————-
revision 1.1
date: 2015/02/26 14:24:00; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Linux Internals and System Programming | Leave a comment

replacing the file

RCS file: replace.c,v
Working file: replace.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
include all the header file which are required
then take a file descriptor and a char type varible name as arry buff
then give the open command for a file
print the fd which is return by open commnd
—————————-
revision 1.4 locked by: root;
date: 2015/02/26 14:54:00; author: root; state: Exp; lines: +3 -3
here print the parent is active
the after the child is active
after that use the execl command for replacing the other file
and terminate the program
—————————-
revision 1.3
date: 2015/02/26 14:52:26; author: root; state: Exp; lines: +3 -2
put the switch case statement
—————————-
revision 1.2
date: 2015/02/26 14:47:51; author: root; state: Exp; lines: +2 -2
here we capture the fork into a varible
—————————-
revision 1.1
date: 2015/02/26 14:41:44; author: root; state: Exp;
Initial revision

Posted in Uncategorized | Leave a comment

implementing fork() and execl() with atoi() command to writting on file to another

RCS file: replacing.c,v
Working file: replacing.c
head: 1.1
branch:
locks: strict
emblogic: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
using pid_t command with fork
—————————-
revision 1.1    locked by: emblogic;
date: 2015/02/26 09:54:59;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: replacing.c,v
Working file: replacing.c
head: 1.1
branch:
locks: strict
emblogic: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
using pid_t command with fork
—————————-
revision 1.1    locked by: emblogic;
date: 2015/02/26 09:54:59;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: hello.c,v
Working file: hello.c
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
print the statement hello friends.
,
—————————-
revision 1.2
date: 2015/02/26 11:33:08;  author: root;  state: Exp;  lines: +4 -0
using atoi command
—————————-
revision 1.1
date: 2015/02/26 09:54:59;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.c,v
Working file: header.c
head:
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 0
description:
use unistd.h
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

implimented the fork() & execl() for writing into a file from another file.

RCS file: replacing.c,v
Working file: replacing.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
opened the file
—————————-
revision 1.5 locked by: root;
date: 2015/02/26 10:54:29; author: root; state: Exp; lines: +4 -2
modification in open statement
—————————-
revision 1.4
date: 2015/02/26 10:30:24; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:40:14; author: root; state: Exp; lines: +4 -2
convert fd into char
and pass the fd by argument
—————————-
revision 1.2
date: 2015/02/26 09:11:08; author: root; state: Exp; lines: +2 -2
put \n in the end of printf()
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: hello.c,v
Working file: hello.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
—————————-
revision 1.6 locked by: root;
date: 2015/02/26 10:54:51; author: root; state: Exp; lines: +1 -1
print fd
—————————-
revision 1.5
date: 2015/02/26 10:30:26; author: root; state: Exp; lines: +4 -3
*** empty log message ***
—————————-
revision 1.4
date: 2015/02/26 09:45:17; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:43:11; author: root; state: Exp; lines: +1 -1
declare buff
—————————-
revision 1.2
date: 2015/02/26 09:41:10; author: root; state: Exp; lines: +5 -0
covert the fd into int
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
include stdio.h, stdlib.h, fcntl.h &unistd.h
—————————-
revision 1.1 locked by: root;
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

Implementation of execl() and fork() for writing into textfile from the child process

RCS file: replacing.c,v
Working file: replacing.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
description:
i this we have used fork().
—————————-
revision 1.3    locked by: root;
date: 2015/02/26 10:37:03;  author: root;  state: Exp;  lines: +8 -3
now ew have passed fd by execl()
fd was of type int and is converted to char by sprintf to make it compatible with execl()
—————————-
revision 1.2
date: 2015/02/26 09:30:29;  author: root;  state: Exp;  lines: +12 -2
opening a textfile.
invoking execl() inside child process.
—————————-
revision 1.1
date: 2015/02/26 09:05:24;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: new.c,v
Working file: new.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
just given printf statement for printing the statement
—————————-
revision 1.2    locked by: root;
date: 2015/02/26 10:39:35;  author: root;  state: Exp;  lines: +11 -1
Firstly fd is convert back to int using atoi
then we are writting a string into textfile .
—————————-
revision 1.1
date: 2015/02/26 09:38:30;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
included stdio.h,unistd.h,stdlib.h.
—————————-
revision 1.2
date: 2015/02/26 09:33:12;  author: root;  state: Exp;  lines: +1 -1
included fcntl.h
—————————-
revision 1.1
date: 2015/02/26 09:07:30;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

Implementation of execl() and fork() for writing into textfile from the child process

RCS file: replacing.c,v
Working file: replacing.c
head: 1.3
branch:
locks: strict
	root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
In this program we have used fork()
----------------------------
revision 1.3	locked by: root;
date: 2015/02/26 10:36:34;  author: root;  state: Exp;  lines: +2 -2
nw we have passed the fd by using execl()
fd was of integer type bt execl() accepts character string so thats why we have converted int to char type by using sprintf command
----------------------------
revision 1.2
date: 2015/02/26 09:30:31;  author: root;  state: Exp;  lines: +14 -1
opening the a textfile
invoking execl inside the child process
----------------------------
revision 1.1
date: 2015/02/26 09:05:11;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
	root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
included the various header files that have beent are used in the program
----------------------------
revision 1.2	locked by: root;
date: 2015/02/26 09:33:05;  author: root;  state: Exp;  lines: +1 -0
just included a header file i.e fcntl.h for opening the file
----------------------------
revision 1.1
date: 2015/02/26 09:07:47;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: new.c,v
Working file: new.c
head: 1.2
branch:
locks: strict
	root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
just given a printf statement for printing the statement.
----------------------------
revision 1.2	locked by: root;
date: 2015/02/26 10:39:29;  author: root;  state: Exp;  lines: +8 -2
firstly we have converted back to int using atoi 
then we are writing the string into the textfile
----------------------------
revision 1.1
date: 2015/02/26 09:35:46;  author: root;  state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment

c program to pause the process using system call “wait()”

 

RCS file: header.h,v
Working file: header.h
head: 1.4
branch:
locks: strict
	root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;	selected revisions: 4
description:
it includes all the header files
----------------------------
revision 1.4	locked by: root;
date: 2015/02/25 17:38:38;  author: root;  state: Exp;  lines: +1 -0
<wait.h> is used to pause parent process using wait()
----------------------------
revision 1.3
date: 2015/02/25 17:23:47;  author: root;  state: Exp;  lines: +1 -0
<stdlib.h> is used for EXIT_FAILURE
----------------------------
revision 1.2
date: 2015/02/25 17:16:20;  author: root;  state: Exp;  lines: +1 -0
<sys/types.h> is used for variable f_ret whose datatype is pid_t
----------------------------
revision 1.1
date: 2015/02/25 17:14:14;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: wait.c,v
Working file: wait.c
head: 1.6
branch:
locks: strict
	root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6;	selected revisions: 6
description:
It is a program to pause the parent process using system call wait and to run the parent process again after the child process is finished
----------------------------
revision 1.6	locked by: root;
date: 2015/02/25 17:44:33;  author: root;  state: Exp;  lines: +4 -2
I have taken a int variable exit_code which will be returned by the exit to the location pointed by the wch contains the exit code and the PID of the last child process executed
----------------------------
revision 1.5
date: 2015/02/25 17:39:07;  author: root;  state: Exp;  lines: +19 -2
Previously parent process was terminating before the child process ...as a result there is no one to execute the termination section of the child process and the child is now an orphan child
so to overcome this i have used a system call wait in which the parent process is paused and the child process is initially finished and after that parent process is terminated .
So that the shell will not be hanged.
----------------------------
revision 1.4
date: 2015/02/25 17:29:31;  author: root;  state: Exp;  lines: +10 -0
Here i have declared a int variable n which have unique values for both parent and child process.
And i am running both the parent and child processes for the given value of n using for loop.
----------------------------
revision 1.3
date: 2015/02/25 17:24:10;  author: root;  state: Exp;  lines: +16 -0
Now i have taken 3 cases using switch statement 
First case is when f_ret is a negative value,it will print an error
Second case is when f_ret is zero , then it is a child process.
Else it is a parent process.
----------------------------
revision 1.2
date: 2015/02/25 17:17:08;  author: root;  state: Exp;  lines: +3 -0
Here i have declared a variable f_ret whose datatype is pid_t
After that i have created a child process using fork() 
Here fork is returning two values which will be copy on right in the f_ret
One value is for parent process and that value will be the PID of the child process.
Another value will be 0 when fork() is executed by the child process
----------------------------
revision 1.1
date: 2015/02/25 17:14:14;  author: root;  state: Exp;
Initial revision
=============================================================================

 

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

Getting the pid and ppid of current process and invoked process

RCS file: uppercase.c,v
Working file: uppercase.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
This program is to convert a lower case character to upper case character.
—————————-
revision 1.1    locked by: root;
date: 2015/02/25 09:46:25;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: uppercase.c,v
Working file: uppercase.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
This program is to convert a lower case character to upper case character.
—————————-
revision 1.2    locked by: root;
date: 2015/02/25 09:58:01;  author: root;  state: Exp;  lines: +2 -0
It this we are using system call i.e system() to invoke a program inside a running program.
—————————-
revision 1.1
date: 2015/02/25 09:46:25;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: uppercase.c,v
Working file: uppercase.c
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
description:
This program is to convert a lower case character to upper case character.
—————————-
revision 1.3
date: 2015/02/25 10:44:16;  author: root;  state: Exp;  lines: +2 -0
printing the pid and ppid of current program and invoked program.
—————————-
revision 1.2
date: 2015/02/25 09:58:01;  author: root;  state: Exp;  lines: +2 -0
It this we are using system call i.e system() to invoke a program inside a running program.
—————————-
revision 1.1
date: 2015/02/25 09:46:25;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Getting the pid and ppid of the current process and invoked process

RCS file: upper_case.c,v
Working file: upper_case.c
head: 1.1
branch:
locks: strict
	root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
In this program we have converted the lower case character into upper case character.
----------------------------
revision 1.1	locked by: root;
date: 2015/02/25 09:43:19;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: upper_case.c,v
Working file: upper_case.c
head: 1.2
branch:
locks: strict
	root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
In this program we have converted the lower case character into upper case character.
----------------------------
revision 1.2	locked by: root;
date: 2015/02/25 09:54:55;  author: root;  state: Exp;  lines: +2 -0
In this we are using system call i.e system() to invoke a program inside a running program .
----------------------------
revision 1.1
date: 2015/02/25 09:43:19;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: upper_case.c,v
Working file: upper_case.c
head: 1.3
branch:
locks: strict
	root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
In this program we have converted the lower case character into upper case character.
----------------------------
revision 1.3	locked by: root;
date: 2015/02/25 10:40:52;  author: root;  state: Exp;  lines: +7 -3
Nw we have just find out the process id and parent process id of the running as well as invoked program.
----------------------------
revision 1.2
date: 2015/02/25 09:54:55;  author: root;  state: Exp;  lines: +2 -0
In this we are using system call i.e system() to invoke a program inside a running program .
----------------------------
revision 1.1
date: 2015/02/25 09:43:19;  author: root;  state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment