Re: Unix Signals Delivered from Quitting Cocoa Apps?

2010-09-13 Thread aaron smith
I finished this if anyone's interested. it's all controlled by the Info.plist file now. And you don't need an arbitrary argument to notify the child that it should only run the app. The child only uses execvp so there's no high-leve api used. http://pastebin.com/1pH8dxuM On Mon, Sep 13, 2010 a

Re: Unix Signals Delivered from Quitting Cocoa Apps?

2010-09-13 Thread aaron smith
One more note about this. It does work as expected. But I am going to take out the dependency of having that hardcoded "1" parameter - which the child looks for so it only runs the cocoa app. I'll probably change it to use named pipes. Then it won't depend on having arguments correct. On Mon, Sep

Re: Unix Signals Delivered from Quitting Cocoa Apps?

2010-09-13 Thread aaron smith
Thanks for the suggestions! Yeah sorry I was getting around to fixing that return NSApplication thing. here's another version that avoids higher level framework usage.. http://pastebin.com/20W1ZD8r Does that look better? On Mon, Sep 13, 2010 at 1:38 AM, Ken Thomases wrote: > On Sep 13, 2010,

Re: Unix Signals Delivered from Quitting Cocoa Apps?

2010-09-13 Thread Ken Thomases
On Sep 13, 2010, at 3:05 AM, aaron smith wrote: > Thanks for pointing that I can't use high level frameworks in a child. > I'll set up everything I need for the execvp call before the actual > fork. You haven't addressed the problem. I was not talking about the later fork(), but the first one.

Re: Unix Signals Delivered from Quitting Cocoa Apps?

2010-09-13 Thread Stephen J. Butler
On Mon, Sep 13, 2010 at 3:05 AM, aaron smith wrote: > Thanks for pointing that I can't use high level frameworks in a child. > I'll set up everything I need for the execvp call before the actual > fork. > > AH! I totally missed that I need to use an int to store the child exit > status info. > > H

Re: Unix Signals Delivered from Quitting Cocoa Apps?

2010-09-13 Thread aaron smith
Thanks for pointing that I can't use high level frameworks in a child. I'll set up everything I need for the execvp call before the actual fork. AH! I totally missed that I need to use an int to store the child exit status info. Here's a version that works now.. http://pastebin.org/860040 Thank

Re: Unix Signals Delivered from Quitting Cocoa Apps?

2010-09-13 Thread Ken Thomases
On Sep 13, 2010, at 2:30 AM, aaron smith wrote: > I'm working on a test to catch when an application crashes, and launch > another executable (eventually crash reporter). > > I'm exhibiting strange behavior - whenever I quit the application > normally, the information I'm getting back about what

Unix Signals Delivered from Quitting Cocoa Apps?

2010-09-13 Thread aaron smith
Hey all, quick question. I'm working on a test to catch when an application crashes, and launch another executable (eventually crash reporter). I'm exhibiting strange behavior - whenever I quit the application normally, the information I'm getting back about what happened and why it stopped is al

Re: UNIX signals

2008-12-19 Thread Ken Thomases
On Dec 18, 2008, at 12:59 PM, Michael Ash wrote: Good luck finding *any* documentation about the mach functions. (Seriously. If you know of good Apple-provided ones, I'd like to know!) Normally I'd be wary, but in this case not having documentation is simply par for the course. As you probably

Re: UNIX signals

2008-12-18 Thread Michael Ash
ec 16, 2008 at 8:02 PM, Chris Idou wrote: >>>>> >>>>> Is there any Cocoa and/or Carbon interface to UNIX signals? >>>> >>>> Nope. It's pretty easy to set up a signal handler that can call back >>>> to a Cocoa/CoreFoundati

Re: UNIX signals

2008-12-18 Thread Jean-Daniel Dupas
Le 18 déc. 08 à 04:55, Michael Ash a écrit : On Wed, Dec 17, 2008 at 2:32 PM, Greg Parker wrote: On Dec 16, 2008, at 7:22 PM, Michael Ash wrote: On Tue, Dec 16, 2008 at 8:02 PM, Chris Idou wrote: Is there any Cocoa and/or Carbon interface to UNIX signals? Nope. It's pretty ea

Re: UNIX signals

2008-12-17 Thread Michael Ash
On Wed, Dec 17, 2008 at 2:32 PM, Greg Parker wrote: > On Dec 16, 2008, at 7:22 PM, Michael Ash wrote: >> >> On Tue, Dec 16, 2008 at 8:02 PM, Chris Idou wrote: >>> >>> Is there any Cocoa and/or Carbon interface to UNIX signals? >> >> Nope. It's pr

Re: UNIX signals

2008-12-17 Thread Greg Parker
On Dec 16, 2008, at 7:22 PM, Michael Ash wrote: On Tue, Dec 16, 2008 at 8:02 PM, Chris Idou wrote: Is there any Cocoa and/or Carbon interface to UNIX signals? Nope. It's pretty easy to set up a signal handler that can call back to a Cocoa/CoreFoundation runloop though, by having it wri

Re: UNIX signals

2008-12-17 Thread Greg Parker
On Dec 17, 2008, at 8:20 AM, Keary Suska wrote: On Dec 16, 2008, at 8:27 PM, Jonathan Prescott wrote: For everything else other than Cocoa and Carbon applications that receive AppleEvents, when the computer is shutdown, everything else is sent a SIGKILL by launchd, just like any other Unix sy

Re: UNIX signals

2008-12-17 Thread Keary Suska
On Dec 16, 2008, at 8:27 PM, Jonathan Prescott wrote: For everything else other than Cocoa and Carbon applications that receive AppleEvents, when the computer is shutdown, everything else is sent a SIGKILL by launchd, just like any other Unix system (launchd takes the place of the init dae

Re: UNIX signals

2008-12-17 Thread jonat...@mugginsoft.com
On 17 Dec 2008, at 03:22, Michael Ash wrote: On Tue, Dec 16, 2008 at 8:02 PM, Chris Idou wrote: Is there any Cocoa and/or Carbon interface to UNIX signals? Nope. Yes. For a Cocoa solution see MessagingSignalHandler available at http://www.fivesquaresoftware.com/source/ This schedules an

Re: UNIX signals

2008-12-17 Thread Ken Thomases
On Dec 16, 2008, at 9:22 PM, Michael Ash wrote: On Tue, Dec 16, 2008 at 8:02 PM, Chris Idou wrote: Is there any Cocoa and/or Carbon interface to UNIX signals? Nope. It's pretty easy to set up a signal handler that can call back to a Cocoa/CoreFoundation runloop though, by having it wri

Re: UNIX signals

2008-12-16 Thread Jonathan Prescott
For everything else other than Cocoa and Carbon applications that receive AppleEvents, when the computer is shutdown, everything else is sent a SIGKILL by launchd, just like any other Unix system (launchd takes the place of the init daemon seen on other Unix systems). Semantics for BSD sig

Re: UNIX signals

2008-12-16 Thread Michael Ash
On Tue, Dec 16, 2008 at 8:02 PM, Chris Idou wrote: > Is there any Cocoa and/or Carbon interface to UNIX signals? Nope. It's pretty easy to set up a signal handler that can call back to a Cocoa/CoreFoundation runloop though, by having it write to a pipe or mach port which the runloop

Re: UNIX signals

2008-12-16 Thread Andrew Farmer
On 16 Dec 08, at 18:40, Chris Idou wrote: Ok. BTW, what happens exactly when you try and shut down a Mac? On a UNIX system all the processes are sent SIGINT or something, at which point they should enter a controlled shutdown procedure. The OS X desktop uses Apple Events to send shutdown req

Re: UNIX signals

2008-12-16 Thread Chris Idou
Ok. BTW, what happens exactly when you try and shut down a Mac? On a UNIX system all the processes are sent SIGINT or something, at which point they should enter a controlled shutdown procedure. --- On Tue, 16/12/08, Andrew Farmer wrote: > From: Andrew Farmer > Subject: Re: UNIX s

Re: UNIX signals

2008-12-16 Thread Andrew Farmer
On 16 Dec 08, at 17:02, Chris Idou wrote: Is there any Cocoa and/or Carbon interface to UNIX signals? Not that I'm aware of. In general, any signal you're likely to receive in a Cocoa application should either be ignored (CHLD, WINCH, etc) or cause your application to terminate i

UNIX signals

2008-12-16 Thread Chris Idou
Is there any Cocoa and/or Carbon interface to UNIX signals? Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline ___ Cocoa-dev mailing list (Cocoa-dev@lists.a