Computers and Technology, 11.06.2020 05:57 Zaxx2974
Two of the most fundamental functions for dealing with interprocess communication are read() and write(). Consider the following otherwise valid C program:
int r, pipeFDs[2];
char message[512];
pid_t spawnpid;
pipe(pipeFDs);
spawnpid = fork();
switch (spawnpid)
{
case 0:
close(pipeFDs[0]); // close the input file descriptor
write(pipeFDs[1], "hi process, this is the STUFF!!", 21);
break;
default:
close(pipeFDs[1]); // close output file descriptor
r = read(pipeFDs[0], message, sizeof(message));
printf("Message received from other: %s\n", message);
break;
}
Select each of the following answers that is correct. CAN BE MULTIPLE CHOICES...
(1) The read() call may block until data becomes available
(2) When the read() call returns, this one call will return all of the data that was sent through the pipe, which is different behavior than if this was a socket
(3) If the read() call blocks, the process will be suspended until data arrives
(4) The write() call will return before all of the data has been written, if the corresponding read() call blocks mid-transfer
(5) Pipes can fill, which will cause the write() call to block until the read() call is able to read data from the pipe
Answers: 2
Computers and Technology, 21.06.2019 20:30
In the context of it jobs in the information systems field. a is responsible for database design and implementation
Answers: 3
Computers and Technology, 22.06.2019 15:30
When creating a budget, log fixed expenses before income. after income. after savings. at the top.
Answers: 1
Computers and Technology, 22.06.2019 16:30
Corey set up his presentation for delivery to his team.the information he had to convey was critical to their job performance.he knew he would need a lot of time to explain each point
Answers: 3
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
Two of the most fundamental functions for dealing with interprocess communication are read() and wri...
Mathematics, 06.11.2019 06:31
History, 06.11.2019 06:31
Mathematics, 06.11.2019 06:31
Mathematics, 06.11.2019 06:31
History, 06.11.2019 06:31
English, 06.11.2019 06:31
Mathematics, 06.11.2019 06:31
English, 06.11.2019 06:31
Mathematics, 06.11.2019 06:31
Spanish, 06.11.2019 06:31
Mathematics, 06.11.2019 06:31