subject

Finish the code where it says //YOUR CODE HERE

//--- Definition of functions: ---//

// PURPOSE: To:
// (1) Make two pipes:
// (a) the first is for the parent process to talk to the
// child process running 'DECODER_PROG_NAME'
// (b) the second is for the child process running
// 'DECODER_PROG_NAME' to talk to the parent process.
//
// (2) Make the child process and puts its process id in global
// variable 'decoderPid'. The this child process should:
// dup2(somePipeFileDescriptor, STDIN_FILENO)
// to get its input from the "to decoder" pipe, and should:
// dup2(somePipeFileDescriptor, STDOUT_FILENO)
// to send its output to the "to parent" pipe.
// It should close() all unneeded pipe file descriptors and
// execute DECODER_PROG_NAME (a string constant defined in
// the header file).
//
// Meanwhile, the parent should close() the file descriptors
// only used by the child, set 'toDecodeFd' to the pipe file
// descriptor for talking to DECODER_PROG_NAME, and set 'toParentFd',
// to the pipe file descriptor for talking to the parent.
//
// (3) Return true (a C++ constant) on success or false otherwise.
bool didStartDecoders()
{
// I. Application validity check:
// II. Start decoder:
int toDecode[2];
int toParent[2];

// YOUR CODE HERE

// III. Finished:
return(true);
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:00
Speed is how fast an object moves a certain distance within a length of time. how is speed calculated? a) distance/time b) time/distance c) velocity/time d) distance x time
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Cloud computing service providers manage different computing resources based on the services they offer. which resources do iaas and paas providers not manage? iaas providers do not manage the for the client, whereas paas providers usually do not manage the for their clients. iaas- storage server operating system network paas- applications interafce storage vertualiation
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
The processing of data in a computer involves the interplay between its various hardware components.
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What social factors affect your health
Answers: 3
You know the right answer?
Finish the code where it says //YOUR CODE HERE

//--- Definition of functions: ---//
Questions
question
Mathematics, 11.07.2019 19:30
question
Mathematics, 11.07.2019 19:30
Questions on the website: 13722367