Download File

Download File Download File

mycnis.weebly.com
from mycnis.weebly.com More from this publisher
22.07.2013 Views

o after all calls to close If the parent wants to receive data from the child, it should close fd1, and the child should close fd0. If the parent wants to send data to the child, it should close fd0, and the child should close fd1. Since descriptors are shared between the parent and child, we should always be sure to close the end of pipe we aren't concerned with. On a technical note, the EOF will never be returned if the unnecessary ends of the pipe are not explicitly closed. NP Lab Manual , RNEC P a g e | 4 For more Details access portals : ravinuthalavs.webs.com Ravinuthalavs.blogspot.com

WEEK 1: Aim: Implement the pipe using fork () /* file name pipe.c */ # include # include # include # define MAXLINE 4096 int main() { int n,fd[2]; pid_t pid; char line[MAXLINE]; if(pipe(fd)

o after all calls to close<br />

If the parent wants to receive data from the child, it should close fd1, and the child should<br />

close fd0. If the parent wants to send data to the child, it should close fd0, and the child<br />

should close fd1. Since descriptors are shared between the parent and child, we should<br />

always be sure to close the end of pipe we aren't concerned with. On a technical note, the<br />

EOF will never be returned if the unnecessary ends of the pipe are not explicitly closed.<br />

NP Lab Manual , RNEC P a g e | 4<br />

For more Details access portals : ravinuthalavs.webs.com<br />

Ravinuthalavs.blogspot.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!