In article <1d5c01bf5c42$1409d990$[EMAIL PROTECTED]> you wrote:

> You've got that backwards - fork() and vfork() can easily be implemented in
> terms of rfork() [in fact, I believe all three are implemented in terms of
> fork1() in the kernel].  rfork(RFMEM) means that the processes share all
> memory - current AND FUTURE.  You could use minherit() before fork() to
> share current memory, but not future memory.

BTW, concerning rfork(RFMEM). Could somebody explain me, why the
following simple program is coredumping:

#include <stdio.h>
#include <unistd.h>

volatile int data=0;

int
main()
{
   volatile int pid=0;
   int status;

   pid=rfork(RFPROC|RFMEM|RFCFDG);
   if(pid==-1) {
      perror("rfork");
      exit(-1);
   }
   if(pid!=0) {
      wait(&status);
      printf("Data is %d\n",data);
   } else
      data=1;
}

--- 
The world is coming to an end.  Please log off.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to