Re: Invoking Force Quit from Cocoa?
Re: Invoking Force Quit from Cocoa?
- Subject: Re: Invoking Force Quit from Cocoa?
- From: Alastair Houghton <email@hidden>
- Date: Sat, 1 Oct 2005 18:22:11 +0100
On 1 Oct 2005, at 17:03, Alexander v. Below wrote:
I have no idea how to display the OS dialog, but you could display
your own process list (see the darwin ps source code) and then send
signal (3) as appropriate
Of course, for a SIGKILL you would need to be running as root, see
the Cocoa "Authorization Services" for that.
That's only true if you want to terminate someone else's processes.
You can SIGKILL your own processes to your heart's content.
The information Martin is probably looking for right now is:
1. You need to use the kill() system call. See kill(1) and kill(2).
(If you aren't au-fait with UNIXisms, then "kill(1)" means entering
"man 1 kill" at the Terminal prompt.)
2. It's usually good form to send SIGTERM and allow a delay before
trying SIGKILL. The former can be caught in case the process you're
trying to terminate wants to clean up. The latter can not and should
only really be used as an absolute last resort in case the program
has e.g. created lock files.
3. On the Mac, it's probably even nicer to send an Apple Event to ask
the other program to terminate before heading for SIGTERM.
Kind regards,
Alastair.
--
http://www.alastairs-place.net
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden