• 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
catching signals
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

catching signals


  • Subject: catching signals
  • From: Robert Goldsmith <email@hidden>
  • Date: Tue, 20 Apr 2004 20:09:57 +0100

Hi :)

I'm trying to catch the sigint that (I hope) is generated by the serial
port when it receives a Break sequence. Using Apple's bsd info, I have
used the following:

/******** Catch the sig *************/
static void catch_sigint(int signo)
{
NSLog(@"Caught %i, exiting...",signo);
exit(1);
}

then, in the serial connect method:

//setup sigint
struct sigaction sa_old;
struct sigaction sa_new;

sa_new.sa_handler = catch_sigint;
sigemptyset(&sa_new.sa_mask);
sa_new.sa_flags = 0;
sigaction(SIGINT, &sa_new, &sa_old );

However, I don't seem to be receiving the signals (the function is not
called). Anyone have any ideas?

Thanks

Robert
---
GnuPG public key:
http://www.Far-Blue.co.uk/

[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: [Q] Why unsolicited dealloc in NSKeyedUnarchiver?
  • Next by Date: RE: [little OT] Licensing/Implementing in Cocoa/Obj-C
  • Previous by thread: Re: Getting keyDown for option key
  • Next by thread: Re: catching signals
  • Index(es):
    • Date
    • Thread