#include <stdint.h>
#include <sys/limits.h>
#include <sys/stat.h>
#include "kconfig.h"
Go to the source code of this file.
|
|
#define | DT_UNKNOWN 0 |
| |
|
#define | DT_FIFO 1 |
| |
|
#define | DT_CHR 2 |
| |
|
#define | DT_DIR 4 |
| |
|
#define | DT_BLK 6 |
| |
|
#define | DT_REG 8 |
| |
|
#define | DT_LNK 10 |
| |
|
#define | DT_SOCK 12 |
| |
|
#define | IFTODT(mode) (((mode) &S_IFMT) >> 12) |
| |
|
#define | DTTOIF(dirtype) ((dirtype) << 12) |
| |
|
| DIR * | opendir (const char *name) |
| | Open a directory stream corresponding to the directory name, and return a pointer to the directory stream. More...
|
| |
| struct dirent * | readdir (DIR *dirp) |
| | Return the next entry of the directory stream. The entry belongs to the stream and is overwritten by the next call on it. More...
|
| |
| int | closedir (DIR *dirp) |
| | Close a directory stream and release what it holds. More...
|
| |
◆ closedir()
| int closedir |
( |
DIR * |
dirp | ) |
|
Close a directory stream and release what it holds.
- Parameters
-
| dirp | The directory stream to close. |
- Return values
-
| int | 0 on success and -1 on error, with the reason left in errno. |
◆ opendir()
| DIR* opendir |
( |
const char * |
name | ) |
|
Open a directory stream corresponding to the directory name, and return a pointer to the directory stream.
- Parameters
-
| name | The file path to the directory. |
- Return values
-
| DIR | *: The directory stream on success and a null pointer on error, with the reason left in errno. |
◆ readdir()
Return the next entry of the directory stream. The entry belongs to the stream and is overwritten by the next call on it.
- Parameters
-
| dirp | The directory stream to read. |
- Return values
-
| struct | dirent *: The entry on success, and a null pointer at the end of the directory or on error, which are told apart by errno. |