Function cloudabi::file_readdir [] [src]

pub unsafe fn file_readdir(
    fd_: fd,
    buf_: &mut [u8],
    cookie_: dircookie,
    bufused_: &mut usize
) -> errno

Reads directory entries from a directory.

When successful, the contents of the output buffer consist of a sequence of directory entries. Each directory entry consists of a dirent object, followed by dirent.d_namlen bytes holding the name of the directory entry.

This system call fills the output buffer as much as possible, potentially truncating the last directory entry. This allows the caller to grow its read buffer size in case it's too small to fit a single large directory entry, or skip the oversized directory entry.

Parameters

fd: The directory from which to read the directory entries.

buf: The buffer where directory entries are stored.

cookie: The location within the directory to start reading.

bufused: The number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached.