|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 3/5] tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error
Hi Costin, On 10/05/2021 09:35, Costin Lupu wrote:
Hmmm... Sorry I only realized now that the manpage suggests that getpagesize() is legacy: SVr4, 4.4BSD, SUSv2. In SUSv2 the getpagesize() call is labeled LEGACY, and in POSIX.1-2001 it has been dropped; HP-UX does not have this call. And then:Portable applications should employ sysconf(_SC_PAGESIZE) instead of getpagesize():
#include <unistd.h>
long sz = sysconf(_SC_PAGESIZE);
As this is only used by Linux, it is not clear to me whether this is
important. Ian, what do you think?
- if ( pfn_arr_size <= PAGE_SIZE )+ if ( pfn_arr_size <= os_page_size ) Your commit message suggests we are only s/PAGE_SHIFT/XC_PAGE_SHIFT/ but this is using getpagesize() instead. I agree it should be using the OS size. However, this should be clarified in the commit message. The rest of the patch looks fine to me . Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |