Open krish2718 opened 1 year ago
@krish2718 - please note, that POSIX signals have never been supported. They are not broken.
https://docs.zephyrproject.org/latest/services/portability/posix.html#units-of-functionality
@krish2718 - please note, that POSIX signals have never been supported. They are not broken.
https://docs.zephyrproject.org/latest/services/portability/posix.html#units-of-functionality
Sure, not in Zephyr, but an application could still use libc
signal
API before that commit, so, in that sense a working application is now broken.
True signal()
is also part of C99. However, I'm not entirely sure if C signals have ever been supported in Zephyr either.
Perhaps it's best to use an existing signalling mechanism that is supported in Zephyr and has test coverage in CI.
@stephanosio - I'll leave this one up to you.
Just an aside, but the use of signal()
exists nowhere in Zephyr under tests/
or samples/
today. So there are no existing in-tree applications that are broken.
This issue is really only visible in a downstream application.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
Perhaps it's best to use an existing signalling mechanism that is supported in Zephyr and has test coverage in CI.
AFAIK we don't have anything supported now, so, should we extend this issue to add this? (else it gets closed automatically).
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
Perhaps it's best to use an existing signalling mechanism that is supported in Zephyr and has test coverage in CI.
AFAIK we don't have anything supported now, so, should we extend this issue to add this? (else it gets closed automatically).
There are many existing signalling APIs supported currently, but the one that comes to mind immediately is k_poll_signal_raise()
.
See https://docs.zephyrproject.org/apidoc/latest/group__poll__apis.html
Per-thread signalling should be supported in POSIX soon with e.g. pthread_kill()
but global (per process) signal() is likely out of scope.
See https://github.com/zephyrproject-rtos/zephyr/issues/51211
I was looking at https://docs.zephyrproject.org/latest/services/portability/posix.html#posix-signals but looking at https://github.com/zephyrproject-rtos/zephyr/issues/51211 _POSIX_SIGNALS
is what this bug refers to.
I think to fix the compiler warning is rather trivial (via #include_next <signal.h>
), but there is the obvious caveat that even the ANSI C version of that function may have unsupported or unpredictable behaviour with side effects in Zephyr at the moment.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
I will add signal support to the kernel post 3.7, and that will cover ISO C, POSIX, and Realtime signals, so I can take this.
Describe the bug An application with
CONFIG_POSIX_API
which was working before the commit is now broken.Zephyr's POSIX implementation doesn't support
signal
. Butlibc
does support it, but after the change whenCONFIG_POSIX_API
is enabled, and if we want to use POSIXsignals
then its broken as in the list of include directoriesinclude/zephyr/posix/signal.h
appears first beforelibc
headers and that file doesn't hassignal
related definitions. (It only has definitions needed to support pthread_cond_signal).To Reproduce Steps to reproduce the behavior: Clone
https://github.com/krish2718/zephyr/tree/libc_signal
and buildsamples/net/wifi
(I have used VS code to build.Expected behavior Successful build
Impact Existing application (downstream) is broken.
Logs and console output
Environment (please complete the following information):
https://github.com/krish2718/zephyr/tree/libc_signal
Additional context We could solve this in many ways:
signal
support properly to Zephyr POSIX implementation (long term)libc
headers before Zephyr, if its possible, but I don't seeprepend_include_directories
in cmake.CONFIG_POSIX_API
and instead individually enable POSIX_* modules as a hack.I am leaning towards trying out #3 or #2 for short term.
@cfriedt @stephanosio @sachinthegreen