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.

96 lines
2.5 KiB

  1. --- a/lib/libv4lconvert/libv4lsyscall-priv.h
  2. +++ b/lib/libv4lconvert/libv4lsyscall-priv.h
  3. @@ -35,18 +35,23 @@
  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. #else
  17. #define SYS_mmap2 SYS_mmap
  18. #define MMAP2_PAGE_SHIFT 0
  19. #endif
  20. +#if !(defined(__UCLIBC__) || defined(__GLIBC__))
  21. +typedef off_t __off_t;
  22. +#endif
  23. #endif
  24. #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
  25. --- a/lib/libv4l1/v4l1compat.c
  26. +++ b/lib/libv4l1/v4l1compat.c
  27. @@ -62,7 +62,7 @@ LIBV4L_PUBLIC int open(const char *file,
  28. return fd;
  29. }
  30. -#ifdef linux
  31. +#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
  32. LIBV4L_PUBLIC int open64(const char *file, int oflag, ...)
  33. {
  34. int fd;
  35. @@ -94,7 +94,11 @@ LIBV4L_PUBLIC int dup(int fd)
  36. return v4l1_dup(fd);
  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. LIBV4L_PUBLIC void *mmap(void *start, size_t length, int prot, int flags, int fd,
  49. - __off_t offset)
  50. + off_t offset)
  51. {
  52. return v4l1_mmap(start, length, prot, flags, fd, offset);
  53. }
  54. -#ifdef linux
  55. +#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
  56. LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd,
  57. __off64_t offset)
  58. {
  59. --- a/lib/libv4l2/v4l2convert.c
  60. +++ b/lib/libv4l2/v4l2convert.c
  61. @@ -86,7 +86,7 @@ LIBV4L_PUBLIC int open(const char *file,
  62. return fd;
  63. }
  64. -#ifdef linux
  65. +#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
  66. LIBV4L_PUBLIC int open64(const char *file, int oflag, ...)
  67. {
  68. int fd;
  69. @@ -121,7 +121,11 @@ LIBV4L_PUBLIC int dup(int fd)
  70. return v4l2_dup(fd);
  71. }
  72. +#ifdef HAVE_POSIX_IOCTL
  73. +LIBV4L_PUBLIC int ioctl(int fd, int request, ...)
  74. +#else
  75. LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...)
  76. +#endif
  77. {
  78. void *arg;
  79. va_list ap;
  80. @@ -144,7 +148,7 @@ LIBV4L_PUBLIC void *mmap(void *start, si
  81. return v4l2_mmap(start, length, prot, flags, fd, offset);
  82. }
  83. -#ifdef linux
  84. +#if defined(linux) && (defined(__GLIBC__) || defined(__UCLIBC__))
  85. LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd,
  86. __off64_t offset)
  87. {