delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/23/08:25:54

Date: Sun, 23 Nov 1997 12:25:44 +0200 (EET)
From: Indrek Mandre <indrek AT warp DOT edu DOT ee>
To: djgpp AT delorie DOT com
Subject: Bug in djgpp? (fsext)
Message-ID: <Pine.LNX.3.95.971123121832.152A-100000@warp.edu.ee>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019