[libvirt] [PATCH v3 1/4] util: new function virFileLength()

Eric Blake eblake at redhat.com
Tue Nov 29 19:47:49 UTC 2016


On 11/29/2016 01:23 PM, Laine Stump wrote:
> This new function just calls fstat() (if provided with a valid fd) or
> stat() (if fd is -1) and returns st_size (or -1 if there is an
> error). We may decide we want this function to be more complex, and
> handle things like block devices - this is a placeholder (that works)
> for any more complicated function.
> ---
> Changes from V2:
> 
> * add fd arg and use it to optionally call fstat() instead of stat.
> * return -1 unless it is a "regular file" (i.e. not a block device).
> 
> Is this what you were thinking of Eric?

Yep!

ACK

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161129/4f990dfe/attachment-0001.sig>


More information about the libvir-list mailing list