| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Matt Watson wrote:
void fatalSigHandler(int sig, siginfo_t* info, void* context)
{
// We are very limited in what we are allowed to do in a signal handler. // Memory should not be allocated, and most libc functions should not be used.
static char sig_message[] = "Aborting: Fatal signal occurred!\n";
write(1, sig_message, sizeof(sig_message)); exit(1); }
Never call exit() from a signal handler. You want _Exit() instead. exit() will call atexit() handlers which will are likely not signal-safe. And you probably want to use fd 2 (stderr), instead of fd 1 in the write() call.
That said: if you're not going to add any more info in your signal handler, or do any cleanup like unlink() files, it may just be best to let it crash and generate a crash log.
-Kevin- _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden
| References: | |
| >Catching signal errors (From: Rick Steele <email@hidden>) | |
| >Re: Catching signal errors (From: Kevin Harris <email@hidden>) | |
| >Re: Catching signal errors (From: Matt Watson <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.