0001-fix-uclibc-eventfd.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Use eventfd() function with uClibc
  2. The Boost eventfd code either directly makes the eventfd system call
  3. using __NR_eventfd (when __GLIBC_MINOR is less than 8), or otherwise
  4. uses the eventfd() function provided by the C library.
  5. However, since uClibc pretends to be glibc 2.2, the Boost eventfd code
  6. directly uses the system call. While it works fine on most
  7. architectures, it doesn't on ARC since __NR_eventfd is not defined on
  8. this architecture. However, eventfd() is properly implemented.
  9. So, this patch adjusts the logic used by Boost to consider uClibc as a
  10. C library providing the eventfd() function.
  11. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  12. Index: b/boost/asio/detail/impl/eventfd_select_interrupter.ipp
  13. ===================================================================
  14. --- a/boost/asio/detail/impl/eventfd_select_interrupter.ipp
  15. +++ b/boost/asio/detail/impl/eventfd_select_interrupter.ipp
  16. @@ -23,7 +23,7 @@
  17. #include <sys/stat.h>
  18. #include <sys/types.h>
  19. #include <fcntl.h>
  20. -#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 8
  21. +#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 8 && !defined(__UCLIBC__)
  22. # include <asm/unistd.h>
  23. #else // __GLIBC__ == 2 && __GLIBC_MINOR__ < 8
  24. # include <sys/eventfd.h>
  25. @@ -46,7 +46,7 @@
  26. void eventfd_select_interrupter::open_descriptors()
  27. {
  28. -#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 8
  29. +#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 8 && !defined(__UCLIBC__)
  30. write_descriptor_ = read_descriptor_ = syscall(__NR_eventfd, 0);
  31. if (read_descriptor_ != -1)
  32. {