diff --git a/rtt/os/lxrt/fosi.c b/rtt/os/lxrt/fosi.c index d75b5c87a..c5a8a999a 100644 --- a/rtt/os/lxrt/fosi.c +++ b/rtt/os/lxrt/fosi.c @@ -259,14 +259,14 @@ int rtos_nanosleep(const TIME_SPEC *rqtp, TIME_SPEC *rmtp) return -1; } - int rtos_cond_timedwait(rt_cond_t *cond, rt_mutex_t *mutex, NANO_TIME abstime) + int rtos_cond_timedwait(rt_cond_t *cond, rt_mutex_t *mutex, NANO_TIME abs_time) { CHK_LXRT_CALL(); int ret = rt_cond_wait_until(cond->cond, mutex->sem, nano2count(abs_time) ); if (ret == 0) return 0; if ( ret == SEM_TIMOUT ) - return ETIMEOUT; + return ETIMEDOUT; return -1; } diff --git a/rtt/os/lxrt/fosi.h b/rtt/os/lxrt/fosi.h index 09e4086a4..a624b2a2a 100644 --- a/rtt/os/lxrt/fosi.h +++ b/rtt/os/lxrt/fosi.h @@ -30,7 +30,10 @@ #define _GNU_SOURCE // use all Posix features (and then some). #endif -#define _XOPEN_SOURCE 600 // use all Posix features. + +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 600 // use all Posix98 features. +#endif #define HAVE_FOSI_API @@ -79,6 +82,7 @@ extern "C" { typedef __LXRT_HANDLE_STRUCT RTOS_RTAI_TASK; typedef __LXRT_HANDLE_STRUCT RTOS_RTAI_SEM; + typedef __LXRT_HANDLE_STRUCT RTOS_RTAI_CND; #endif // OROBLD_OS_AGNOSTIC // for RTAI header files. // this is required because the rtos_sem_init function takes a pointer to RTOS_SEM, @@ -89,7 +93,7 @@ extern "C" { // this is required because the rtos_cond_init function takes a pointer to RTOS_COND, // which contains a pointer to the real RTAI cond - typedef struct oro_rtai_sem_t { + typedef struct oro_rtai_cond_t { RTOS_RTAI_CND* cond; } rt_cond_t; @@ -113,9 +117,9 @@ extern "C" { RTOS_RTAI_TASK* rtaitask; } RTOS_TASK; - const TICK_TIME InfiniteTicks = LLONG_MAX; - const NANO_TIME InfiniteNSecs = LLONG_MAX; - const double InfiniteSeconds = DBL_MAX; + static const TICK_TIME InfiniteTicks = LLONG_MAX; + static const NANO_TIME InfiniteNSecs = LLONG_MAX; + static const double InfiniteSeconds = DBL_MAX; #define SCHED_LXRT_HARD 0 /** LXRT Hard real-time */ #define SCHED_LXRT_SOFT 1 /** LXRT Soft real-time */ diff --git a/rtt/os/lxrt/fosi_internal.cpp b/rtt/os/lxrt/fosi_internal.cpp index 0d2f09b35..497bbbcd2 100644 --- a/rtt/os/lxrt/fosi_internal.cpp +++ b/rtt/os/lxrt/fosi_internal.cpp @@ -246,7 +246,7 @@ namespace RTT RT_TASK* self = rt_buddy(); if (self == 0) return -1; // non-rtai thread. We could try to compare pthreads like in gnulinux ? - if ( self == task->rtaithread ) + if ( self == task->rtaitask ) return 1; return 0; }