summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-09-14 12:07:46 -0500
committerGitHub <noreply@github.com>2016-09-14 12:07:46 -0500
commit67f05c995e777c007427f7071e4ae7246390e821 (patch)
tree0ba19f380a393e5ba2c6826ed21ca86b6649fca2
parent0b0953db926fc22f5cd93180461e7a98153628c5 (diff)
parent96c3ac0ae69f2a3dea6fea6fdc3a217853108cdb (diff)
downloadjack1-67f05c995e777c007427f7071e4ae7246390e821.tar.gz
Merge pull request #45 from jeremyhu/master
Check for clock_nanosleep before use
-rw-r--r--configure.ac14
-rw-r--r--drivers/dummy/dummy_driver.c2
-rw-r--r--drivers/dummy/dummy_driver.h2
3 files changed, 16 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 49cf862..85e32d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -285,6 +285,20 @@ AC_CHECK_FUNC(clock_gettime,
])
)
+AC_CHECK_FUNC(clock_nanosleep,
+ [
+ AC_DEFINE(HAVE_CLOCK_NANOSLEEP,0,"Whether or not clock_nanosleep can be found in system libraries")
+ ],
+ #
+ # if not found, check librt specifically
+ #
+ AC_CHECK_LIB(rt, clock_nanosleep,
+ [
+ AC_DEFINE(HAVE_CLOCK_NANOSLEEP,1,"Whether or not clock_nanosleep can be found in system libraries")
+ OS_LDFLAGS="$OS_LDFLAGS -lrt"
+ ])
+)
+
# should we use mlockall() on this platform?
if test "x$JACK_DO_NOT_MLOCK" = "x"; then
AC_CHECK_HEADER(sys/mman.h,
diff --git a/drivers/dummy/dummy_driver.c b/drivers/dummy/dummy_driver.c
index d414cb1..b8e1b9c 100644
--- a/drivers/dummy/dummy_driver.c
+++ b/drivers/dummy/dummy_driver.c
@@ -73,7 +73,7 @@ FakeVideoSync ( dummy_driver_t *driver )
}
}
-#ifdef HAVE_CLOCK_GETTIME
+#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_NANOSLEEP)
static inline unsigned long long ts_to_nsec (struct timespec ts)
{
return ts.tv_sec * 1000000000LL + ts.tv_nsec;
diff --git a/drivers/dummy/dummy_driver.h b/drivers/dummy/dummy_driver.h
index 296f027..4daf182 100644
--- a/drivers/dummy/dummy_driver.h
+++ b/drivers/dummy/dummy_driver.h
@@ -43,7 +43,7 @@ struct _dummy_driver {
jack_nframes_t period_size;
unsigned long wait_time;
-#ifdef HAVE_CLOCK_GETTIME
+#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_NANOSLEEP)
struct timespec next_wakeup;
#else
jack_time_t next_time;