|
@@ -0,0 +1,92 @@
|
|
1
|
+--- a/lib/libv4lconvert/libv4lsyscall-priv.h
|
|
2
|
++++ b/lib/libv4lconvert/libv4lsyscall-priv.h
|
|
3
|
+@@ -35,14 +35,19 @@
|
|
4
|
+ which is broken on some systems and doesn't include them itself :( */
|
|
5
|
+
|
|
6
|
+ #ifdef linux
|
|
7
|
++#define __NEED_off_t
|
|
8
|
+ #include <sys/time.h>
|
|
9
|
+ #include <syscall.h>
|
|
10
|
+ #include <linux/types.h>
|
|
11
|
+ #include <linux/ioctl.h>
|
|
12
|
+ /* On 32 bits archs we always use mmap2, on 64 bits archs there is no mmap2 */
|
|
13
|
+ #ifdef __NR_mmap2
|
|
14
|
++#undef SYS_mmap2
|
|
15
|
+ #define SYS_mmap2 __NR_mmap2
|
|
16
|
+ #define MMAP2_PAGE_SHIFT 12
|
|
17
|
++#if !(defined(__UCLIBC__) || defined(__GLIBC__))
|
|
18
|
++typedef off_t __off_t;
|
|
19
|
++#endif
|
|
20
|
+ #else
|
|
21
|
+ #define SYS_mmap2 SYS_mmap
|
|
22
|
+ #define MMAP2_PAGE_SHIFT 0
|
|
23
|
+--- a/lib/libv4l1/v4l1compat.c
|
|
24
|
++++ b/lib/libv4l1/v4l1compat.c
|
|
25
|
+@@ -62,7 +62,7 @@ LIBV4L_PUBLIC int open(const char *file,
|
|
26
|
+ return fd;
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+-#ifdef linux
|
|
30
|
++#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
|
|
31
|
+ LIBV4L_PUBLIC int open64(const char *file, int oflag, ...)
|
|
32
|
+ {
|
|
33
|
+ int fd;
|
|
34
|
+@@ -94,7 +94,11 @@ LIBV4L_PUBLIC int dup(int fd)
|
|
35
|
+ return v4l1_dup(fd);
|
|
36
|
+ }
|
|
37
|
+
|
|
38
|
++#ifdef HAVE_POSIX_IOCTL
|
|
39
|
++LIBV4L_PUBLIC int ioctl(int fd, int request, ...)
|
|
40
|
++#else
|
|
41
|
+ LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...)
|
|
42
|
++#endif
|
|
43
|
+ {
|
|
44
|
+ void *arg;
|
|
45
|
+ va_list ap;
|
|
46
|
+@@ -112,12 +116,12 @@ LIBV4L_PUBLIC ssize_t read(int fd, void
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ LIBV4L_PUBLIC void *mmap(void *start, size_t length, int prot, int flags, int fd,
|
|
50
|
+- __off_t offset)
|
|
51
|
++ off_t offset)
|
|
52
|
+ {
|
|
53
|
+ return v4l1_mmap(start, length, prot, flags, fd, offset);
|
|
54
|
+ }
|
|
55
|
+
|
|
56
|
+-#ifdef linux
|
|
57
|
++#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
|
|
58
|
+ LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd,
|
|
59
|
+ __off64_t offset)
|
|
60
|
+ {
|
|
61
|
+--- a/lib/libv4l2/v4l2convert.c
|
|
62
|
++++ b/lib/libv4l2/v4l2convert.c
|
|
63
|
+@@ -86,7 +86,7 @@ LIBV4L_PUBLIC int open(const char *file,
|
|
64
|
+ return fd;
|
|
65
|
+ }
|
|
66
|
+
|
|
67
|
+-#ifdef linux
|
|
68
|
++#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
|
|
69
|
+ LIBV4L_PUBLIC int open64(const char *file, int oflag, ...)
|
|
70
|
+ {
|
|
71
|
+ int fd;
|
|
72
|
+@@ -121,7 +121,11 @@ LIBV4L_PUBLIC int dup(int fd)
|
|
73
|
+ return v4l2_dup(fd);
|
|
74
|
+ }
|
|
75
|
+
|
|
76
|
++#ifdef HAVE_POSIX_IOCTL
|
|
77
|
++LIBV4L_PUBLIC int ioctl(int fd, int request, ...)
|
|
78
|
++#else
|
|
79
|
+ LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...)
|
|
80
|
++#endif
|
|
81
|
+ {
|
|
82
|
+ void *arg;
|
|
83
|
+ va_list ap;
|
|
84
|
+@@ -144,7 +148,7 @@ LIBV4L_PUBLIC void *mmap(void *start, si
|
|
85
|
+ return v4l2_mmap(start, length, prot, flags, fd, offset);
|
|
86
|
+ }
|
|
87
|
+
|
|
88
|
+-#ifdef linux
|
|
89
|
++#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
|
|
90
|
+ LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd,
|
|
91
|
+ __off64_t offset)
|
|
92
|
+ {
|