From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <44DDD0D0.1020104@comtv.ru> Date: Sat, 12 Aug 2006 17:00:00 +0400 From: Victor Nazarov User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] APE fork() References: <244c66f368a1f475aa51195812191aac@mail.gmx.net> In-Reply-To: <244c66f368a1f475aa51195812191aac@mail.gmx.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 9cb6d78c-ead1-11e9-9d60-3106f5b1d025 Sascha Retzki wrote: >>POSIX-fork() copies data and bss segmets, child process doesn't share >>data with it's parent. >> >> > >I thought it does share the segments. And I think I saw this behaviour on Linux and some BSDs. > > >Maybe my minds fools me again > > Fork copies memory, see man pages or google for it. When fork() occurs, child process inherits the exact copy of parents memory at the time of fork. So child will see all changes and settings, you have done _befor_ fork. You may take this behavior for sharing memory. -- Victor