AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
readdir.c File Reference

The generic readdir operation for directories that are vnodes. More...

#include <core/system.h>
#include <fs/vfs.h>
#include <aquila/fcntl.h>
#include <aquila/errno.h>
#include <aquila/dirent.h>

Go to the source code of this file.

Functions

ssize_t posix_file_readdir (struct file *file, struct dirent *dirent)
 Reads the directory entry at an open directory's offset, and moves the offset past it.

Detailed Description

The generic readdir operation for directories that are vnodes.

Definition in file readdir.c.

Function Documentation

◆ posix_file_readdir()

ssize_t posix_file_readdir ( struct file * file,
struct dirent * dirent )

Reads the directory entry at an open directory's offset, and moves the offset past it.

The offset counts entries, not bytes.

Parameters
filethe open directory
direntthe entry, filled in
Returns
1 if an entry was read, 0 at the end of the directory, or a negative errno

Definition at line 22 of file readdir.c.

References file::flags, file::offset, posix_file_readdir(), and vfs_readdir().

Referenced by posix_file_readdir().