-
Notifications
You must be signed in to change notification settings - Fork 8.1k
posix: signal: only define sigset_t if not defined
#71458
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
base: main
Are you sure you want to change the base?
posix: signal: only define sigset_t if not defined
#71458
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWICT, the external definition in picolibc and newlib is broken for the posix use case if realtime signals are enabled, depending on the platform, as unsigned long (__sigset_t) is only 32 bits on 32-bit platforms and realtime signals can add several extra bits.
Curious what @ycsin thinks about it though.
Timing-wise, I was actually in the process of defining some signal facilities at the kernel level too, so it will be interesting to see how this plays out.
I wonder how it will work out since the underlying implementation should be different? |
This only fixs the first problem, which is the compiler erroring out because of a redefinition of the struct. |
|
@JordanYates - this is still on my radar, but there is a pretty big change that I think it overlaps with. My hopes are that we can have a single location for defining |
Happy for a more complete solution upstream instead of this bandaid. |
|
A more complete solution was scheduled as a bugfix for v3.7.0, but I have my doubts that the prerequisite PRs will make it in, so it looks like the fix for this will also not be a part of v3.7 |
|
@cfriedt please revisit |
|
This pull request 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 pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|
This pull request 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 pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if the definition for sigset were moved to a separate header, <zephyr/posix/sys/_sigset.h>, and that header was included here, I would be more inclined to approve.
Why is a dedicated header preferred? It's not the pattern I see in the other usage. |
Because that's the change that I have had staged in another WIP PR for a while. |
|
This pull request 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 pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
dbb196e to
ae0931e
Compare
I don't think it is worth complicating this PR in order to align with a PR that has been WIP for almost a year, unless there is some reason why merging this change is incompatible with whatever you are working on. This is a trivial change that solves a real problem. |
Only define `sigset_t` if it has not already been defined externally, for example in `picolibc/include/sys/signal.h`. Signed-off-by: Jordan Yates <[email protected]>
ae0931e to
2484f57
Compare
|
Damn, I missed the first birthday of this PR :) |
|
This pull request 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 pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Only define
sigset_tif it has not already been defined externally, for example inpicolibc/include/sys/signal.h.This appears to be standard way of preventing redefinitions, see: