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
<[EMAIL PROTECTED]>
: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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message