[libvirt] [PATCH 2/2] virutil: fix MinGW build

Eric Blake eblake at redhat.com
Tue Feb 3 16:53:42 UTC 2015


On 02/03/2015 06:27 AM, Pavel Hrdina wrote:
> Commit b38da584 introduced two new functions to get a page size but it
> won't work on Windows. We should take care of this.
> 
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  src/util/virutil.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 

> +#else /* WIN32 */
> +long virGetSystemPageSize(void)
> +{
> +    virReportSystemError(ENOSYS, "%s", _("Not supported on this platform"));
> +    return -1;
> +}
> +#endif /* WIN32 */

Instead of giving up completely, we should probably copy what qemu uses:

size_t getpagesize(void)
{
    SYSTEM_INFO system_info;

    GetSystemInfo(&system_info);
    return system_info.dwPageSize;
}

-- 
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/20150203/383aab00/attachment-0001.sig>


More information about the libvir-list mailing list