-
Notifications
You must be signed in to change notification settings - Fork 241
Description
Is your feature request related to a problem? Please describe.
OS_BinSemGetInfo
and OS_CountSemGetInfo
fill in the following structures:
osal/src/os/inc/osapi-binsem.h
Lines 38 to 44 in 1a8823f
/** @brief OSAL binary semaphore properties */ | |
typedef struct | |
{ | |
char name[OS_MAX_API_NAME]; | |
osal_id_t creator; | |
int32 value; | |
} OS_bin_sem_prop_t; |
osal/src/os/inc/osapi-countsem.h
Lines 32 to 37 in 1a8823f
typedef struct | |
{ | |
char name[OS_MAX_API_NAME]; | |
osal_id_t creator; | |
int32 value; | |
} OS_count_sem_prop_t; |
Where name and creator may be valid but not all implementations fill in value (ex. RTEMS):
osal/src/os/rtems/src/os-impl-binsem.c
Lines 275 to 279 in 1a8823f
int32 OS_BinSemGetInfo_Impl(const OS_object_token_t *token, OS_bin_sem_prop_t *bin_prop) | |
{ | |
/* RTEMS has no API for obtaining the current value of a semaphore */ | |
return OS_SUCCESS; | |
} |
Note the following PR changes the RTEMS return to OS_ERR_NOT_IMPLEMENTED
Describe the solution you'd like
Consider splitting the API into 2 or 3. GetValue could return value or unimplemented error. GetName/GetCreator or similar could return the other two.
Describe alternatives you've considered
None
Additional context
Partial success API's are not user friendly and should be avoided.
Requester Info
Jacob Hageman - NASA/GSFC