You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.5 KiB

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