#[unsafe(no_mangle)]pub unsafe extern "C" fn sys_posix_getdents(
fd: i32,
buf: *mut PosixDent,
nbyte: usize,
flags: i32,
) -> isizeExpand description
Read the entries of a directory as defined by POSIX.1-2024, posix_getdents.
This reads up to nbyte bytes of PosixDent entries into buf and returns the number of
bytes written. If the size was not sufficient to list all directory entries, subsequent calls
to this fn return the next entries.
Parameters:
fd: File Descriptor of the directory in question.buf: Memory for the kernel to store the filledPosixDentobjects including the c-strings with the filenames to.nbyte: Size of the memory region described bybufin bytes.flags: Must be zero; no flags are supported yet.
Return:
The number of bytes read into buf on success. Zero indicates that the end of the directory
was reached. Negative numbers encode errors.