Mail Archives: djgpp/2004/05/20/09:45:22
Eli Zaretskii <eliz AT gnu DOT org> wrote in message news:<u3c5vbous DOT fsf AT gnu DOT org>...
> > From: 048321887-0001 AT t-online DOT de (Udo Kuhnt)
> > Newsgroups: comp.os.msdos.djgpp
> > Date: 19 May 2004 19:47:50 -0700
> >
> > Well, I am curious - I heard that the DJGPP C library has been developed from
> > one for FreeBSD, or something like that, which probably has a working fork
> > sys call. Is this code still present in DJGPP and could it be reactivated, or
> > has it been removed because it did not seem useful?
>
> The first version of the library was a hacked libc from ISC Unix,
> followed by a ported BSD library (for more about that, see
> http://www.delorie.com/djgpp/history.html). However, the library was
> rewritten from scratch during development of DJGPP v2.0, so all traces
> of Unix are mostly gone now.
>
> In any case, there would be no sense in keeping any code from the Unix
> `fork', as `fork' is a system call on Unix systems, implemented
> entirely in the kernel, and so not really visible in the library
> sources. By contrast, a DJGPP implementation would need to be part of
> the library.
So any attempt to add support for native multitasking to the library itself
would also have to start from scratch. Well, it cannot be helped. :-/
> I've read the description of the Caldera multitasking API, but
> there's one thing I'm not sure I understood: when an application
> calls the X_PCreate function to create a new process, what program is
> executing in that process? Is that the same program as the one which
> called X_PCreate, and if so, is its memory really a copy of the
> calling process's memory, as it should be under `fork' semantics?
>
> Also, does the child process inherit the file handles from the parent?
The documentation is not very detailed, but as I understand it, X_PCreate
creates a new process (or rather a new thread) in the same address room,
while Z_Dom_Fork copies the entire address room, which probably includes the
file handles of the calling process. I think that the processes will be
identical if the callers P_CREATE_PBLK is also used for the new domain's
root process, but of course one would have to verify these assumptions.
- Raw text -