Professional Documents
Culture Documents
Adobe Scan Jun 03, 2021
Adobe Scan Jun 03, 2021
Pd
um
eumAakus T)
plpelpipaa 29Tt
(ekumadakuy 2 ~a -1)
pld r e )
aelogerrbeldsito
ope Clpelds1
loAnppesmtursye),
wwbprt11) plpelunnae
gaud keadky m plpei
-MUKage
,peaduneq
clope peldatti3) 1orf
dose tpplads[
vead phelds s toa)'
pmu (A dld R ho p/pe Mnag1 i
yeowumege)
l t potOpyojungeseppe
ekm D,ils L ) p D
Ral ) J
Sulbrat
Ayush
myem
Sudas 6otlenauédett
olus
llgg monal ad Ble on the
ual",
atele/kue de
cat lenaua
E-cat Fi
h uo wude
cat 4te leD
fda t"#/R)
ht 6ah te 19
ig11T
el Ch t 1 a $h Ae 16
um 1 r
hoohod abauo
ewenu
900 o oo
, rt
rahul@rhul-VirtualBox: -/Desktop
Btnclude<stdio.h>
#includecunistd . h>
tnt matn()_
int ptpefds[2]: _
Lnt returnstatus;
tnt p t d ;
char wrttenessages[2][20j-("Hi",
char readmessage[ 20]:
"Hello") ;
returnstatus ptpe(ptpefds):
if (returnstatus == -1)
prtntfunable to create ptpe\n")
return 1;
ptd fork() :
1I chtld process
Cptd = 0)
read(ptpefds[o]. readmessage. stzeof (readmessage)):
printr"child Process - Reading from ptpe - Message 1 ts *s\n", readmessa
9e)
read (ptpefds[o], readmessage, sizeof( readmessage)
printf("child Process - Reading from pipe - Message 2 is xs\n". readmessa
9e);
e l s e (1/Parent process
printf("Parent Process writing to ptpe - Message 1 ts xs\n", writemessa