A quick and dirty workaround to let the build proceed and run the testsuite - just uses a plain lock - more changes than strictly necessary to config.h.in because the backticks confuse the syntax highligther
Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (revision 11827) +++ CMakeLists.txt (working copy) @@ -413,6 +413,8 @@ check_symbol_exists(_PC_CASE_SENSITIVE unistd.h HAVE_PC_CASE_SENSITIVE) check_symbol_exists(FNM_CASEFOLD fnmatch.h HAVE_FNM_CASEFOLD) check_symbol_exists(KDMKTONE linux/kd.h HAVE_KDMKTONE) + + check_function_exists(pthread_mutex_timedlock HAVE_PTHREAD_MUTEX_TIMEDLOCK) check_include_file(pwd.h HAVE_PWD_H) check_include_file(sched.h HAVE_SCHED_H) check_function_exists(sighold HAVE_SIGHOLD) Index: common/platform/unix/SysSemaphore.cpp =================================================================== --- common/platform/unix/SysSemaphore.cpp (revision 11827) +++ common/platform/unix/SysSemaphore.cpp (working copy) @@ -202,9 +202,9 @@ */ void SysSemaphore::createTimeOut(uint32_t t, timespec &ts) { + int result = 0; struct timeval tv; - int result = 0; gettimeofday(&tv, NULL); // get current time tv.tv_usec += (t % 1000) * 1000; // add fractions of seconds if (tv.tv_usec > 1000000) // did microseconds overflow? @@ -228,7 +228,9 @@ */ bool SysSemaphore::wait(uint32_t t) // takes a timeout in msecs { + int result = 0; struct timespec ts; // fill in the timeout spec + createTimeOut(t, ts); pthread_mutex_lock(&(this->semMutex)); // Lock access to semaphore @@ -331,9 +333,13 @@ */ bool SysMutex::request(uint32_t t) { +#ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK struct timespec ts; // fill in the timeout spec SysSemaphore::createTimeOut(t, ts); return pthread_mutex_timedlock(&mutexMutex, &ts) == 0; +#else + return pthread_mutex_lock(&mutexMutex) == 0; +#endif } Index: config.h.in.cmake =================================================================== --- config.h.in.cmake (revision 11827) +++ config.h.in.cmake (working copy) @@ -3,7 +3,7 @@ /* Define to 1 if you have the <attr/xattr.h> header file. */ #cmakedefine HAVE_ATTR_XATTR_H -/* Define to 1 if you have the `catopen' function. */ +/* Define to 1 if you have the 'catopen' function. */ #cmakedefine HAVE_CATOPEN /* Define to 1 if you have the <dlfcn.h> header file. */ @@ -18,37 +18,37 @@ /* Define to 1 if you have the <filehdr.h> header file. */ #cmakedefine HAVE_FILEHDR_H -/* Define to 1 if you have the `fstat' function. */ +/* Define to 1 if you have the 'fstat' function. */ #cmakedefine HAVE_FSTAT -/* Define to 1 if you have the `gcvt' function. */ +/* Define to 1 if you have the 'gcvt' function. */ #cmakedefine HAVE_GCVT -/* Define to 1 if you have the `geteuid' function. */ +/* Define to 1 if you have the 'geteuid' function. */ #cmakedefine HAVE_GETEUID -/* Define to 1 if you have the `getpgrp' function. */ +/* Define to 1 if you have the 'getpgrp' function. */ #cmakedefine HAVE_GETPGRP -/* Define to 1 if you have the `getpwuid' function. */ +/* Define to 1 if you have the 'getpwuid' function. */ #cmakedefine HAVE_GETPWUID -/* Define to 1 if you have the `gettimeofday' function. */ +/* Define to 1 if you have the 'gettimeofday' function. */ #cmakedefine HAVE_GETTIMEOFDAY -/* Define to 1 if you have the `getuserattr' function. */ +/* Define to 1 if you have the 'getuserattr' function. */ #cmakedefine HAVE_GETUSERATTR -/* Define to 1 if you have the `IDtouser' function. */ +/* Define to 1 if you have the 'IDtouser' function. */ #cmakedefine HAVE_IDTOUSER /* Define to 1 if you have the <inttypes.h> header file. */ #cmakedefine HAVE_INTTYPES_H -/* Define to 1 if you have the `pthread' library (-lpthread). */ +/* Define to 1 if you have the 'pthread' library (-lpthread). */ #cmakedefine HAVE_LIBPTHREAD -/* Define to 1 if you have the `rt' library (-lrt). */ +/* Define to 1 if you have the 'rt' library (-lrt). */ #cmakedefine HAVE_LIBRT /* Define to 1 if you have the <limits.h> header file. */ @@ -63,7 +63,7 @@ /* Define to 1 if you have the <memory.h> header file. */ #cmakedefine HAVE_MEMORY_H -/* Define to 1 if you have the `memset' function. */ +/* Define to 1 if you have the 'memset' function. */ #cmakedefine HAVE_MEMSET /* Define to 1 if you have the <mesg.h> header file. */ @@ -78,7 +78,7 @@ /* Define to 1 if you have the <nl_types.h> header file. */ #cmakedefine HAVE_NL_TYPES_H -/* Define to 1 if you have the `nsleep' function. */ +/* Define to 1 if you have the 'nsleep' function. */ #cmakedefine HAVE_NSLEEP /* Define to 1 if you have the <pthread.h> header file. */ @@ -105,6 +105,9 @@ /* Define to 1 if KDMKTONE is a valid value */ #cmakedefine HAVE_KDMKTONE +/* Define to 1 if you the 'pthread_mutex_timedlock' function is available */ +#cmakedefine HAVE_PTHREAD_MUTEX_TIMEDLOCK + /* Define to 1 if you have the <pwd.h> header file. */ #cmakedefine HAVE_PWD_H @@ -111,16 +114,16 @@ /* Define to 1 if you have the <sched.h> header file. */ #cmakedefine HAVE_SCHED_H -/* Define to 1 if you have the `setlocale' function. */ +/* Define to 1 if you have the 'setlocale' function. */ #cmakedefine HAVE_SETLOCALE -/* Define to 1 if you have the `sighold' function. */ +/* Define to 1 if you have the 'sighold' function. */ #cmakedefine HAVE_SIGHOLD /* Define to 1 if you have the <signal.h> header file. */ #cmakedefine HAVE_SIGNAL_H -/* Define to 1 if you have the `sigprocmask' function. */ +/* Define to 1 if you have the 'sigprocmask' function. */ #cmakedefine HAVE_SIGPROCMASK /* Define to 1 if you have the <stdarg.h> header file. */ @@ -132,7 +135,7 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #cmakedefine HAVE_STDLIB_H -/* Define to 1 if you have the `strdup' function. */ +/* Define to 1 if you have the 'strdup' function. */ #cmakedefine HAVE_STRDUP /* Define to 1 if you have the <strings.h> header file. */ @@ -198,7 +201,7 @@ /* Define to 1 if you have the <ncurses.h> header file. */ #cmakedefine HAVE_NCURSES_H -/* Define to 1 if you have the `vprintf' function. */ +/* Define to 1 if you have the 'vprintf' function. */ #cmakedefine HAVE_VPRINTF /* Name of package */ E > On 9 Mar 2019, at 09:44, Enrico Sorichetti via Oorexx-devel > <oorexx-devel@lists.sourceforge.net> wrote: > > I am reporting what the compiler and the docs tell > > Fact > 1) the function is not present on Darwin > Finding ( why ) > 2) the function is not a POSIX standard so the system does not have to > provide it > > The function would work if it was there, but it is not > > AMEN > > >> On 9 Mar 2019, at 02:21, Rick McGuire <object.r...@gmail.com >> <mailto:object.r...@gmail.com>> wrote: >> >> Saying not to use it doesn't help if you are basically saying the function >> can't work. > > _______________________________________________ > Oorexx-devel mailing list > Oorexx-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/oorexx-devel
_______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel