
--------------------------------------------------------------------------------
-- Spawn module
--------------------------------------------------------------------------------

---@class spawn*
---@field _VERSION? string module version
---@type spawn*
local M = {}

--- Start the program without waiting for the end
---@param program string Program path or command name
---@param ... string parameters
---@return integer? pid process number
---@return string? errMsg error message
---@return integer? errno error code
function M.start(program, ...) end

--- Start the program and wait for it to end
---@param program string Program path or command name
---@param ... string parameters
---@return boolean? ok Whether to exit successfully
---@return string? reason End reason or error message
---@return integer? status status code or errno
function M.run(program, ...) end

--- Execute the command via /bin/sh -c
---@param command string command text
---@return boolean? ok Whether to exit successfully
---@return string? reason End reason or error message
---@return integer? status status code or errno
function M.system(command) end

return M
