X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: 048321887-0001 AT t-online DOT de (Udo Kuhnt) Newsgroups: comp.os.msdos.djgpp Subject: Re: Using DR-DOS fork in DJGPP Date: 23 May 2004 06:27:29 -0700 Organization: http://groups.google.com Lines: 53 Message-ID: <4d201f78.0405230527.3f17fb4b@posting.google.com> References: <4d201f78 DOT 0405181653 DOT 16a677b6 AT posting DOT google DOT com> <4d201f78 DOT 0405191158 DOT 63550b51 AT posting DOT google DOT com> <7704-Wed19May2004233123+0300-eliz AT gnu DOT org> <4d201f78 DOT 0405191847 DOT 6697f90d AT posting DOT google DOT com> <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> NNTP-Posting-Host: 217.93.35.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1085318849 14315 127.0.0.1 (23 May 2004 13:27:29 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Sun, 23 May 2004 13:27:29 +0000 (UTC) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote in message news:... > > From: 048321887-0001 AT t-online DOT de (Udo Kuhnt) > > Newsgroups: comp.os.msdos.djgpp > > Date: 21 May 2004 10:13:22 -0700 > > > > Well, I do not know anything about the start command you mentioned > > On a Windows machine, type "start /?" from the DOS box's prompt, and > read there. I do no longer use Windows. ;-) > > but I thought that if Z_Dom_Fork makes an exact copy of the first 4 > > MB of the address room, then it would also copy the file handles. > > No, copying the process's address space is not enough. File handles > are indices into the OS data structure; to copy a file handle, you > need an equivalent of the `dup' system call (DOS function 45h), > otherwise handle inheritance will not work. Yes, but these data structures *are* in the process's address space; they usually reside within the first MB of the linear address space. So, by copying the VM, you also copy these file structures, meaning that the indexes will work in the new domain just like they did in the old one. If a file had been opened by the parent process, it should also be open for the child process which can access it using the same handle. If the child closes the file in its VM using the handle, it will still be open in the parent's VM. > > > It would be interesting to see what happens with this aspect of the > > > process created by X_PCreate. > > > > Since the child and parent process share the same VM, the file handles would > > probably be the same for both processes. > > ??? Are you saying that all the programs that run in the same VM have > identical handles? That's simply not true. No, but if two programs in the same VM have the same handle, they will also point to the same file handle data structure. The difference from the above being that if one of them closes a file, it will also be closed for all other programs using this handle, forcing one to duplicate it. That is why I thought that Z_Dom_Fork might more closely resemble the fork in Unix than X_PCreate, even though it functionally differs from it. > > If this succeeds, the X_PCreate function could be used to fork a new process > > in DJGPP, right? > > I think it's easier to simply ask Caldera about this. ??? Caldera is no longer in charge; DR-DOS is now owned by DeviceLogics. Unfortunately, they are not very responsive with respect of technical questions; they seem to regard most of the info as trade secrets. :-/