3 https://github.com/xbmc/xbmc/pull/7551
6 From a6d6a1a36ff2dff2586fbad2a068e7df14b55fdc Mon Sep 17 00:00:00 2001
7 From: Bernd Kuhls <bernd.kuhls@t-online.de>
8 Date: Sun, 19 Jul 2015 14:12:03 +0200
9 Subject: [PATCH 1/1] ALSA: fix device change event support
11 Current uClibc version 0.9.33.2 does not support eventfd_read/write.
13 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
15 configure.ac | 5 ++++-
16 xbmc/linux/FDEventMonitor.cpp | 12 ++++++++++++
17 2 files changed, 16 insertions(+), 1 deletion(-)
19 diff --git a/configure.ac b/configure.ac
20 index d321f7d..4c6c750 100644
23 @@ -911,7 +911,7 @@ AC_FUNC_STRFTIME
27 -AC_CHECK_FUNCS([atexit dup2 fdatasync floor fs_stat_dev ftime ftruncate getcwd gethostbyaddr gethostbyname gethostname getpagesize getpass gettimeofday inet_ntoa lchown localeconv memchr memmove memset mkdir modf munmap pow rmdir select setenv setlocale socket sqrt strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strspn strstr strtol strtoul sysinfo tzset utime posix_fadvise localtime_r])
28 +AC_CHECK_FUNCS([atexit dup2 fdatasync floor fs_stat_dev ftime ftruncate getcwd gethostbyaddr gethostbyname gethostname getpagesize getpass gettimeofday inet_ntoa lchown localeconv memchr memmove memset mkdir modf munmap pow rmdir select setenv setlocale socket sqrt strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strspn strstr strtol strtoul sysinfo tzset utime posix_fadvise localtime_r eventfd_read eventfd_write])
30 # Check for various sizes
31 AC_CHECK_SIZEOF([int])
32 @@ -2064,6 +2064,9 @@ fi
33 if test "$use_alsa" = "yes"; then
35 AC_DEFINE([USE_ALSA],[1],["Define to 1 if alsa is installed"])
36 + if test "$ac_cv_func_eventfd_read" = "yes" -a "$ac_cv_func_eventfd_write" = "yes"; then
37 + AC_DEFINE([HAVE_EVENTFD],[1],["Define to 1 if eventfd is installed"])
39 final_message="$final_message\n ALSA:\t\tYes"
42 diff --git a/xbmc/linux/FDEventMonitor.cpp b/xbmc/linux/FDEventMonitor.cpp
43 index 4a41477..84efeb9 100644
44 --- a/xbmc/linux/FDEventMonitor.cpp
45 +++ b/xbmc/linux/FDEventMonitor.cpp
48 #include "FDEventMonitor.h"
51 +static int eventfd_read(int __fd, eventfd_t *__value)
53 + return read(__fd, __value, sizeof(eventfd_t)) == sizeof(eventfd_t) ? 0 : -1;
56 +static int eventfd_write(int __fd, eventfd_t __value)
58 + return write(__fd, &__value, sizeof(eventfd_t)) == sizeof(eventfd_t) ? 0 : -1;
62 CFDEventMonitor::CFDEventMonitor() :
63 CThread("FDEventMonitor"),