[PATCH 2/2] posix: Use RTEMS_POSIX_API in clock_nanosleep()

Gedare Bloom gedare at rtems.org
Mon May 17 16:36:58 UTC 2021


Out of curiosity, should we refine this feature check internally to
something specific to signals?

On Mon, May 17, 2021 at 9:06 AM Joel Sherrill <joel at rtems.org> wrote:
>
> Looks ok
>
> On Mon, May 17, 2021 at 10:01 AM Sebastian Huber <sebastian.huber at embedded-brains.de> wrote:
>>
>> It is only possible to get interrupted by a POSIX signal if
>> RTEMS_POSIX_API is defined.
>> ---
>>  cpukit/posix/src/clocknanosleep.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/cpukit/posix/src/clocknanosleep.c b/cpukit/posix/src/clocknanosleep.c
>> index 73b7d9c6a1..951268bc1f 100644
>> --- a/cpukit/posix/src/clocknanosleep.c
>> +++ b/cpukit/posix/src/clocknanosleep.c
>> @@ -97,6 +97,7 @@ int clock_nanosleep(
>>    }
>>
>>    if ( rmtp != NULL && ( flags & TIMER_ABSTIME ) == 0 ) {
>> +#if defined( RTEMS_POSIX_API )
>>      if ( eno == EINTR ) {
>>        struct timespec actual_end;
>>
>> @@ -110,6 +111,10 @@ int clock_nanosleep(
>>      } else {
>>        _Timespec_Set_to_zero( rmtp );
>>      }
>> +#else
>> +    _Assert( eno != EINTR );
>> +    _Timespec_Set_to_zero( rmtp );
>> +#endif
>>    }
>>
>>    return eno;
>> --
>> 2.26.2
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list