From 9c7c8186379bcd50c7f4df8b55bb5b5c89b41310 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 26 Sep 2019 16:03:40 +0100 Subject: [PATCH] d/v4l2: Use more portable sysconf(_SC_PAGESIZE) --- src/xrt/drivers/v4l2/v4l2_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xrt/drivers/v4l2/v4l2_driver.c b/src/xrt/drivers/v4l2/v4l2_driver.c index a123a2b47..6a046cde3 100644 --- a/src/xrt/drivers/v4l2/v4l2_driver.c +++ b/src/xrt/drivers/v4l2/v4l2_driver.c @@ -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;