EmbLogic's Blog

Interprocess communication using files (passing fd)…

 

RCS file: new.c,v
Working file: new.c
head: 1.5
branch:
locks: strict
	root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5;	selected revisions: 5
description:
It is another process to which initial process will communicate
----------------------------
revision 1.5	locked by: root;
date: 2015/03/01 02:36:21;  author: root;  state: Exp;  lines: +1 -1
; is added
----------------------------
revision 1.4
date: 2015/03/01 02:34:13;  author: root;  state: Exp;  lines: +13 -0
Here the fd is collected using the command line arguments 
The fd is again converted into integer value using atoi()
----------------------------
revision 1.3
date: 2015/03/01 02:26:06;  author: root;  state: Exp;  lines: +1 -1
arguments passed from execl are now collected here using command line arguments in main()
----------------------------
revision 1.2
date: 2015/03/01 02:20:29;  author: root;  state: Exp;  lines: +1 -0
just printed the hello all.
----------------------------
revision 1.1
date: 2015/03/01 02:16:51;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: replacing.c,v
Working file: replacing.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 initial process which uses execl to communicate with the another process
----------------------------
revision 1.6	locked by: root;
date: 2015/03/01 02:35:40;  author: root;  state: Exp;  lines: +1 -0
<fcntl.h> is used for opening file
----------------------------
revision 1.5
date: 2015/03/01 02:32:35;  author: root;  state: Exp;  lines: +9 -2
Now i have opened a file whose file descriptor is passed as a second argument in execl
But before passing fd is converted into a string using sprintf()
----------------------------
revision 1.4
date: 2015/03/01 02:23:15;  author: root;  state: Exp;  lines: +2 -0
child process is killed using execl and the new process is created now which will communicate with the another process
The process created will use the PID of the child process. 
----------------------------
revision 1.3
date: 2015/03/01 02:21:19;  author: root;  state: Exp;  lines: +2 -2
changed the cases in switch statements
----------------------------
revision 1.2
date: 2015/03/01 02:19:43;  author: root;  state: Exp;  lines: +18 -1
created a child process using fork()
----------------------------
revision 1.1
date: 2015/03/01 02:16:51;  author: root;  state: Exp;
Initial revision
=============================================================================

 

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

create pipe and pass a string threw it..

CS file: pipe.c,v
Working file: pipe.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
include all the header file
declare the varible
open a file for rdwr operation
—————————-
revision 1.3 locked by: root;
date: 2015/03/01 14:29:46; author: root; state: Exp; lines: +3 -2
take switch statement and make case
the parent is initiate and the child is initiated
give the execl command after writing the string into pipe
—————————-
revision 1.2
date: 2015/03/01 14:28:14; author: root; state: Exp; lines: +3 -3
creat the pipe
and print the rfd and wfd
then call the fork
—————————-
revision 1.1
date: 2015/03/01 14:27:03; author: root; state: Exp;
Initial revision

Posted in Uncategorized | Leave a comment

Succesfully transfered string via pipe (Simplex communication).

RCS file: pipe.c,v
Working file: pipe.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
Transfered string via pipe.
—————————-
revision 1.1
date: 2015/02/28 18:22:26; author: root; state: Exp;
Initial revision
=============================================================================

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

Making usb pen drive bootable for installing linux(fedora):

The usb flash drive must support booting from it & you should have iso file of linux OS.

Then follow these steps:

  • first you have to install “livecd-tools” package.
  • now plug in the pen drive & search the node using dmesg command in terminal,then unmount the partition created by it e.g.:umount /dev/sdb1
  • now use this command to make it bootable:

livecd-iso-to-disk –format –reset-mbr /home/folder/fedora15_32bit.iso /dev/sdb1

where /home/folder/fedora15_32bit.iso  is path,where iso image is present & /dev/sdb1 is path for usb pen drive.

After the terminal shows 100% complete,your usb drive becomes bootable..& this pen drive will no longer show files on windows..

thank you..

 

 

Posted in Project 1: A Linux Administration based Project | Leave a comment

2 bit mdc successfully done.

RCS file: header.h,v
Working file: header.h
head:
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 0
description:
This is header file
define prototype for compress decompress and master_array function
include stdio.h stdlib.h fcntl.h string.h
=============================================================================

RCS file: mdc.c,v
Working file: mdc.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 is mdc.c file
implement function for location and master array.
—————————-
revision 1.1 locked by: root;
date: 2015/02/28 11:07:07; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 2: Multiple Data Compression and Encryption | Tagged | Leave a comment

Inter Process Communication Using Pipes:

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:
this includes header files
different libraries used in our program
structure is also defined here,to be used in the main as well as execl initiated program.
—————————-
revision 1.1 locked by: root;
date: 2015/02/27 17:08:22; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: main.c,v
Working file: main.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
pipes are used to create a inter process communication
two file descriptors are created.one for read and other for write.
—————————-
revision 1.2 locked by: root;
date: 2015/02/27 17:28:11; author: root; state: Exp; lines: +3 -3
this is the main program we have initiated a execl program call
we have taken data from the user end and write it into another process.
—————————-
revision 1.1
date: 2015/02/27 17:08:22; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: new.c,v
Working file: new.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 arithmetic operations are performed
we have used switch statements
—————————-
revision 1.1 locked by: root;
date: 2015/02/27 17:12:18; author: root; state: Exp;
Initial revision
=============================================================================

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

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:
this includes header files
different libraries used in our program
—————————-
revision 1.1 locked by: root;
date: 2015/02/27 17:08:22; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: main.c,v
Working file: main.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 is the main program we have initaiated a execl program call
we have taken data from the user end and write it into another process.
—————————-
revision 1.2 locked by: root;
date: 2015/02/27 17:28:11; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.1
date: 2015/02/27 17:08:22; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: new.c,v
Working file: new.c
head: 1.9
branch:
locks: strict
root: 1.9
access list:
symbolic names:
keyword substitution: kv
total revisions: 9; selected revisions: 9
description:
here result is calculated.
—————————-
revision 1.3 locked by: root;
date: 2015/02/27 18:16:21; author: root; state: Exp; lines: +1 -1
result is transferred to the main program.
—————————-
revision 1.2
date: 2015/02/27 18:14:02; author: root; state: Exp; lines: +1 -1
error resolved
—————————-
revision 1.1
date: 2015/02/27 17:57:28; author: root; state: Exp;
Initial revision
=============================================================================

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

Binary search.

head 1.2;
access;
symbols;
locks
root:1.2; strict;
comment @ * @;

1.2
date 2015.02.28.09.26.43; author root; state Exp;
branches;
next 1.1;

1.1
date 2015.02.27.12.00.41; author root; state Exp;
branches;
next ;

desc
@@

1.2
log
@this program is about binary search.
@
text
@#include
#define MAX 4

int main()
{
int l=0;
int h= MAX;
int i;

int key;
int arr[MAX];
printf(“enter the array”);
for(i=0;i<MAX;i++)
{

scanf("%d", &arr[i]);
}
for(i=0;i<MAX;i++)
{
printf("%d=%d:\n", i,arr[i]);
}
printf("enter the key element \n");
scanf("%d", &key);
int m;
while(l<=h)
{
m=(l+h)/2;

if(key==arr[m])
{
printf("key element is found");
break;
}
else if (keyarr[m]&& m<l)
{
l=m+1;
printf("true");
}

else
{
printf("key element is not found");
break;

}

}
return 0;
}

@

1.1
log
@Initial revision
@
text
@d2 2
d6 22
a27 3
int l=0;
int h=9;
int i;
d29 25
a53 32
int key;
int arr[10];
printf("enter the array");
for(i=0;i<10;i++)
{

scanf("%d", &arr[i]);
}
for(i=0;i<10;i++)
{
printf("%d=%d:\n", i,arr[i]);
}
printf("enter the key element \n");
scanf("%d", &key);
while(l<=h)
{
bint m=(l+h)/2;
if(key==arr[m])
{
printf("key element is found");
break;
}
else if(keyarr[m])
l=m+1;

else if(key!=arr[m])

printf(“key element is not found”);
}
return 0;

a54 1

@

Posted in Data Structures with C | Leave a comment

Successfully implemented comm. 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
=============================================================================

RCS file: replacing.c,v
Working file: replacing.c
head: 1.15
branch:
locks: strict
root: 1.15
access list:
symbolic names:
keyword substitution: kv
total revisions: 15; selected revisions: 15
description:
opened the file
—————————-
revision 1.15 locked by: root;
date: 2015/02/28 06:42:37; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.14
date: 2015/02/28 06:40:14; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.13
date: 2015/02/28 06:29:44; author: root; state: Exp; lines: +5 -1
read the result
—————————-
revision 1.12
date: 2015/02/28 05:57:07; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2015/02/28 05:44:49; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
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: replacing.c,v
Working file: replacing.c
head: 1.15
branch:
locks: strict
root: 1.15
access list:
symbolic names:
keyword substitution: kv
total revisions: 15; selected revisions: 15
description:
opened the file
—————————-
revision 1.15 locked by: root;
date: 2015/02/28 06:42:37; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.14
date: 2015/02/28 06:40:14; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.13
date: 2015/02/28 06:29:44; author: root; state: Exp; lines: +5 -1
read the result
—————————-
revision 1.12
date: 2015/02/28 05:57:07; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2015/02/28 05:44:49; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
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.20
branch:
locks: strict
root: 1.20
access list:
symbolic names:
keyword substitution: kv
total revisions: 20; selected revisions: 20
description:
—————————-
revision 1.20 locked by: root;
date: 2015/02/28 06:44:56; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.19
date: 2015/02/28 06:42:38; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.18
date: 2015/02/28 06:40:16; author: root; state: Exp; lines: +2 -4
*** empty log message ***
—————————-
revision 1.17
date: 2015/02/28 06:30:05; author: root; state: Exp; lines: +9 -5
write the result
—————————-
revision 1.16
date: 2015/02/28 06:21:20; author: root; state: Exp; lines: +4 -4
*** empty log message ***
—————————-
revision 1.15
date: 2015/02/28 06:08:22; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.14
date: 2015/02/28 06:05:47; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.13
date: 2015/02/28 05:54:48; author: root; state: Exp; lines: +8 -1
print the received data
—————————-
revision 1.12
date: 2015/02/28 05:46:24; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2015/02/28 05:44:52; author: root; state: Exp; lines: +1 -3
*** empty log message ***
—————————-
revision 1.10
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

Program to communicate two processes..

RCS file: c1.c,v
Working file: c1.c
head: 1.1
branch:
locks: strict
	root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
Creating pipe for inter process communication 
given  execl call in the child process and passed the rfd through the command line arguments

Created a structure and passed the structure variable frm the parent process
----------------------------
revision 1.1	locked by: root;
date: 2015/02/28 06:50:21;  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:
just decleared the header files that are useful for the program i.e stdlib.h,stdio.h,unistd.h
and created the structure
----------------------------
revision 1.1	locked by: root;
date: 2015/02/28 06:52:04;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: adder.c,v
Working file: adder.c
head: 1.1
branch:
locks: strict
	root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
Collected the rfd and read the no of bytes from rfd 
printed the values of the structure attributes
c
calucated the sum
----------------------------
revision 1.1	locked by: root;
date: 2015/02/28 06:55:05;  author: root;  state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment

Program to communicate two processes

RCS file: c1.c,v
Working file: c1.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
Creating pipe for iter process communication
given execl call in the child process and passed rfd through command line arguments.
created a structure and passed the structure variable from par
—————————-
revision 1.1    locked by: root;
date: 2015/02/28 06:50:34;  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:
included stdio.h,unistd.h,stdlib.h
created a structure .
—————————-
revision 1.1    locked by: root;
date: 2015/02/28 06:52:18;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: adder.c,v
Working file: adder.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
collected the rfd
Read the no of bytes from rfd
printed the value of structure attributes.
calcuted the sum .
—————————-
revision 1.1    locked by: root;
date: 2015/02/28 06:55:19;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Reversing of array.

head 1.2;
access;
symbols;
locks
root:1.2; strict;
comment @ * @;

1.2
date 2002.01.01.01.04.00; author root; state Exp;
branches;
next 1.1;

1.1
date 2002.01.01.00.56.25; author root; state Exp;
branches;
next ;

desc
@used tem variable to interchange the position.
array is reversed with the help of temp variable.
@

1.2
log
@initialised temp=0
reversing of array is successfully completed.
@
text
@#include
int main()
{
int i=0;
int arr[10];
int temp=0;

printf(“enter the array elements\n”);
for(i=0;i<=10;i++)
{
scanf("%d", &arr[i]);
}
for(i=0;i<=10;i++)
{ printf(" array is %d:%d\n", i,arr[i]);

}

for(i=0;i<5;i++)
{
temp = arr[i];
arr[i]= arr[10-i-1];
arr[10-i-1] = temp;
}

for(i=0;i<=10;i++)
printf("array is %d:%d\n", i,arr[i]);

return 0;
}

@

1.1
log
@Initial revision
@
text
@d4 1
a4 1
int i;
d6 1
a6 1
int temp;
@

Posted in Data Structures with C | Leave a comment

Linear Search

1 #include <stdio.h>
2 int flag=1;
3 int main()
4 {
5         int arr[5];
6         int i, key;
7         printf(“Enter Array:\n”);
8         for(i=0;i<5;i++)
9         {
10                 scanf(“%d”, &arr[i]);
11         }
12         printf(“Elements of array:\n”);
13         for(i=0;i<5;i++)
14         {
15                 printf(“Araray ->%d:%d\n”,i, arr[i]);
16         }
17         printf(“Enter Key element:\n”);
18         scanf(“%d”, &key);
19         for(i=0;i<5;i++)
20                 if (arr[i] == key)
21                 {
22                         printf(“key found\n”);
23                         flag=0;
24                 }
25
26                 if(flag)
27                 {
28                         printf(“key not found\n”);
29                 }
30
31 return 0;
16,1-8        Top

Posted in Uncategorized | Leave a comment

Inter Process Communication using files:

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:
this is header file
this file includes the standard libraries required in the program.
—————————-
revision 1.1 locked by: root;
date: 2015/02/27 04:43:41; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: replace1.c,v
Working file: replace1.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 main file
in this program we have initiated a call using execl function
—————————-
revision 1.4 locked by: root;
date: 2015/02/27 15:27:16; author: root; state: Exp; lines: +1 -1
first converting the integer to the character type
since execl takes char* as a argument.
—————————-
revision 1.3
date: 2015/02/27 15:25:30; author: root; state: Exp; lines: +2 -3
sending data to the new program initiated by execl
—————————-
revision 1.2
date: 2015/02/27 05:27:27; author: root; state: Exp; lines: +5 -5
reading back the values send by execl initiated program
output is displayed.
—————————-
revision 1.1
date: 2015/02/27 04:43:41; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: new1.c,v
Working file: new1.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
this is called by execl
—————————-
revision 1.3 locked by: root;
date: 2015/02/27 05:27:31; author: root; state: Exp; lines: +1 -1
here we have used command line arguments to collect the char* values
then these values converted to integer type using atoi()
—————————-
revision 1.2
date: 2015/02/27 04:58:29; author: root; state: Exp; lines: +1 -1
reading the values transmitted by the main program
and writting the results back to the main program.
—————————-
revision 1.1
date: 2015/02/27 04:43:41; author: root; state: Exp;
Initial revision
=============================================================================

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

Sort the matrix using double pointer

RCS file: sortmat.c,v
Working file: sortmat.c
head: 1.1
branch:
locks: strict
vishal: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
Sort the matrix using double pointer
—————————-
revision 1.1 locked by: vishal;
date: 2015/02/27 20:01:49; author: vishal; state: Exp;
Initial revision

Posted in Uncategorized | Leave a comment

Read and write the data using pipe

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
vishal: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
define structer in header.h
—————————-
revision 1.1 locked by: vishal;
date: 2015/02/27 19:38:05; author: vishal; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
vishal: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
define structer in header.h
—————————-
revision 1.1 locked by: vishal;
date: 2015/02/27 19:38:05; author: vishal; state: Exp;
Initial revision
=============================================================================

RCS file: 1.c,v
Working file: 1.c
head: 1.2
branch:
locks: strict
vishal: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
Receive the file descritor and read the file form the pipe.
Use the data to perforn operation.
—————————-
revision 1.2 locked by: vishal;
date: 2015/02/27 19:48:34; author: vishal; state: Exp; lines: +1 -1
Create the pipe and save the read and write file descriptor in a array.
Fork the process and create a child.
Provide another process to child using execl.
—————————-
revision 1.1
date: 2015/02/27 19:40:18; author: vishal; state: Exp;
Initial revision
=============================================================================

RCS file: extra.c,v
Working file: extra.c
head: 1.2
branch:
locks: strict
vishal: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
forked in this program.
Then provide another process to child by using execl.
provid the the file descriptor to new by using pipe.
—————————-
revision 1.2 locked by: vishal;
date: 2015/02/27 19:47:21; author: vishal; state: Exp; lines: +1 -1
Recevie the file descriptor from the parent file .
Read the data present in the pipe and perform operation.
—————————-
revision 1.1
date: 2015/02/27 19:38:32; author: vishal; state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment