mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-17 16:32:14 +08:00
[dfs] Add DFS v2.0 (#7606)
This commit is contained in:
@@ -26,10 +26,14 @@ extern "C" {
|
||||
#define FT_SOCKET 1 /* socket file */
|
||||
#define FT_DIRECTORY 2 /* directory */
|
||||
#define FT_USER 3 /* user defined */
|
||||
#define FT_DEVICE 4 /* device */
|
||||
#define FT_SYMLINK 5 /* symbol link */
|
||||
|
||||
#define DT_UNKNOWN 0x00
|
||||
#define DT_REG 0x01
|
||||
#define DT_DIR 0x02
|
||||
#define DT_FIFO 0x01
|
||||
#define DT_SYMLINK 0x03
|
||||
#define DT_DIR 0x04
|
||||
#define DT_REG 0x08
|
||||
|
||||
#ifndef HAVE_DIR_STRUCTURE
|
||||
#define HAVE_DIR_STRUCTURE
|
||||
@@ -61,7 +65,7 @@ DIR *opendir(const char *);
|
||||
struct dirent *readdir(DIR *);
|
||||
int readdir_r(DIR *, struct dirent *, struct dirent **);
|
||||
void rewinddir(DIR *);
|
||||
void seekdir(DIR *, long int);
|
||||
void seekdir(DIR *, long);
|
||||
long telldir(DIR *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -1,10 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023/06/08 Bernard Add macro definition for `#pragma once`
|
||||
*/
|
||||
|
||||
#ifndef UNISTD_H__
|
||||
#define UNISTD_H__
|
||||
|
||||
#include "sys/unistd.h"
|
||||
|
||||
#ifndef F_OK
|
||||
#define F_OK 0
|
||||
#endif
|
||||
|
||||
#ifndef R_OK
|
||||
#define R_OK 4
|
||||
#endif
|
||||
|
||||
#ifndef W_OK
|
||||
#define W_OK 2
|
||||
#endif
|
||||
|
||||
#ifndef X_OK
|
||||
#define X_OK 1
|
||||
#endif
|
||||
|
||||
#endif /* UNISTD_H__ */
|
||||
|
@@ -13,12 +13,24 @@
|
||||
|
||||
#include <sys/_default_fcntl.h>
|
||||
|
||||
#ifndef O_DIRECTORY
|
||||
#define O_DIRECTORY 0x200000
|
||||
#ifndef O_EXEC
|
||||
#define O_EXEC 0x400000
|
||||
#endif
|
||||
|
||||
#ifndef O_TMPFILE
|
||||
#define O_TMPFILE 0x800000
|
||||
#endif
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0x10000
|
||||
#endif
|
||||
|
||||
#ifndef O_NOFOLLOW
|
||||
#define O_NOFOLLOW 0x100000
|
||||
#endif
|
||||
|
||||
#ifndef O_DIRECTORY
|
||||
#define O_DIRECTORY 0x200000
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
@@ -31,7 +31,7 @@ int libc_system_init(void)
|
||||
if (dev_console)
|
||||
{
|
||||
int fd = libc_stdio_set_console(dev_console->parent.name, O_RDWR);
|
||||
if (fd < 0)
|
||||
if (fd < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ int libc_system_init(void)
|
||||
#endif /* RT_USING_POSIX_STDIO */
|
||||
return 0;
|
||||
}
|
||||
INIT_COMPONENT_EXPORT(libc_system_init);
|
||||
INIT_APP_EXPORT(libc_system_init);
|
||||
|
||||
#if defined(RT_USING_POSIX_STDIO) && defined(RT_USING_NEWLIBC)
|
||||
|
||||
|
Reference in New Issue
Block a user