---@meta posix.sys

---@class posix_sys*
---@field msg posix_sys_msg*
---@field resource posix_sys_resource*
---@field socket posix_sys_socket*
---@field stat posix_sys_stat*
---@field statvfs posix_sys_statvfs*
---@field time posix_sys_time*
---@field times posix_sys_times*
---@field utsname posix_sys_utsname*
---@field wait posix_sys_wait*
---@type posix_sys*
local M = {}

---@param file string
---@param mode string|integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.euidaccess(file, mode) end

---@param task table|function
---@param ... any
---@return integer? status
---@return string? reason
function M.spawn(task, ...) end

---@param lhs posix_timeval*
---@param rhs posix_timeval*
---@return posix_timeval* result
function M.timeradd(lhs, rhs) end

---@param lhs posix_timeval*
---@param rhs posix_timeval*
---@return posix_timeval* result
function M.timersub(lhs, rhs) end

---@param lhs posix_timeval*
---@param rhs posix_timeval*
---@return integer result
function M.timercmp(lhs, rhs) end

---@param tasks table
---@return string? output
---@return string? errMsg
function M.pipeline_slurp(tasks) end

---@param tasks table
---@return function iterator
function M.pipeline_iterator(tasks) end

return M
