delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/05/23/16:15:25

From: "Laurynas Biveinis" <lauras AT softhome DOT net>
Date: Wed, 23 May 2001 21:42:05 +0200
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Subject: Re: Add d_type member to struct dirent
Message-ID: <20010523214205.A986@lauras.lt>
Mail-Followup-To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>,
djgpp-workers AT delorie DOT com
References: <1659-Tue22May2001182402+0300-eliz AT is DOT elta DOT co DOT il> <20010522222711 DOT A2213 AT lauras DOT lt> <3405-Wed23May2001062932+0300-eliz AT is DOT elta DOT co DOT il> <20010523181900 DOT A1817 AT lauras DOT lt> <2110-Wed23May2001203241+0300-eliz AT is DOT elta DOT co DOT il> <20010523210505 DOT A478 AT lauras DOT lt>
Mime-Version: 1.0
User-Agent: Mutt/1.3.15i
In-Reply-To: <20010523210505.A478@lauras.lt>; from lauras@softhome.net on Wed, May 23, 2001 at 09:05:05PM +0200
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

> ...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.
So __internal_readlink would open the file, but it will happen once a month, or
less frequently - maybe it's OK?

Another note - please include src/libc/compat/unistd/xsymlink.h and replace
magic number with _SYMLINK_FILE_LEN from here, just in case.

Laurynas

- Raw text -


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