Mail Archives: djgpp/2002/02/15/11:45:54
Eli Zaretskii wrote:
>
> > From: CBFalconer <cbfalconer AT yahoo DOT com>
> > Newsgroups: comp.os.msdos.djgpp
> > Date: Fri, 15 Feb 2002 11:58:27 GMT
> >
> > But that doesn't explain why the static 'firstime' control failed?
>
> I think it failed because malloc is called from the startup code more
> than once. So the condition guarded the very first call, but not the
> others.
That doesn't hang together, because the version with no \r spat
out confused output, but I could tell from it that there was only
one call to sbrk involved. For testing the writing I am using a
very small test sample, so that no further blocks need be
assigned. Note that the enabled debuggery ONLY fires when malloc
needs a new block, and not on further calls to malloc.
>
> > The file system to receive 'write' has no more reason to be
> > initialized at that point than does cprintf, does it?
>
> The call to `write' doesn't need any initializations, assuming you
> write to handles 1 or 2, which are already preconnected when the
> program starts. `write' is more or less straightforward path to a DOS
> call (you can use `_write' if you want to be even closer to the DOS
> call, but in that case, you will need to use "\r\n" to end a line).
What is the relationship of file handle numbers to destinations?
I assume 1 and 2 correspond to stdin and stderr in some order?
Haven't dug into DOS at that level for 10 years or more.
--
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
Available for consulting/temporary embedded and systems.
(Remove "XXXX" from reply address. yahoo works unmodified)
mailto:uce AT ftc DOT gov (for spambots to harvest)
- Raw text -