---@meta posix.signal

---@alias posix_sighandler integer|function

---@class posix_signal*
---@field version string
---@field SIG_DFL posix_sighandler
---@field SIG_IGN posix_sighandler
---@field SIGABRT integer
---@field SIGALRM integer
---@field SIGBUS integer
---@field SIGCHLD integer
---@field SIGCONT integer
---@field SIGFPE integer
---@field SIGHUP integer
---@field SIGILL integer
---@field SIGINFO integer
---@field SIGINT integer
---@field SIGKILL integer
---@field SIGPIPE integer
---@field SIGQUIT integer
---@field SIGSEGV integer
---@field SIGSTOP integer
---@field SIGTERM integer
---@field SIGTSTP integer
---@field SIGTTIN integer
---@field SIGTTOU integer
---@field SIGUSR1 integer
---@field SIGUSR2 integer
---@field SIGSYS integer
---@field SIGTRAP integer
---@field SIGURG integer
---@field SIGVTALRM integer
---@field SIGWINCH integer
---@field SIGXCPU integer
---@field SIGXFSZ integer
---@field SA_NOCLDSTOP integer
---@field SA_NOCLDWAIT integer
---@field SA_NODEFER integer
---@field SA_RESETHAND integer
---@field SA_RESTART integer
---@type posix_signal*
local M = {}

---@param pid integer
---@param sig integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.kill(pid, sig) end

---@param pgrp integer
---@param sig integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.killpg(pgrp, sig) end

---@param sig integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.raise(sig) end

---@param sig integer
---@param handler posix_sighandler
---@param flags? integer
---@return posix_sighandler? oldHandler
---@return string? errMsg
---@return integer? errno
function M.signal(sig, handler, flags) end

return M
