Mail Archives: djgpp/2004/05/24/00:48:18
> From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT Invalid>
> Newsgroups: comp.os.msdos.djgpp
> Date: Mon, 24 May 2004 00:11:44 GMT
>
> Alternatively, the fork routine, after copying the VM, has to look at
> the child process' file handle table, and reestablish the open file
> handles.
I don't see how this could be done, at least not easily. We don't
need just to have the same file open, we need their file handles to
refer to the same entry in the DOS System File Table (SFT), so that if
the child moves the file position (by, e.g., reading or seeking into
the file), the file position of the parent is moved as well to the
same place. I.e., we need the equivalent of the `dup' system call
(except that we cannot call `dup' because it doesn't work with handles
from another process).
Therefore, if the DR-DOS's fork doesn't handle these problems, there's
no way we could, unless we know enough about DR-DOS internals to
manipulate the SFT entries directly.
- Raw text -