---@meta posix.sys.stat

---@class posix_stat*
---@field st_dev integer
---@field st_ino integer
---@field st_mode integer
---@field st_nlink integer
---@field st_uid integer
---@field st_gid integer
---@field st_rdev integer
---@field st_size integer
---@field st_atime integer
---@field st_mtime integer
---@field st_ctime integer
---@field st_blksize integer
---@field st_blocks integer

---@class posix_sys_stat*
---@field version string
---@field S_IFMT integer
---@field S_IFBLK integer
---@field S_IFCHR integer
---@field S_IFDIR integer
---@field S_IFIFO integer
---@field S_IFLNK integer
---@field S_IFREG integer
---@field S_IFSOCK integer
---@field S_IRWXU integer
---@field S_IRUSR integer
---@field S_IWUSR integer
---@field S_IXUSR integer
---@field S_IRWXG integer
---@field S_IRGRP integer
---@field S_IWGRP integer
---@field S_IXGRP integer
---@field S_IRWXO integer
---@field S_IROTH integer
---@field S_IWOTH integer
---@field S_IXOTH integer
---@field S_ISGID integer
---@field S_ISUID integer
---@type posix_sys_stat*
local M = {}

---@param mode integer
---@return integer ok
function M.S_ISBLK(mode) end

---@param mode integer
---@return integer ok
function M.S_ISCHR(mode) end

---@param mode integer
---@return integer ok
function M.S_ISDIR(mode) end

---@param mode integer
---@return integer ok
function M.S_ISFIFO(mode) end

---@param mode integer
---@return integer ok
function M.S_ISLNK(mode) end

---@param mode integer
---@return integer ok
function M.S_ISREG(mode) end

---@param mode integer
---@return integer ok
function M.S_ISSOCK(mode) end

---@param path string
---@param mode integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.chmod(path, mode) end

---@param path string
---@return posix_stat*? stat
---@return string? errMsg
---@return integer? errno
function M.lstat(path) end

---@param fd integer
---@return posix_stat*? stat
---@return string? errMsg
---@return integer? errno
function M.fstat(fd) end

---@param path string
---@param mode? integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.mkdir(path, mode) end

---@param path string
---@param mode? integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.mkfifo(path, mode) end

---@param path string
---@return posix_stat*? stat
---@return string? errMsg
---@return integer? errno
function M.stat(path) end

---@param mode? integer
---@return integer oldMode
function M.umask(mode) end

return M
