summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build9
-rw-r--r--src/v4l2/v4l2_compat.cpp4
2 files changed, 13 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 3133e2b3..495addb2 100644
--- a/meson.build
+++ b/meson.build
@@ -90,6 +90,15 @@ if cc.has_header_symbol('sys/mman.h', 'memfd_create', prefix : '#define _GNU_SOU
config_h.set('HAVE_MEMFD_CREATE', 1)
endif
+ioctl_posix_test = '''
+#include <sys/ioctl.h>
+int ioctl (int, int, ...);
+'''
+
+if cc.compiles(ioctl_posix_test)
+ config_h.set('HAVE_POSIX_IOCTL', 1)
+endif
+
if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix : '#define _GNU_SOURCE')
config_h.set('HAVE_SECURE_GETENV', 1)
endif
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);