Date: Thu, 1 Jul 1999 15:30:12 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Julian Elischer <julian@whistle.com> Cc: current@FreeBSD.ORG Subject: Re: Rfork man page entry & reality. Message-ID: <199907012230.PAA50452@apollo.backplane.com> References: <Pine.BSF.3.95.990701151919.13958H-100000@current1.whistle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Yes, you are absolutely right. It should also say: rfork() cannot be directly called from C when used with RFMEM, because C cannot deal with the fact that both processes return to the same stack. ( As an aside, we really need a linunx clone()-like system call so we can make use of this very cool rfork() threading feature. I wrote some example code a few months ago which someone can dig up for the core if they want to do it. If we can simply duplicate the linux clone from the compat libs it would be very cool if it were made available in our standard libs ). -Matt Matthew Dillon <dillon@backplane.com> :The Rfork man page says: : RFMEM If set, the kernel will force sharing of the entire ad- : dress space. The child will then inherit all the shared : segments the parent process owns. Other segment types : will be unaffected. Subsequent forks by the parent will : then propagate the shared data and bss between children. : The stack segment is always split. May be set only with : RFPROC. : :However the code says: : : if (flags & RFMEM) { : p2->p_vmspace = p1->p_vmspace; : p1->p_vmspace->vm_refcnt++; : } : : :My guess is that the man page should be changed to say: : : RFMEM If set, the kernel will force sharing of the entire ad- : dress space. The child will then inherit all the memory : segments the parent process owns. This is the basis of some : thread models. May be set only with RFPROC. : :Any better suggestions of wording will be apreciated.. :I'll check in a change of whatever sounds best :after a day or so.. : :julian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907012230.PAA50452>