From a46cee56d05884b8020ace6f67ef8389ac1845da Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 5 Mar 2023 13:50:40 -0800
Subject: [PATCH 1/3] ioctl does not have same signature between glibc and musl

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 modules/access/v4l2/lib.c  | 4 ++++
 modules/access/v4l2/v4l2.h | 4 ++++
 2 files changed, 8 insertions(+)

--- a/modules/access/v4l2/lib.c
+++ b/modules/access/v4l2/lib.c
@@ -49,7 +49,11 @@ int (*v4l2_fd_open) (int, int) = fd_open
 //int (*v4l2_open) (const char *, int, ...) = open;
 //int (*v4l2_dup) (const char *, int, ...) = dup;
 int (*v4l2_close) (int) = close;
+#ifdef __GLIBC__
 int (*v4l2_ioctl) (int, unsigned long int, ...) = ioctl;
+#else
+int (*v4l2_ioctl) (int, int, ...) = ioctl;
+#endif
 ssize_t (*v4l2_read) (int, void *, size_t) = read;
 //ssize_t (*v4l2_write) (int, const void *, size_t) = write;
 void * (*v4l2_mmap) (void *, size_t, int, int, int, int64_t) = mmap;
--- a/modules/access/v4l2/v4l2.h
+++ b/modules/access/v4l2/v4l2.h
@@ -28,7 +28,11 @@
 /* libv4l2 functions */
 extern int (*v4l2_fd_open) (int, int);
 extern int (*v4l2_close) (int);
+#ifdef __GLIBC__
 extern int (*v4l2_ioctl) (int, unsigned long int, ...);
+#else
+extern int (*v4l2_ioctl) (int, int, ...);
+#endif
 extern ssize_t (*v4l2_read) (int, void *, size_t);
 extern void * (*v4l2_mmap) (void *, size_t, int, int, int, int64_t);
 extern int (*v4l2_munmap) (void *, size_t);
