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

Fix signal handler #3

Open
elfring opened this issue Jul 29, 2014 · 5 comments
Open

Fix signal handler #3

elfring opened this issue Jul 29, 2014 · 5 comments

Comments

@elfring
Copy link

elfring commented Jul 29, 2014

The functions "ioctl" and "exit" do not belong to the list of async-signal-safe functions.
I guess that a different program design will be needed for your functions "gpm_winch_hook" and "killed".

@telmich
Copy link
Owner

telmich commented Jul 29, 2014

@elfring It is nice to point out - are you going to submit a PR later on?

@elfring
Copy link
Author

elfring commented Jul 29, 2014

Would you like to consider software design options like the following?

@telmich
Copy link
Owner

telmich commented Jul 29, 2014

In theory yes, the question is more about who is going to implement them, I guess

@elfring
Copy link
Author

elfring commented Jul 29, 2014

Are you willing to dedicate another thread for receiving of notifications by the function "sigwaitinfo" or "select"?

@vapier
Copy link
Contributor

vapier commented Mar 11, 2016

that random link is broken now, so here's the official list of async-signal-safe functions.

wrt kill, none of those funcs are safe -- printf (via CLEAR), fprintf, or exit. I/O streams can be holding locks when the signal comes in, and exit can run atexit handlers which can do anything. so that func should be changed to use write;fsync;_exit and it should be fine.

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

No branches or pull requests

3 participants