[LIP] Re: linux-india-programmers digest, Vol 1 #1014 - 2 msgs

"suresh kumar" <suresh_vin-/iAzse42w/[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Message-ID <[email protected]>

> Hi all.
> I'd be grateful if somebody solved this confusion I
> have about IPC using half-duplex pipes.Read on for
> where I am getting stuck.
> 
> A parent forks a child after creating a pipe using the
> pipe function.
> In the situation where child wants to read and parent
> wants to write to 
> the pipe, the child closes the fd[1] file descriptor
> and parent closes the fd[0] file descriptor, since
> these are not needed by them.What I 
> want to know is that, since the parent and child are
> working on the same address space, should'nt the
> closing of both of those file 
> descriptors( though in separate processes..) close the
> pipe.Leaving no file descriptor for reading and
> writing open.
> 
> I know I am wrong here coz this is not what happens, I
> am counting on some of you to correct me and explain
> what really goes on here.
Fork will also duplicate the file desc. If u close a file desc. in one process, it will not be closed for other process.   
> 
> Thanks.
> Shehjar
> 
> 
> 

-- 
______________________________________________
IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com 
Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!

Powered by Outblaze


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.