Fix #1103, Implement OS_ERR_INVALID_PRIORITY return code check for RTEMS #1378
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Describe the contribution
OS_ERR_INVALID_PRIORITYnot used #1103OS_ERR_INVALID_PRIORITYerror return code for RTEMS (inOS_TaskCreate()) andOS_TaskSetPriority().For POSIX, OSAL uses the internal function
OS_PriorityRemap()to convert to a suitable (and not invalid) priority value before callingpthread_setschedprio().For VxWorks,
taskPrioritySet()does setERRNOtoS_taskLib_ILLEGAL_PRIORITY, but I have not tried to include it in this PR. The issue can be left open if someone wants to look at that, or closed for now with this PR.Testing performed
I don't think this file (
rtems/src/os-impl-tasks.c) has any tests currently (see #1207).If someone can advise if this needs to be tested, and the best way of doing so, I would appreciate it.
Expected behavior changes
Calls on the RTEMS implementation to
OS_TaskCreate()(which callsrtems_task_create()) andOS_TaskSetPriority()(which callsrtems_task_set_priority()) will now actually returnOS_ERR_INVALID_PRIORITYif the RTEMS calls returnRTEMS_INVALID_PRIORITY, rather than simply returning OS_ERROR.Contributor Info
Avi Weiss @thnkslprpt