Starting from:

$29

Assignment 3 Create a pipe a parent process and create a child process

Questions
1. Create a pipe a parentprocessancreateachilprocesstoreaanmessagehichis ritten to that pipe the parent process.
2. rite toprograms:onecalleclient.ctheothercalleserer.c.Theclientprogramlists a prompter an reas from the keoar tointegersanoneofthecharacters+or. The rea information is transmitte ith the help of the sstem call eecl() to a chil process hich eecutes the serer coe. After the chil serer process finishes the operation it transmits the result to parentprocessclientiththehelpofthesstemcall eit(). The client process prints the result on the screen an also reprints the prompter rea for a ne reaing.
3. rite to programs file1.c an file2.c rogram file1.c uses these : a fork to launch another process
eec to replace the program riing this process hile suppling arguments to file2.c to complete its eecution c ait to complete the eecution of the chil process file1.c takes to arguments a numer less than 1 an nnumeroftermstoe ae 1 or more. or eample: file1 0.5 5 e hen the chil process finishes the parent prints: arent( yyy) one rogram file2.c reuires to arguments to otain the approimate alue of e aing the first n terms in the relation: e 1++ 22+ 33+....... an prints the result in the format: hild( yyy) or . the first terms yields . int : Chilspecific processing immeiatel folloing the fork comman shoul loa file2.c into the nel create process using the eec comman.Thiseeccommanshoulalsopass2argumentsto the chil.
4. rite a C program that takes a file nameprocess.tt as acommanlineparameteran takes the ors hichareinthepositionmultipleof3anstoreinthefile.Theselecte ors are ritten to the ispla an the input file is left unchange. Compile the C file into an eecutale name dstring. ame the C file dstring.c. o rite a C program pstring.c that implements a comman calle pstring that ou ill inoke from the shell prompt. The snta of the comman is pstring thread.tt. hen ou tpe the comman the comman opens a ne term ino terminal an then take the ors hich are in the position multiple of 3 store in the file threa.tt using the program dstring. ook up the man pages for term fork an the ifferent ariations of eec sstem calls such as eec eece eeclp etc. to o this assignment. Sumit the C files dstring.c an pstring.c. ustif the outputs.

More products