Date: Thu, 17 Aug 2000 17:25:05 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: lauras AT softhome DOT net Message-Id: <6480-Thu17Aug2000172504+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b CC: djgpp-workers AT delorie DOT com In-reply-to: <399BE30E.AA1F3E6C@softhome.net> (message from Laurynas Biveinis on Thu, 17 Aug 2000 15:05:18 +0200) Subject: Re: Patch: __internal_readlink() References: <399BE30E DOT AA1F3E6C AT softhome DOT net> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Thu, 17 Aug 2000 15:05:18 +0200 > From: Laurynas Biveinis > > +int __internal_readlink(const char * __path, int __fhandle, char * __buf, > + size_t __max) > +{ > + ssize_t bytes_read = 0; > + char buf[_SYMLINK_FILE_LEN]; > + char * data_buf; > + int fd; > + struct ffblk file_info; > + int ret; > + off_t old_pos = 0; > + long file_size; > + > + /* Provide ability to hook symlink support */ > + if (__FSEXT_call_open_handlers(__FSEXT_readlink, &ret, &__path)) > + return ret; This is not so simple in this particular case, since __internal_readlink can be called either with a file name or with a handle. In the latter case, __FSEXT_call_open_handlers will not do, because it searches the wrong list of handlers. I think you need to test for handle-or-path up front, and if you get a handle, use code such as _close does: __FSEXT_Function *func = __FSEXT_get_function(handle); if (func) { ... Of course, if you already tested the code you've posted, and it works, then disregard my comments ;-).