Commit a7779d59 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Linux: re-implement eventfd() against old glibc versions

parent bb677d45
...@@ -514,7 +514,7 @@ AC_FUNC_ALLOCA ...@@ -514,7 +514,7 @@ AC_FUNC_ALLOCA
AC_CHECK_FUNCS(fcntl) AC_CHECK_FUNCS(fcntl)
dnl Check for Linux system calls dnl Check for Linux system calls
AC_CHECK_FUNCS([vmsplice eventfd]) AC_CHECK_FUNCS([vmsplice])
AH_BOTTOM([#include <vlc_fixups.h>]) AH_BOTTOM([#include <vlc_fixups.h>])
......
...@@ -53,11 +53,23 @@ ...@@ -53,11 +53,23 @@
# include <fcntl.h> # include <fcntl.h>
# include <errno.h> /* ENOSYS */ # include <errno.h> /* ENOSYS */
#endif #endif
#ifdef HAVE_SYS_EVENTFD_H
# include <sys/eventfd.h>
#endif
#include <assert.h> #include <assert.h>
#ifdef __linux__
# if defined (HAVE_SYS_EVENTFD_H)
# include <sys/eventfd.h>
# else
# include <sys/syscall.h>
static inline int eventfd (unsigned int initval, int flags)
{
return syscall (SYS_eventfd, initval, flags);
}
# endif
# define HAVE_EVENTFD 1
#endif
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
...@@ -392,7 +404,7 @@ int vlc_object_waitpipe( vlc_object_t *obj ) ...@@ -392,7 +404,7 @@ int vlc_object_waitpipe( vlc_object_t *obj )
/* This can only ever happen if someone killed us without locking: */ /* This can only ever happen if someone killed us without locking: */
assert (internals->pipes[1] == -1); assert (internals->pipes[1] == -1);
#ifdef HAVE_SYS_EVENTFD_H #ifdef HAVE_EVENTFD
internals->pipes[0] = internals->pipes[1] = eventfd (0, 0); internals->pipes[0] = internals->pipes[1] = eventfd (0, 0);
if (internals->pipes[0] == -1) if (internals->pipes[0] == -1)
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment