Mail Archives: djgpp/2004/05/23/20:15:51
On Sun, 23 May 2004 18:52:25 +0200 in comp.os.msdos.djgpp, "Eli
Zaretskii" <eliz AT gnu DOT org> wrote:
>> From: 048321887-0001 AT t-online DOT de (Udo Kuhnt)
>> Newsgroups: comp.os.msdos.djgpp
>> Date: 23 May 2004 06:27:29 -0700
>>
>> 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.
>
>And the latter means that just copying is not good: it is a frequent
>case that the child closes one or more of inherited handles that it
>doesn't need. You don't want that to invalidate the handle in the
>parent, since existing programs don't expect such a calamity.
>
>Se perhaps writing a (16-bit real-mode) program to test this aspect
>would be a useful first step.
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.
Alternatively, the fork routine, after copying the VM, has to look at
the child process' file handle table, and reestablish the open file
handles.
Similarly with any other OS resources the child is to "inherit".
--
Thanks. Take care, Brian Inglis Calgary, Alberta, Canada
Brian DOT Inglis AT CSi DOT com (Brian dot Inglis at SystematicSw dot ab dot ca)
fake address use address above to reply
- Raw text -