coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "ls -l": Avoid unnecessary getxattr() overhead


From: Eric Blake
Subject: Re: "ls -l": Avoid unnecessary getxattr() overhead
Date: Fri, 17 Feb 2012 06:53:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0

On 02/17/2012 03:35 AM, Jim Meyering wrote:

> Instead, I've realized that I can eliminate the need for the wc post-
> processing by using the fact that our contrived output file is seekable:
> rather than simply writing to fd, first seek to position 0 each time,
> and write the count:

> 
>   # Finally, to test it, do this:
>   eval "LD_PRELOAD=$PWD/k.so ls --color=always -l . $fd>x" || exit 1
> 
> Hmm... that means the case of no getxattr calls would still
> require a little special handling to map "empty file" to "0".

No.  Just add 'echo 0 >x' prior to the actual test, so that x is never
empty.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]