libv4l-02-use-openat-when-available.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. From: Riku Voipio <riku.voipio@linaro.org>
  2. Date: Tue, 22 Jan 2013 15:37:22 +0000 (-0300)
  3. Subject: v4l-utils: use openat when available
  4. X-Git-Tag: v4l-utils-0.9.4~61
  5. X-Git-Url: http://git.linuxtv.org
  6. v4l-utils: use openat when available
  7. New architectures such as 64-Bit arm build kernels without legacy
  8. system calls - Such as the the no-at system calls. Thus, use
  9. SYS_openat whenever it is available.
  10. Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
  11. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  12. ---
  13. diff --git a/lib/libv4lconvert/libv4lsyscall-priv.h b/lib/libv4lconvert/libv4lsyscall-priv.h
  14. index 2dac49a..cdd38bc 100644
  15. --- a/lib/libv4lconvert/libv4lsyscall-priv.h
  16. +++ b/lib/libv4lconvert/libv4lsyscall-priv.h
  17. @@ -72,8 +72,13 @@ typedef off_t __off_t;
  18. #ifndef CONFIG_SYS_WRAPPER
  19. +#ifdef SYS_openat
  20. +#define SYS_OPEN(file, oflag, mode) \
  21. + syscall(SYS_openat, AT_FDCWD, (const char *)(file), (int)(oflag), (mode_t)(mode))
  22. +#else
  23. #define SYS_OPEN(file, oflag, mode) \
  24. syscall(SYS_open, (const char *)(file), (int)(oflag), (mode_t)(mode))
  25. +#endif
  26. #define SYS_CLOSE(fd) \
  27. syscall(SYS_close, (int)(fd))
  28. #define SYS_IOCTL(fd, cmd, arg) \