Mail Archives: djgpp-workers/2000/08/17/10:22:44
> Date: Thu, 17 Aug 2000 15:05:18 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
>
> +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 ;-).
- Raw text -