diff --git a/include/nuttx/fs/hostfs.h b/include/nuttx/fs/hostfs.h index fb20775003d..a94d3e5daa5 100644 --- a/include/nuttx/fs/hostfs.h +++ b/include/nuttx/fs/hostfs.h @@ -65,14 +65,14 @@ /* These must exactly match the definitions from include/sys/stat.h: */ -#define NUTTX_S_IFIFO 0010000 -#define NUTTX_S_IFCHR 0020000 -#define NUTTX_S_IFDIR 0040000 -#define NUTTX_S_IFBLK 0060000 -#define NUTTX_S_IFREG 0100000 -#define NUTTX_S_IFLNK 0120000 +#define NUTTX_S_IFIFO 0 +#define NUTTX_S_IFCHR (1 << 11) +#define NUTTX_S_IFDIR (2 << 11) +#define NUTTX_S_IFBLK (3 << 11) +#define NUTTX_S_IFREG (4 << 11) +#define NUTTX_S_IFLNK (1 << 15) -/* These must exactly match the definitions from include/fctnl.h: */ +/* These must exactly match the definitions from include/fcntl.h: */ #define NUTTX_O_RDONLY (1 << 0) /* Open for read access (only) */ #define NUTTX_O_WRONLY (1 << 1) /* Open for write access (only) */ @@ -161,6 +161,7 @@ int host_ioctl(int fd, int request, unsigned long arg); void host_sync(int fd); int host_dup(int fd); int host_fstat(int fd, struct nuttx_stat_s *buf); +int host_ftruncate(int fd, off_t length); void *host_opendir(const char *name); int host_readdir(void* dirp, struct nuttx_dirent_s* entry); void host_rewinddir(void* dirp); @@ -181,6 +182,7 @@ int host_ioctl(int fd, int request, unsigned long arg); void host_sync(int fd); int host_dup(int fd); int host_fstat(int fd, struct stat *buf); +int host_ftruncate(int fd, off_t length); void *host_opendir(const char *name); int host_readdir(void* dirp, struct dirent *entry); void host_rewinddir(void* dirp);