Skip to content

SemGetInfo partial success cases #1440

@skliper

Description

@skliper

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions