Re: mach in signal handler
Re: mach in signal handler
- Subject: Re: mach in signal handler
- From: Dave Zarzycki <email@hidden>
- Date: Thu, 25 Jan 2007 18:29:36 -0800
I don't remember if Mach based APIs are interruptible by signals, but
if they are, then the answer is definitely no. Why? The reply port can
get out of synchronization do to the unexpected reentrancy on the same
thread stack.
Personally speaking, I try and handle as many signals as I can via the
kqueue API. The only signals that can't be handled in a kqueue are
instruction stream or memory access related faults (SIGBUS, SIGSEGV,
SIGILL, and SIGFPE). If the aforementioned signals are what you are
trying to handle, I'd suggest setting up a dedicated thread to handle
signals (man sigsuspend). All other threads should have their signal
mask setup to block delivery.
davez
On Jan 25, 2007, at 5:38 PM, Steve Checkoway wrote:
Is it safe to use vm_region in a signal handler? I know there are a
small list of functions that are considered safe <http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/sigaction.2.html#//apple_ref/doc/man/2/sigaction
> and vm_region is not among them.
I tried looking for vm_region in the darwin sources but I can't seem
to figure out how to search the sources (clearly I'm missing
something obvious here) and I can't find it looking where I expected
it to be. Some man page leads me to believe that it's a syscall, yet
I can't find it in any lists of syscalls in libc.
--
Steve Checkoway
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden