summaryrefslogtreecommitdiff
path: root/components/dfs/include
diff options
context:
space:
mode:
authorzhangjun <[email protected]>2019-09-26 10:22:33 +0800
committerzhangjun <[email protected]>2019-09-26 10:22:33 +0800
commit60f2ae4d3cee0cbf200a89df21a3949c92125cf4 (patch)
tree26ccd41430442e07e9509711df6cbfcf2ff64228 /components/dfs/include
parent2a39e590244cc0a8501669e409c5b07fa4d33176 (diff)
[components][dfs]添加ftruncate接口
Diffstat (limited to 'components/dfs/include')
-rw-r--r--components/dfs/include/dfs_file.h4
-rw-r--r--components/dfs/include/dfs_posix.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/components/dfs/include/dfs_file.h b/components/dfs/include/dfs_file.h
index aaff3f6e9c..2dfacd653e 100644
--- a/components/dfs/include/dfs_file.h
+++ b/components/dfs/include/dfs_file.h
@@ -66,6 +66,10 @@ int dfs_file_lseek(struct dfs_fd *fd, off_t offset);
int dfs_file_stat(const char *path, struct stat *buf);
int dfs_file_rename(const char *oldpath, const char *newpath);
+int dfs_file_ftruncate(struct dfs_fd *fd, off_t length);
+
+/* 0x5254 is just a magic number to make these relatively unique ("RT") */
+#define RT_FIOFTRUNCATE 0x52540000U
#ifdef __cplusplus
}
diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h
index 9fd76debe2..87d5f0771e 100644
--- a/components/dfs/include/dfs_posix.h
+++ b/components/dfs/include/dfs_posix.h
@@ -58,6 +58,7 @@ int fstat(int fildes, struct stat *buf);
int fsync(int fildes);
int fcntl(int fildes, int cmd, ...);
int ioctl(int fildes, int cmd, ...);
+int ftruncate(int fd, off_t length);
/* directory api*/
int rmdir(const char *path);