summaryrefslogtreecommitdiff
path: root/src/v4l2/v4l2_compat.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-07-22 00:31:11 +0300
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-07-25 11:57:15 +0100
commit83b3141178282b11665c4485a33b9bc3e61d7c18 (patch)
treeddd00e557bb0049af387dc7df7b54bed90d02c6a /src/v4l2/v4l2_compat.cpp
parent0c9862d6e384ae2f9d5fd0e574f9d7ed4b9f15b6 (diff)
v4l2: v4l2_compat: Fix ioctl() prototype with musl C library
The musl C library, as well as the POSIX standard, define the ioctl() function's request argument as an int. glibc and uclibc, on the other hand, define it as an unsigned long. This difference between the function prototype and the implementation in the V4L2 adaptation layer causes a compilation error with musl. Fix it by detecting the function prototype and declaring the libcamera ioctl() handler accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/v4l2/v4l2_compat.cpp')
-rw-r--r--src/v4l2/v4l2_compat.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/v4l2/v4l2_compat.cpp b/src/v4l2/v4l2_compat.cpp
index 66468bf3..6c9dca72 100644
--- a/src/v4l2/v4l2_compat.cpp
+++ b/src/v4l2/v4l2_compat.cpp
@@ -154,7 +154,11 @@ LIBCAMERA_PUBLIC int munmap(void *addr, size_t length)
return V4L2CompatManager::instance()->munmap(addr, length);
}
+#if HAVE_POSIX_IOCTL
+LIBCAMERA_PUBLIC int ioctl(int fd, int request, ...)
+#else
LIBCAMERA_PUBLIC int ioctl(int fd, unsigned long request, ...)
+#endif
{
void *arg;
extract_va_arg(void *, arg, request);