Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Report actual errno / error string from C library calls #302

Open
jphickey opened this issue Sep 1, 2021 · 0 comments
Open

Report actual errno / error string from C library calls #302

jphickey opened this issue Sep 1, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@jphickey
Copy link
Contributor

jphickey commented Sep 1, 2021

Is your feature request related to a problem? Please describe.
During startup, the PSP makes several calls into C library functions, and an unexpected failure of these functions causes the system to abort/not start. However, the error messages reported do not include any detail of what went wrong.

Example:

if ((key = ftok(CFE_PSP_CDS_KEY_FILE, 'R')) == -1)
{
OS_printf("CFE_PSP: Cannot Create CDS Shared memory key!\n");
exit(-1);
}

Describe the solution you'd like
On any system call that sets the global errno value, if that function fails, this should be included in the error that is printed to the console. At a bare minimum, could include the numeric value, but far preferable to use the system library call to print in a more human-friendly form, such as strerror() or perror() if the system provides it.

Additional context
Should probably also not use OS_printf() here due to its extra buffering, see #203, #299

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey added the enhancement New feature or request label Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant