summaryrefslogtreecommitdiff
path: root/meta/3rd/OpenResty/library/resty/signal.lua
diff options
context:
space:
mode:
Diffstat (limited to 'meta/3rd/OpenResty/library/resty/signal.lua')
-rw-r--r--meta/3rd/OpenResty/library/resty/signal.lua65
1 files changed, 65 insertions, 0 deletions
diff --git a/meta/3rd/OpenResty/library/resty/signal.lua b/meta/3rd/OpenResty/library/resty/signal.lua
new file mode 100644
index 00000000..912b2f00
--- /dev/null
+++ b/meta/3rd/OpenResty/library/resty/signal.lua
@@ -0,0 +1,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 \ No newline at end of file