Mail Archives: djgpp-workers/2000/08/17/05:19:27
> Date: Thu, 17 Aug 2000 09:33:34 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
>
> fstat() needs to set S_IFLNK bit, somehow. Currently I do that with
> saving current file position, seeking to the beginning, reading first
> few bytes, comparing, restoring file position. Everything is pretty nice
> until FSEXT comes to scene.
What you described above should be a primitive which can be hooked.
> Now if I provide
> int __internal_readlink(const char * path, int fhandle, char * buf, int max);
Assuming that we won't get the user into trouble by requesting to have
the same hook that is called both from __FSEXT_call_open_handlers and
by a handle-related code, this is okay, I think.
> BTW, if file was opened for write only, __internal_readlink() would
> fail here
This should be documented. The case seems to be too marginal to be
important though: you need the _link_, not its target, to be open
write-only, and applications shouldn't need to do that.
Anyway, I think that fstat already has some degradation for write-only
files, because _is_executable needs to read the magic signature.
- Raw text -