Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!pasteur!paris.Berkeley.EDU!mcgrath From: mcgrath@paris.Berkeley.EDU (Roland McGrath) Newsgroups: comp.unix.wizards Subject: Do a vfork parent and child share file descriptors? Message-ID: Date: 10 Jun 89 07:05:37 GMT Sender: news@pasteur.Berkeley.EDU Organization: Hackers Anonymous International, Ltd., Inc. (Applications welcome) Lines: 26 If I create a child with `vfork', memory is shared between the parent and child. What else is shared? Are file descriptors shared? What happens if I do: if (vfork () == 0) { /* Child side. */ close (fd_created_above); execve (...); } /* Parent side. */ ... What happens to `fd_created_above' in the parent. I'm using a Sun 3 running Sun Unix 3.5, but I assume this is the same for all 4.2 BSD derivatives. Please MAIL YOUR RESPONSE to roland@ai.mit.edu, and ONLY RESPOND IF YOU KNOW WHAT YOU'RE TALKING ABOUT. -- Roland McGrath Free Software Foundation, Inc. roland@ai.mit.edu, uunet!ai.mit.edu!roland