summaryrefslogtreecommitdiff
path: root/meta/3rd/OpenResty/library/resty.signal.lua
blob: 912b2f00ee1c3c749f81134585d6cc8469dd5527 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---@meta

local signal = {
    version = 0.03,
}

---@alias resty.signal.name
---| '"HUP"'
---| '"INT"'
---| '"QUIT"'
---| '"ILL"'
---| '"TRAP"'
---| '"ABRT"'
---| '"BUS"'
---| '"FPE"'
---| '"KILL"'
---| '"USR1"'
---| '"SEGV"'
---| '"USR2"'
---| '"PIPE"'
---| '"ALRM"'
---| '"TERM"'
---| '"CHLD"'
---| '"CONT"'
---| '"STOP"'
---| '"TSTP"'
---| '"TTIN"'
---| '"TTOU"'
---| '"URG"'
---| '"XCPU"'
---| '"XFSZ"'
---| '"VTALRM"'
---| '"PROF"'
---| '"WINCH"'
---| '"IO"'
---| '"PWR"'
---| '"EMT"'
---| '"SYS"'
---| '"INFO"'
---| '"NONE"' # The special signal name NONE is also supported, which is mapped to zero (0).


---
-- Sends a signal with its name string or number value to the process of the specified pid.
--
-- All signal names accepted by signum are supported, like HUP, KILL, and TERM.
--
-- Signal numbers are also supported when specifying nonportable system-specific signals is desired.
--
---@param pid number
---@param signal_name_or_num number|resty.signal.name
---
---@return boolean ok
---@return string? error
function signal.kill(pid, signal_name_or_num) end

---
-- Maps the signal name specified to the system-specific signal number.
-- Returns `nil` if the signal name is not known.
--
---@param name resty.signal.name
---@return number|nil
function signal.signum(name) end

return signal