Skip to content
Permalink
Browse files

Fix #668, fail to build without pthread_getname_np

  • Loading branch information...
klirichek authored and adriannuta committed Jan 28, 2019
1 parent 4006794 commit 0afa2ed058e5759470b1d7354c722faab34f98bb
Showing with 5 additions and 1 deletion.
  1. +1 −0 CMakeLists.txt
  2. +3 −0 config/config_cmake.h.in
  3. +1 −1 src/sphinxstd.cpp
@@ -285,6 +285,7 @@ else ( WIN32 )
ac_check_funcs ( "nanosleep" )
ac_check_funcs ( "eventfd" )
ac_check_funcs ( "kqueue" )
ac_check_funcs ( "pthread_getname_np")
ac_check_funcs ( "getrlimit;setrlimit" )
check_function_exists ( epoll_ctl HAVE_EPOLL )
ac_search_libs ( "rt" "clock_gettime" EXTRA_LIBRARIES )
@@ -103,6 +103,9 @@
/* Define to 1 if you have the `pthread_mutex_timedlock' function. */
#cmakedefine HAVE_PTHREAD_MUTEX_TIMEDLOCK ${HAVE_PTHREAD_MUTEX_TIMEDLOCK}

/* Define to 1 if you have the `pthread_getname_np' function. */
#cmakedefine HAVE_PTHREAD_GETNAME_NP ${ HAVE_PTHREAD_GETNAME_NP }

/* Define to 1 if you have the `pthread_setname_np' function. */
#cmakedefine HAVE_PTHREAD_SETNAME_NP ${HAVE_PTHREAD_SETNAME_NP}

@@ -1022,7 +1022,7 @@ CSphString GetThreadName ( SphThread_t * pThread )
if ( !pThread || !*pThread )
return "";

#if HAVE_PTHREAD_SETNAME_NP
#if HAVE_PTHREAD_GETNAME_NP
char sClippedName[16];
pthread_getname_np ( *pThread, sClippedName, 16 );
return sClippedName;

0 comments on commit 0afa2ed

Please sign in to comment.
You can’t perform that action at this time.