d/v4l2: Use more portable sysconf(_SC_PAGESIZE)

This commit is contained in:
Jakob Bornecrantz 2019-09-26 16:03:40 +01:00
parent 765aec6ca1
commit 9c7c818637

View file

@ -348,7 +348,8 @@ v4l2_setup_userptr_buffer(struct v4l2_fs *vid,
struct v4l2_buffer *v_buf)
{
// align this to a memory page, v4l2 likes it that way
void *ptr = aligned_alloc(getpagesize(), v_buf->length);
long sz = sysconf(_SC_PAGESIZE);
void *ptr = aligned_alloc(sz, v_buf->length);
if (ptr == NULL) {
V_ERROR(vid, "error: Could not alloc page-aligned memory!");
return -1;