Mail Archives: djgpp/1997/11/23/08:25:54
Hi!
I'v ran into strange bug with djgpp fsext.
When I alloc more than one descriptors then on the others the write
command doesn't work.
An example demonstrates it:
#include <stdio.h>
#include <stdlib.h>
#include <sys/fsext.h>
int functions(__FSEXT_Fnumber func_number, int *rv, va_list args)
{
 printf ("Function: %d\n", func_number );
 return 8;
}
int main()
{
 int s1, s2;
 char x[3];
 s1 = __FSEXT_alloc_fd ( functions );
 s2 = __FSEXT_alloc_fd ( functions );
printf ("Reading 1:\n");
 read ( s1, x, 3 );
printf ("Reading 2:\n");
 read ( s2, x, 3 );
printf ("Writing 1:\n");
 write ( s1, "Hey", 3 );
printf ("Writing 2:\n");
 write ( s2, "Hey", 3 );
return 0;
}
Run it and see that read calls the function call, but write on second
descriptor doesn't.
Is it a bug in DJGPP or in me?
I am using win95 and DJGPP 2.01 on a pentium.
/* 
 *  Indrek Mandre
 *  indrek AT warp DOT edu DOT ee
 */
PS: There's a very little documentation bug in lib.inf at line 10173.
- Raw text -