Re: Sending SIGUSR1 to a process
Re: Sending SIGUSR1 to a process
- Subject: Re: Sending SIGUSR1 to a process
- From: Gabriel Zachmann via Cocoa-dev <email@hidden>
- Date: Mon, 29 Jan 2024 10:50:26 +0100
>
> Yes, this should work. The only changes I know of is that you can’t signal
> some Apple processes these days if System Integrity Protection is engaged.
I have tried it like the following, but to no avail:
void signal_handler( int sig )
{
logMessage( LogClient, [NSString stringWithFormat: @"signal %d caught",
sig], NO );
}
// install signal handler
In the init method of my app I have:
void *e = signal( SIGUSR1, signal_handler );
if ( e == SIG_ERR )
{
char * errmesg = strerror( errno );
[self logMessage: [NSString stringWithFormat: @"Installing signal
handler failed: %s", errmesg] asError: YES];
}
When I run my app (from Xcode), I don't get any error message, but sending a
SIGUSR1 (using 'kill' on the command line) just makes it stop in mach_msg2_trap.
Stack trace:
start, main, NSApplicationMain, mach_msg2_trap.
My signal_handler won't get called.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden