summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorwdfk-prog <[email protected]>2026-01-06 14:04:40 +0800
committerR b b666 <[email protected]>2026-01-06 16:44:35 +0800
commitbd22f2fa6a2274bfc99461a313a65d5b7e63bc01 (patch)
tree037813f0e886294cd3c1f86c7790338f7b713b47 /components
parent7384a8e0354397d189a8349f6d6c6a564bbd1c74 (diff)
fix(dfs): align fd API declarations with DFS_USING_POSIX
Diffstat (limited to 'components')
-rw-r--r--components/dfs/dfs_v1/include/dfs.h7
-rw-r--r--components/dfs/dfs_v1/src/dfs.c7
2 files changed, 7 insertions, 7 deletions
diff --git a/components/dfs/dfs_v1/include/dfs.h b/components/dfs/dfs_v1/include/dfs.h
index 1fbe6b77cd..12b0d59931 100644
--- a/components/dfs/dfs_v1/include/dfs.h
+++ b/components/dfs/dfs_v1/include/dfs.h
@@ -81,9 +81,6 @@ int dfs_init(void);
char *dfs_normalize_path(const char *directory, const char *filename);
const char *dfs_subdir(const char *directory, const char *filename);
-int fd_is_open(const char *pathname);
-struct dfs_fdtable *dfs_fdtable_get(void);
-
void dfs_lock(void);
void dfs_unlock(void);
@@ -93,6 +90,8 @@ void dfs_file_unlock(void);
void dfs_fm_lock(void);
void dfs_fm_unlock(void);
+void fd_init(struct dfs_file *fd);
+
#ifdef DFS_USING_POSIX
/* FD APIs */
@@ -104,7 +103,7 @@ int fd_new(void);
struct dfs_file *fd_get(int fd);
void fd_release(int fd);
-void fd_init(struct dfs_file *fd);
+int fd_is_open(const char *pathname);
int fd_associate(struct dfs_fdtable *fdt, int fd, struct dfs_file *file);
int fd_get_fd_index(struct dfs_file *file);
diff --git a/components/dfs/dfs_v1/src/dfs.c b/components/dfs/dfs_v1/src/dfs.c
index 42f73280b0..3783179315 100644
--- a/components/dfs/dfs_v1/src/dfs.c
+++ b/components/dfs/dfs_v1/src/dfs.c
@@ -35,7 +35,9 @@ char working_directory[DFS_PATH_MAX] = {"/"};
#endif
static struct dfs_fdtable _fdtab;
+#ifdef DFS_USING_POSIX
static int fd_alloc(struct dfs_fdtable *fdt, int startfd);
+#endif /* DFS_USING_POSIX */
/**
* @addtogroup group_device_virtual_file_system
@@ -477,8 +479,6 @@ exit:
return newfd;
}
-#endif /* DFS_USING_POSIX */
-
/**
* @ingroup group_fs_file_descriptor
*
@@ -696,6 +696,7 @@ exit:
dfs_file_unlock();
return retfd;
}
+#endif /* DFS_USING_POSIX */
/**
* @brief initialize a dfs file object.
@@ -1082,6 +1083,6 @@ int lsof(int argc, char *argv[])
MSH_CMD_EXPORT(lsof, list open files);
#endif /* RT_USING_SMART */
-#endif
+#endif /* RT_USING_FINSH */
/**@}*/