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

fixes #23700, amend Sigaction fields in posix #23710

Closed
wants to merge 6 commits into from

Conversation

litlighilit
Copy link
Contributor

@litlighilit litlighilit commented Jun 12, 2024

fixes #23700:

Also for:

  • openbsd, freebsd, netbsd, dragonfly
  • macos

@litlighilit litlighilit marked this pull request as draft August 1, 2024 12:36
@litlighilit litlighilit marked this pull request as ready for review August 1, 2024 14:53
@litlighilit
Copy link
Contributor Author

ping @Araq

@@ -313,6 315,12 @@ type
si_band*: int ## Band event for SIGPOLL.
si_value*: SigVal ## Signal value.

template sa_sigaction*(v: Sigaction): proc (x: cint, y: ptr SigInfo, z: pointer) {.noconv.} =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why a public template for an importc'd C function ?, can it be just a proc ?. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sa_sigaction and sa_handler are within an union.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though in fact when I rewrote them, I didn't realize the previous also works.

@litlighilit
Copy link
Contributor Author

litlighilit commented Aug 1, 2024

I myself doubt if this patch is worth to merge.
I didn't realized it till it's almost finished that the previous implementation just works.

So this PR in fact mainly plays a role of providing a better document comment.

Last but not least, I think this PR improves maintainability, that's why I finally finished it.

@Araq
Copy link
Member

Araq commented Sep 6, 2024

Pretending that it's an object with multiple fields when it's a union in reality will only things worse for NVLM.

@Araq Araq closed this Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SigAction isn't missing a field on amd64?
3 participants