delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/05/29/06:41:35

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Sat, 29 May 2004 12:44:13 +0200
From: "Eli Zaretskii" <eliz AT gnu DOT org>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-Id: <9003-Sat29May2004124412+0300-eliz@gnu.org>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <4d201f78.0405262343.1d5baa0e@posting.google.com>
(048321887-0001 AT t-online DOT de)
Subject: Re: Using DR-DOS fork in DJGPP
References: <uoeok2abs DOT fsf AT gnu DOT org> <7704-Wed19May2004233123+0300-eliz AT gnu DOT org> <4d201f78 DOT 0405191847 DOT 6697f90d AT posting DOT google DOT com> <u3c5vbous DOT fsf AT gnu DOT org> <4d201f78 DOT 0405200540 DOT 307bb15a AT posting DOT google DOT com> <9743-Thu20May2004201223+0300-eliz AT gnu DOT org> <4d201f78 DOT 0405210913 DOT 26a5ffcb AT posting DOT google DOT com> <uwu33ad61 DOT fsf AT gnu DOT org> <4d201f78 DOT 0405230527 DOT 3f17fb4b AT posting DOT google DOT com> <2719-Sun23May2004185224+0300-eliz AT gnu DOT org> <f7f2b0tp6atvgj7rgqg83bo9mo2asdsndf AT 4ax DOT com> <4d201f78 DOT 0405262343 DOT 1d5baa0e AT posting DOT google DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: 048321887-0001 AT t-online DOT de (Udo Kuhnt)
> Newsgroups: comp.os.msdos.djgpp
> Date: 27 May 2004 00:43:26 -0700
> > 
> > Copying the VM is not sufficient: the OS also has to know which file
> > handles the parent process has open, and set up the child process so
> > that it has the same open file handles. 
> 
> This is exactly what "copying the VM" means - all data structures of the old
> VM are being copied into the the new one, including the file data structures.
> So the handles of the child are an exact copy of the parent's ones.

I already explained in another message in this thread that a copy is
not what we want, if we want to emulate the Posix semantics of `fork'.
File handle inheritance is not a simple copy.

Btw, the documentation of Z_DomFork (which is what we are discussing,
I presume) does not say that it simply copies the current VM, it says:

  Z_DomFork creates an exact copy of the current domain, then creates
  a process in it and starts the process executing. The process is
  specified in the PCREATE_PBLK which is identical to that used in the
  X_PCreate call [...]

So after the VM is copied, a new process is started in it.  Whether
this is the same process as the one that called Z_DomFork, and if so,
whether it begins from the same point where we called Z_DomFork, is
left unspecified.

So the question which started this thread, namely: how we can write
an emulation of the Posix `fork' using this API, still stands.

> > Similarly with any other OS resources the child is to "inherit".
> 
> What other resources are you referring to?

Signal handlers, for one.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019