From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 16 Sep 1997 15:00:44 -0500 From: G. David Butler gdb@dbSystems.com Subject: [9fans] Re: bug in aux/listen Topicbox-Message-UUID: 66cf625a-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19970916200044.0Hf_REpx0DGaMyr1ao1zflU-a7y1GXpVUAIheZfRfBQ@z> From: rob@plan9.bell-labs.com > >> saying that subsequent forks by the *parent*, if called with RFMEM, >> will share data and bss between children of the *parent*. Subsequent >> forks of the children are not affected unless they too do a RFMEM. > >The flag gets set on the segment, not the process. Any process created >with that segment mapped will see the same segment. Let me look again. Hmmm... Ah, there it is, hiding at the top... switch(s->type&SG_TYPE) { case SG_TEXT: case SG_SHARED: case SG_PHYSICAL: case SG_SHDATA: incref(s); return s; Ok, once it is marked shared any new fork, no matter what the share flag is set to, will get the *same* segment. Wow, you need to be careful with RFMEM!!! I stand corrected. David Butler