rtems: rtems_scheduler_get_processor_set() status

In case the processor set is not large enough to contain the processor
set owned by the scheduler return RTEMS_INVALID_SIZE instead of
RTEMS_INVALID_NUMBER. This is more in line with other directives since
the issue is related to the size of an object.

Close #4401.
This commit is contained in:
Sebastian Huber
2021-05-05 14:26:01 +02:00
parent 3f0c0bfe9a
commit 48898b3a5d
2 changed files with 2 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ rtems_status_code rtems_scheduler_get_processor_set(
processor_set = _Scheduler_Get_processors( scheduler );
status = _Processor_mask_To_cpu_set_t( processor_set, cpusetsize, cpuset );
if ( status != PROCESSOR_MASK_COPY_LOSSLESS ) {
return RTEMS_INVALID_NUMBER;
return RTEMS_INVALID_SIZE;
}
return RTEMS_SUCCESSFUL;

View File

@@ -602,7 +602,7 @@ static void test_scheduler_get_processors(void)
rtems_test_assert(sc == RTEMS_INVALID_ID);
sc = rtems_scheduler_get_processor_set(scheduler_id, 0, &cpuset);
rtems_test_assert(sc == RTEMS_INVALID_NUMBER);
rtems_test_assert(sc == RTEMS_INVALID_SIZE);
sc = rtems_scheduler_get_processor_set(scheduler_id, sizeof(cpuset), &cpuset);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);