Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SemGetInfo partial success cases #1440

Open
skliper opened this issue Jan 5, 2024 · 0 comments · May be fixed by #1480
Open

SemGetInfo partial success cases #1440

skliper opened this issue Jan 5, 2024 · 0 comments · May be fixed by #1480

Comments

@skliper
Copy link
Contributor

skliper commented Jan 5, 2024

Is your feature request related to a problem? Please describe.
OS_BinSemGetInfo and OS_CountSemGetInfo fill in the following structures:

/** @brief OSAL binary semaphore properties */
typedef struct
{
char name[OS_MAX_API_NAME];
osal_id_t creator;
int32 value;
} OS_bin_sem_prop_t;

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):

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant