Re: [PATCH 02/14] Add virFileLock and virFileUnlock APIs

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

 



On 07/07/2011 08:17 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> Add some simple wrappers around the fcntl() discretionary file
> locking capability.
> 
> * src/util/util.c, src/util/util.h, src/libvirt_private.syms: Add
>   virFileLock and virFileUnlock APIs
> ---
>  src/libvirt_private.syms |    2 ++
>  src/util/util.c          |   33 +++++++++++++++++++++++++++++++++
>  src/util/util.h          |    3 +++
>  3 files changed, 38 insertions(+), 0 deletions(-)
> 
>  
> +
> +int virFileLock(int fd, bool shared, off_t start, off_t len)
> +{
> +    struct flock fl = {
> +        .l_type = shared ? F_RDLCK : F_WRLCK,
> +        .l_whence = SEEK_SET,
> +        .l_start = start,
> +        .l_len = len,
> +    };

This won't compile on mingw.  We need to either make a no-op stub, or
figure out how to do rudimentary file locking on mingw, or get gnulib to
figure it out (probably the first option is easiest for now).

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]