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

posix: signal: include_next to get the libc signal() decl #60948

Closed

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Jul 29, 2023

Note: Coding Guidellines issue is a false positive

Although the ANSI C version of signal() is not yet supported in Zephyr, because Zephyr does not use process-wide signals, some users rely on its declaration.

Include the libc version of signal.h when POSIX signals are not configured.

Also fixed some inadvertent typing to be more compliant with the spec.

Fixes #56294

@cfriedt cfriedt force-pushed the include-next-for-signal branch 6 times, most recently from f1fe0bb to d13e68c Compare July 30, 2023 13:58
@cfriedt cfriedt marked this pull request as ready for review July 30, 2023 14:04
@cfriedt cfriedt requested a review from nashif as a code owner July 30, 2023 14:04
@cfriedt cfriedt requested a review from jgl-meta July 30, 2023 14:04
@cfriedt cfriedt added area: Tests Issues related to a particular existing or missing test area: POSIX POSIX API Library labels Jul 30, 2023
@zephyrbot zephyrbot added the area: C Library C Standard Library label Jul 30, 2023
@cfriedt cfriedt added the bug The issue is a bug, or the PR is fixing a bug label Jul 30, 2023
@cfriedt
Copy link
Member Author

cfriedt commented Jul 30, 2023

Unrelated errors are unrelated.

ycsin
ycsin previously approved these changes Jul 30, 2023
Copy link
Member

@ycsin ycsin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edited: please ignore this, overlooked some of the tests

@cfriedt
Copy link
Member Author

cfriedt commented Aug 10, 2023

This is getting annoying. I might trim it down to the bare essentials.

We don't actually implement signal() in Zephyr, but some users
require the declaration.

Additionally, typedef sig_atomic_t since it is part of ISO.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Some declarations were not visible when including the POSIX
version of `<time.h>` or `<signal.h>`.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
We don't actually implement signal() in Zephyr, but some users
require the declaration.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The `signal()` function was part of ANSI-C and predates
POSIX, so it should be visible (even if it completely
unsupported in Zephyr currently).

The `sig_atomic_t` type is part of ISO C, regardless of
whether POSIX is enabled.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
@cfriedt cfriedt marked this pull request as draft August 10, 2023 20:21
@cfriedt
Copy link
Member Author

cfriedt commented Aug 19, 2023

Closing in favour of the other signal.h PR

@cfriedt cfriedt closed this Aug 19, 2023
@cfriedt cfriedt deleted the include-next-for-signal branch January 26, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: C Library C Standard Library area: POSIX POSIX API Library area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using signals from libc is broken
4 participants