• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sending SIGUSR1 to a process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Sending SIGUSR1 to a process (From: Gabriel Zachmann via Cocoa-dev <email@hidden>)
 >Re: Sending SIGUSR1 to a process (From: Saagar Jha via Cocoa-dev <email@hidden>)

  • Prev by Date: Re: Sending SIGUSR1 to a process
  • Next by Date: Re: Sending SIGUSR1 to a process
  • Previous by thread: Re: Sending SIGUSR1 to a process
  • Next by thread: Xcode interferes with signal handler (was: Sending SIGUSR1 to a process)
  • Index(es):
    • Date
    • Thread