qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH v6] Introduce qemu_madvise()


From: Blue Swirl
Subject: [Qemu-devel] Re: [PATCH v6] Introduce qemu_madvise()
Date: Wed, 15 Sep 2010 19:50:53 +0000

On Wed, Sep 15, 2010 at 7:35 PM, Andreas Färber <address@hidden> wrote:
> Am 15.09.2010 um 21:00 schrieb Blue Swirl:
>
>> madvise() actually
>> returns 0 or -1 with error code in errno. Should we try to match that?
>
> posix_madvise() doesn't seem to... "otherwise, an error number shall be
> returned to indicate the error"

If we match posix_madvise(), then the wrapper function probably should
become qemu_posix_madvise() and we should prefer posix_madvise() over
madvise().

> It documents EINVAL for invalid advice, and so does madvise. Are we using
> ENOTSUP knowingly?

Let's use EINVAL.

> Maybe return -1 and set errno to the posix_madvise() return code? (but is it
> errno = -retval or errno = retval then?)

An advantage of posix_madvise() semantics is that no mucking with
errno is needed. Though existing code should be checked if they rely
on madvise() semantics instead.



reply via email to

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