Date: Wed, 4 Feb 1998 17:46:59 +0200 (IST) From: Eli Zaretskii To: Gisle Vanem cc: djgpp AT delorie DOT com Subject: Re: FSEXT handles In-Reply-To: <199802041036.LAA29383@login-2.eunet.no> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 4 Feb 1998, Gisle Vanem wrote: > I meant that handle X came from a home-brew socket() function that > returns handles without knowing anything about DOS-handles or other > handles. That's a bug in the implementation of `socket'. See the message posted by DJ Delorie. You need to allocate the handle using a special FSEXT function provided for this. Usually, this is done by installing an FSEXT handler for functions that open files. When that open handler is called, it looks at the file name, and if the name is some special name supported by the extension, it handles the call by calling __FSEXT_alloc_fd() and immediately installs a handler for the handle returned by __FSEXT_alloc_fd(). The latter makes sure the handle it returns is unique and will not be reused by DOS for any other file unless you close the socket first. > Maybe I have to allocate the socket() handle using __FSEXT_alloc_fd() > after all? Definitely.