---@meta posix.sys.wait

---@class posix_sys_wait*
---@field version string
---@field WNOHANG integer
---@field WUNTRACED integer
---@type posix_sys_wait*
local M = {}

---@param pid? integer Child process pid, default -1 means any child process.
---@param options? integer `WNOHANG`、`WUNTRACED` Wait for the flag.
---@return integer? pid Running or ended pid.
---@return "running"|"exited"|"killed"|"stopped"|string? reason status or error message.
---@return integer? status Exit code, message number, or errno.
function M.wait(pid, options) end

return M
