On Tue, Mar 27, 2012 at 1:57 PM, Nat! <nat@mulle-kybernetik.com> wrote:
instead of many words, here's the output of two program runs once with a sleep( 2) - as in seconds, not as in man - commented in and out. What I believe this demonstrates, is that on Darwin (Kernel Version 10.8.0), blocked signal information is lost, which is incovenient. gdb has a similiar problem.
Or it shows that I am misunderstanding something ;)
The problem is not that the signal is occurring less often, that's expected, but that the struct __siginfo has trouble remembering things.
You really should read the manpage for sigaction, in particular, the section that reads: "In general though, signal handlers should do little more than set a flag; most other actions are not safe." Note, also, that printf() is not in the list of "safe" functions to call. Thus your call to p_log is defined as not safe. While sleep() is safe to call, it also violates one of the cardinal rules of signal handlers -- do only what is necessary to flag that a signal occurred, and do not take more time than is necessary. The actual handling of what the signal represents should be done in a main thread. -Tilghman _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.app... This email sent to site_archiver@lists.apple.com
participants (1)
-
Tilghman Lesher