Mail Archives: djgpp/1998/02/04/05:37:21
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> said:
> > Lets say I create an handle X with socket() and install an extension
> > using __FSEXT_set_function (handle, func_parser). Note, socket() don't
> > use __FSEXT_add_open_handler().
> >
> > At the same time I have an open DOS file with handle Y=X.
>
> I don't understand how did you get that handle Y which is equal to X.
> A file handle is not just an integer variable with an arbitrary
> value. Its value can only be produced by certain library functions
> which call DOS.
I meant that handle X came from a home-brew socket() function that
returns handles without knowing anything about DOS-handles or other
handles. Maybe there is a global array somewhere which could tell me
what handle are allocated and avoid returning them from socket() ?
> If both `socket' and the other code which gave
> you handle Y used one of these functions, you can never have two
> different handles which have the same value, unless they are used to
> access the same file or device.
Since `socket' doesn't call _open(), there is a chance that X=Y.
Maybe I have to allocate the socket() handle using __FSEXT_alloc_fd()
after all?
Gisle V.
- Raw text -