Computers and Technology
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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:10, josued123321
Alook-up table used to convert pixel values to output values on a monitor. essentially, all pixels with a value of 190 or above are shown as white (i. e. 255), and all values with a value of 63 or less are shown as black (i. e. 0). in between the pixels are scaled so that a pixel with a value p is converted to a pixel of value 2/127 −+3969). if a pixel has a value of 170 originally, what value will be used to display the pixel on the monitor? if a value of 110 is used to display the pixel on the monitor, what was the original value of the pixel?
Answers: 1
image
Computers and Technology, 23.06.2019 21:50, Trinhphuongtran
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
image
Computers and Technology, 24.06.2019 02:10, ttangelique
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
image
Computers and Technology, 24.06.2019 09:30, kyreesegordon
Retype the statements, correcting the syntax errors. system. out. println("num: " + songnum); system. out. println(int songnum); system. out. println(songnum " songs"); note: these activities may test code with different test values. this activity will perform two tests: the first with songnum = 5, the second with songnum = 9. see how to use zybooks.
Answers: 1
Do you know the correct answer?
Two of the most fundamental functions for dealing with interprocess communication are read() and wri...

Questions in other subjects:

Konu
Mathematics, 16.08.2021 05:20
Konu
Mathematics, 16.08.2021 05:20