Date: Wed, 4 Feb 1998 11:36:54 +0100 (CET) Message-Id: <199802041036.LAA29383@login-2.eunet.no> From: "Gisle Vanem" To: djgpp AT delorie DOT com cc: eliz AT is DOT elta DOT co DOT il Subject: Re: FSEXT handles MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Precedence: bulk Eli Zaretskii 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.