Mail Archives: djgpp/2009/03/24/17:24:13
At 05:40 PM 3/24/2009, you wrote:
> > Date: Tue, 24 Mar 2009 15:05:15 -0400
> > From: Ethan Rosenberg <ethros AT earthlink DOT net>
> >
> > 1] The program correctly opens all the files and runs. It fails
> > after about 20 writes to the files in the code that I sent you.
>
>It could fail because of reasons unrelated to the number of files
>you open.
>
> > 2] RE: The code that you sent me... which header files do I need?
>
>I didn't send any code that you should compile.
++++++++++
This is the code to which I refer -
/* See if we need to expand the tables. Check this BEFORE it might fail,
so that when we hit the count'th request, we've already up'd it. */
if ((size_t)fd >= (count-1) && count < 255)
{
int oldcount = count;
count = 255;
__file_handle_modes = (char *)malloc(count *
sizeof(*__file_handle_modes));
memcpy(__file_handle_modes, init_file_handle_modes,
sizeof(init_file_handle_modes));
memset(__file_handle_modes + oldcount, 0,
(count-oldcount)*sizeof(__file_handle_modes[0]));
/* Tell DOS to allow more */
r.h.ah = 0x67;
r.x.bx = count;
__dpmi_int(0x21, &r);
}
Did you or Rod Pemberton send me the above code?
Ethan
- Raw text -