Mail Archives: djgpp/2004/05/23/09:30:56
Eli Zaretskii <eliz AT gnu DOT org> wrote in message news:<uwu33ad61 DOT fsf AT gnu DOT org>...
> > 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. :-/
- Raw text -