delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/04/13:15:50

Date: Wed, 4 Feb 1998 17:46:59 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Gisle Vanem <giva AT bgnett DOT no>
cc: djgpp AT delorie DOT com
Subject: Re: FSEXT handles
In-Reply-To: <199802041036.LAA29383@login-2.eunet.no>
Message-ID: <Pine.SUN.3.91.980204174207.26317G-100000@is>
MIME-Version: 1.0

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.

- Raw text -


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