Mail Archives: djgpp-workers/2001/05/24/01:42:10
On Wed, 23 May 2001, Laurynas Biveinis wrote:
> > ...but in 99.9% cases __internal_readlink() will call just filelength()
> > to check for 510 bytes magic size. No open() at all in this case, and plain
> > filelength() is cheaper that stat(), isn't it? Files of 510 bytes and not
> > symlinks are rare indeed. Let's see - my whole djgpp subdirectory tree takes
> > about several hundred megabytes and has ONE such file out of 20205. (Not
> > counting symlink testsuite, of course).
>
> Oh sorry, just now I have noticed the check against 510 bytes in your patch.
Yes, the size comes for free when we call findfirst/findnext, so I tested
for that, and only marked files as DT_UNKNOWN when the size is 510.
> So __internal_readlink would open the file, but it will happen once a month, or
> less frequently - maybe it's OK?
Perhaps. This should be tested, I think; but to test it, I will need a
version of `ls' that uses this feature. I hope I can do that soon.
> Another note - please include src/libc/compat/unistd/xsymlink.h and replace
> magic number with _SYMLINK_FILE_LEN from here, just in case.
Thanks for the tip.
How about moving it to some header in include/libc, then? We normally
avoid including private headers in other directories (it gets in the way
when directory structure is changed).
- Raw text -