Mail Archives: djgpp/1996/06/26/08:02:29
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 -