www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/26/08:02:29

Message-Id: <s1d1cd40.027@MAIL.TAIT.CO.NZ>
Date: Wed, 26 Jun 1996 23:52:41 +1200
From: Bill Currie <bill_currie AT MAIL DOT TAIT DOT CO DOT NZ>
To: djgpp AT delorie DOT com
Subject: Re: FSE, some questions

On 26/6/96  9:07 pm, Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De> did thus say
>>>
> First question:
> In the info file for __FSEXT_alloc_fd():
> 
> "The module is responsible for calling _close() on
> the descriptor after setting the handler function to 
> zero in the extended close handler"
> 
> What I tried was
> [...]
>   case __FSEXT_close :{
>      int fd = va_arg(args, int);
>      // Shutdown COM-Handler....
>      [...]
>      _close(fd);
>      return EMULATED;
> [...]
> This caused _close to trigger my handler again, obviously
> not what I intended. 

looking at the approriate source files (src/libc/dos/compat/d_close.c and
src/libc/dos/io/_close.c) I would say that maybe the docs should have said
_dos_close rather than _close (DJ, Eli, is this correct?) as _close calls the fse
functions but _dos_close does not.

> Second Question:
> Can fcntl() be extended to communicate with a File
> System Extension handler? I'm thinking of something
> like
>  fd=open("/dev/ttyS0",O_NOBLOCK| O_RDWR);
>  fcntl(fd,F_SETCOM, S9600 | B8 |P_NONE |XON_XOFF);  
> 

I think this would be a good idea and shouldn't be too dificult to implement (a
new enum entry (__FSEXT_fcntl ??) and approrialt mods the fcntl function
(basicaly a block copy from, say, _clsoe.c (lines 16-22 in the version I have)
changing the __FSEXT_close to __FSEXT_close.

I hope this helps
Bill

- Raw text -


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