1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include
"nsISupports.idl"
7 [scriptable
, uuid(1341f571
-ebed
-4305-b264
-4d8fc3b6b11c
)]
8 interface nsIProcessToolsService
: nsISupports
{
10 * Kill a process running on this system.
12 * Does not cause a crash report to be generated and sent.
16 * `pid` is the unique-to-the-system process identifier, as
17 * obtained with attribute `pid` of this service.
19 * Under Un*ix, that's what you obtain with `getpid()`, etc.
20 * Under Windows, that's what you obtain with `GetCurrentProcessId()`,
21 * NOT the same thing as the process `HANDLE`.
25 * Under Windows, if two processes race to `kill()` a third process,
26 * or two threads race to `kill()` a process there is a (small) window
27 * during which this can cause a crash in the losing process.
31 * Under Windows, process killing is asynchronous. Therefore, this
32 * function can return before process `pid` is actually dead.
34 void kill
(in unsigned long long pid
);
37 * Crash a process running on this system. Generates a SIGABRT on Linux and
38 * macOS, and a STATUS_ILLEGAL_INSTRUCTION on Windows.
40 * Does cause a crash report to be generated.
42 void crash
(in unsigned long long pid
);
45 * The pid for the current process.
47 readonly attribute
unsigned long long pid
;