Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/dfs/dfs_v1/filesystems/devfs/devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int dfs_device_fs_ioctl(struct dfs_file *file, int cmd, void *args)
return result;
}

int dfs_device_fs_read(struct dfs_file *file, void *buf, size_t count)
ssize_t dfs_device_fs_read(struct dfs_file *file, void *buf, size_t count)
{
int result;
rt_device_t dev_id;
Expand All @@ -82,7 +82,7 @@ int dfs_device_fs_read(struct dfs_file *file, void *buf, size_t count)
return result;
}

int dfs_device_fs_write(struct dfs_file *file, const void *buf, size_t count)
ssize_t dfs_device_fs_write(struct dfs_file *file, const void *buf, size_t count)
{
int result;
rt_device_t dev_id;
Expand Down
6 changes: 3 additions & 3 deletions components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ int dfs_elm_ioctl(struct dfs_file *file, int cmd, void *args)
return -ENOSYS;
}

int dfs_elm_read(struct dfs_file *file, void *buf, size_t len)
ssize_t dfs_elm_read(struct dfs_file *file, void *buf, size_t len)
{
FIL *fd;
FRESULT result;
Expand All @@ -560,7 +560,7 @@ int dfs_elm_read(struct dfs_file *file, void *buf, size_t len)
return elm_result_to_dfs(result);
}

int dfs_elm_write(struct dfs_file *file, const void *buf, size_t len)
ssize_t dfs_elm_write(struct dfs_file *file, const void *buf, size_t len)
{
FIL *fd;
FRESULT result;
Expand Down Expand Up @@ -596,7 +596,7 @@ int dfs_elm_flush(struct dfs_file *file)
return elm_result_to_dfs(result);
}

int dfs_elm_lseek(struct dfs_file *file, off_t offset)
off_t dfs_elm_lseek(struct dfs_file *file, off_t offset)
{
FRESULT result = FR_OK;
if (file->vnode->type == FT_REGULAR)
Expand Down
4 changes: 2 additions & 2 deletions components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ struct romfs_dirent *dfs_romfs_lookup(struct romfs_dirent *root_dirent, const ch
return NULL;
}

int dfs_romfs_read(struct dfs_file *file, void *buf, size_t count)
ssize_t dfs_romfs_read(struct dfs_file *file, void *buf, size_t count)
{
rt_size_t length;
struct romfs_dirent *dirent;
Expand All @@ -173,7 +173,7 @@ int dfs_romfs_read(struct dfs_file *file, void *buf, size_t count)
return length;
}

int dfs_romfs_lseek(struct dfs_file *file, off_t offset)
off_t dfs_romfs_lseek(struct dfs_file *file, off_t offset)
{
if (offset <= file->vnode->size)
{
Expand Down
6 changes: 3 additions & 3 deletions components/dfs/dfs_v1/filesystems/tmpfs/dfs_tmpfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ struct tmpfs_file *dfs_tmpfs_lookup(struct tmpfs_sb *superblock,
return NULL;
}

int dfs_tmpfs_read(struct dfs_file *file, void *buf, size_t count)
ssize_t dfs_tmpfs_read(struct dfs_file *file, void *buf, size_t count)
{
rt_size_t length;
struct tmpfs_file *d_file;
Expand All @@ -290,7 +290,7 @@ int dfs_tmpfs_read(struct dfs_file *file, void *buf, size_t count)
}


int dfs_tmpfs_write(struct dfs_file *fd, const void *buf, size_t count)
ssize_t dfs_tmpfs_write(struct dfs_file *fd, const void *buf, size_t count)
{
struct tmpfs_file *d_file;
struct tmpfs_sb *superblock;
Expand Down Expand Up @@ -328,7 +328,7 @@ int dfs_tmpfs_write(struct dfs_file *fd, const void *buf, size_t count)
return count;
}

int dfs_tmpfs_lseek(struct dfs_file *file, off_t offset)
off_t dfs_tmpfs_lseek(struct dfs_file *file, off_t offset)
{
if (offset <= (off_t)file->vnode->size)
{
Expand Down
12 changes: 6 additions & 6 deletions components/dfs/dfs_v1/include/dfs_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ struct dfs_file_ops
int (*open) (struct dfs_file *fd);
int (*close) (struct dfs_file *fd);
int (*ioctl) (struct dfs_file *fd, int cmd, void *args);
int (*read) (struct dfs_file *fd, void *buf, size_t count);
int (*write) (struct dfs_file *fd, const void *buf, size_t count);
ssize_t (*read) (struct dfs_file *fd, void *buf, size_t count);
ssize_t (*write) (struct dfs_file *fd, const void *buf, size_t count);
int (*flush) (struct dfs_file *fd);
int (*lseek) (struct dfs_file *fd, off_t offset);
off_t (*lseek) (struct dfs_file *fd, off_t offset);
int (*getdents) (struct dfs_file *fd, struct dirent *dirp, uint32_t count);

int (*poll) (struct dfs_file *fd, struct rt_pollreq *req);
Expand Down Expand Up @@ -82,12 +82,12 @@ int dfs_file_is_open(const char *pathname);
int dfs_file_open(struct dfs_file *fd, const char *path, int flags);
int dfs_file_close(struct dfs_file *fd);
int dfs_file_ioctl(struct dfs_file *fd, int cmd, void *args);
int dfs_file_read(struct dfs_file *fd, void *buf, size_t len);
ssize_t dfs_file_read(struct dfs_file *fd, void *buf, size_t len);
int dfs_file_getdents(struct dfs_file *fd, struct dirent *dirp, size_t nbytes);
int dfs_file_unlink(const char *path);
int dfs_file_write(struct dfs_file *fd, const void *buf, size_t len);
ssize_t dfs_file_write(struct dfs_file *fd, const void *buf, size_t len);
int dfs_file_flush(struct dfs_file *fd);
int dfs_file_lseek(struct dfs_file *fd, off_t offset);
off_t dfs_file_lseek(struct dfs_file *fd, off_t offset);

int dfs_file_stat(const char *path, struct stat *buf);
int dfs_file_rename(const char *oldpath, const char *newpath);
Expand Down
6 changes: 3 additions & 3 deletions components/dfs/dfs_v1/src/dfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ int dfs_file_ioctl(struct dfs_file *fd, int cmd, void *args)
*
* @return the actual read data bytes or 0 on end of file or failed.
*/
int dfs_file_read(struct dfs_file *fd, void *buf, size_t len)
ssize_t dfs_file_read(struct dfs_file *fd, void *buf, size_t len)
{
int result = 0;

Expand Down Expand Up @@ -503,7 +503,7 @@ int dfs_file_unlink(const char *path)
*
* @return the actual written data length.
*/
int dfs_file_write(struct dfs_file *fd, const void *buf, size_t len)
ssize_t dfs_file_write(struct dfs_file *fd, const void *buf, size_t len)
{
if (fd == NULL)
{
Expand Down Expand Up @@ -544,7 +544,7 @@ int dfs_file_flush(struct dfs_file *fd)
*
* @return the current position after seek.
*/
int dfs_file_lseek(struct dfs_file *fd, off_t offset)
off_t dfs_file_lseek(struct dfs_file *fd, off_t offset)
{
int result;

Expand Down
10 changes: 5 additions & 5 deletions components/dfs/dfs_v2/filesystems/devfs/devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ struct device_dirent

int dfs_devfs_open(struct dfs_file *file);
int dfs_devfs_close(struct dfs_file *file);
int generic_dfs_lseek(struct dfs_file *file, off_t offset, int whence);
int dfs_devfs_read(struct dfs_file *file, void *buf, size_t count, off_t *pos);
int dfs_devfs_write(struct dfs_file *file, const void *buf, size_t count, off_t *pos);
off_t generic_dfs_lseek(struct dfs_file *file, off_t offset, int whence);
ssize_t dfs_devfs_read(struct dfs_file *file, void *buf, size_t count, off_t *pos);
ssize_t dfs_devfs_write(struct dfs_file *file, const void *buf, size_t count, off_t *pos);
int dfs_devfs_ioctl(struct dfs_file *file, int cmd, void *args);
int dfs_devfs_getdents(struct dfs_file *file, struct dirent *dirp, uint32_t count);
static int dfs_devfs_poll(struct dfs_file *file, struct rt_pollreq *req);
Expand Down Expand Up @@ -275,7 +275,7 @@ int dfs_devfs_ioctl(struct dfs_file *file, int cmd, void *args)
return result;
}

int dfs_devfs_read(struct dfs_file *file, void *buf, size_t count, off_t *pos)
ssize_t dfs_devfs_read(struct dfs_file *file, void *buf, size_t count, off_t *pos)
{
int result;
rt_device_t dev_id;
Expand All @@ -296,7 +296,7 @@ int dfs_devfs_read(struct dfs_file *file, void *buf, size_t count, off_t *pos)
return result;
}

int dfs_devfs_write(struct dfs_file *file, const void *buf, size_t count, off_t *pos)
ssize_t dfs_devfs_write(struct dfs_file *file, const void *buf, size_t count, off_t *pos)
{
int result;
rt_device_t dev_id;
Expand Down
6 changes: 3 additions & 3 deletions components/dfs/dfs_v2/filesystems/elmfat/dfs_elm.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ int dfs_elm_ioctl(struct dfs_file *file, int cmd, void *args)
return -ENOSYS;
}

int dfs_elm_read(struct dfs_file *file, void *buf, size_t len, off_t *pos)
ssize_t dfs_elm_read(struct dfs_file *file, void *buf, size_t len, off_t *pos)
{
FIL *fd;
FRESULT result;
Expand All @@ -581,7 +581,7 @@ int dfs_elm_read(struct dfs_file *file, void *buf, size_t len, off_t *pos)
return elm_result_to_dfs(result);
}

int dfs_elm_write(struct dfs_file *file, const void *buf, size_t len, off_t *pos)
ssize_t dfs_elm_write(struct dfs_file *file, const void *buf, size_t len, off_t *pos)
{
FIL *fd;
FRESULT result;
Expand Down Expand Up @@ -618,7 +618,7 @@ int dfs_elm_flush(struct dfs_file *file)
return elm_result_to_dfs(result);
}

int dfs_elm_lseek(struct dfs_file *file, off_t offset, int wherece)
off_t dfs_elm_lseek(struct dfs_file *file, off_t offset, int wherece)
{
FRESULT result = FR_OK;
if (file->vnode->type == FT_REGULAR)
Expand Down
2 changes: 1 addition & 1 deletion components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static int dfs_romfs_free_vnode(struct dfs_vnode *vnode)
return 0;
}

static int dfs_romfs_read(struct dfs_file *file, void *buf, size_t count, off_t *pos)
static ssize_t dfs_romfs_read(struct dfs_file *file, void *buf, size_t count, off_t *pos)
{
rt_size_t length;
struct romfs_dirent *dirent;
Expand Down
6 changes: 3 additions & 3 deletions components/dfs/dfs_v2/filesystems/tmpfs/dfs_tmpfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ struct tmpfs_file *dfs_tmpfs_lookup(struct tmpfs_sb *superblock,
return NULL;
}

static int dfs_tmpfs_read(struct dfs_file *file, void *buf, size_t count, off_t *pos)
static ssize_t dfs_tmpfs_read(struct dfs_file *file, void *buf, size_t count, off_t *pos)
{
rt_size_t length;
struct tmpfs_file *d_file;
Expand All @@ -295,7 +295,7 @@ static int dfs_tmpfs_read(struct dfs_file *file, void *buf, size_t count, off_t
return length;
}

static int dfs_tmpfs_write(struct dfs_file *file, const void *buf, size_t count, off_t *pos)
static ssize_t dfs_tmpfs_write(struct dfs_file *file, const void *buf, size_t count, off_t *pos)
{
struct tmpfs_file *d_file;
struct tmpfs_sb *superblock;
Expand Down Expand Up @@ -334,7 +334,7 @@ static int dfs_tmpfs_write(struct dfs_file *file, const void *buf, size_t count,
return count;
}

static int dfs_tmpfs_lseek(struct dfs_file *file, off_t offset, int wherece)
static off_t dfs_tmpfs_lseek(struct dfs_file *file, off_t offset, int wherece)
{
if (offset <= (off_t)file->vnode->size)
{
Expand Down
8 changes: 4 additions & 4 deletions components/dfs/dfs_v2/include/dfs_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ struct dfs_file_ops
int (*open)(struct dfs_file *file);
int (*close)(struct dfs_file *file);
int (*ioctl)(struct dfs_file *file, int cmd, void *arg);
int (*read)(struct dfs_file *file, void *buf, size_t count, off_t *pos);
int (*write)(struct dfs_file *file, const void *buf, size_t count, off_t *pos);
ssize_t (*read)(struct dfs_file *file, void *buf, size_t count, off_t *pos);
ssize_t (*write)(struct dfs_file *file, const void *buf, size_t count, off_t *pos);
int (*flush)(struct dfs_file *file);
int (*lseek)(struct dfs_file *file, off_t offset, int wherece);
off_t (*lseek)(struct dfs_file *file, off_t offset, int wherece);
int (*truncate)(struct dfs_file *file, off_t offset);
int (*getdents)(struct dfs_file *file, struct dirent *dirp, uint32_t count);
int (*poll)(struct dfs_file *file, struct rt_pollreq *req);
Expand Down Expand Up @@ -142,7 +142,7 @@ int dfs_file_close(struct dfs_file *file);

ssize_t dfs_file_read(struct dfs_file *file, void *buf, size_t len);
ssize_t dfs_file_write(struct dfs_file *file, const void *buf, size_t len);
int generic_dfs_lseek(struct dfs_file *file, off_t offset, int whence);
off_t generic_dfs_lseek(struct dfs_file *file, off_t offset, int whence);
off_t dfs_file_lseek(struct dfs_file *file, off_t offset, int wherece);
int dfs_file_stat(const char *path, struct stat *buf);
int dfs_file_lstat(const char *path, struct stat *buf);
Expand Down
2 changes: 1 addition & 1 deletion components/dfs/dfs_v2/src/dfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ ssize_t dfs_file_write(struct dfs_file *file, const void *buf, size_t len)
return ret;
}

int generic_dfs_lseek(struct dfs_file *file, off_t offset, int whence)
off_t generic_dfs_lseek(struct dfs_file *file, off_t offset, int whence)
{
off_t foffset;

Expand Down
8 changes: 4 additions & 4 deletions components/drivers/ipc/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ static int pipe_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
* When the return value is -EAGAIN, it means there are no data to be read.
*/
#ifdef RT_USING_DFS_V2
static int pipe_fops_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
static ssize_t pipe_fops_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
#else
static int pipe_fops_read(struct dfs_file *fd, void *buf, size_t count)
static ssize_t pipe_fops_read(struct dfs_file *fd, void *buf, size_t count)
#endif
{
int len = 0;
Expand Down Expand Up @@ -261,9 +261,9 @@ static int pipe_fops_read(struct dfs_file *fd, void *buf, size_t count)
* When the return value is -EPIPE, it means there is no thread that has the pipe open for reading.
*/
#ifdef RT_USING_DFS_V2
static int pipe_fops_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
static ssize_t pipe_fops_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
#else
static int pipe_fops_write(struct dfs_file *fd, const void *buf, size_t count)
static ssize_t pipe_fops_write(struct dfs_file *fd, const void *buf, size_t count)
#endif
{
int len;
Expand Down
8 changes: 4 additions & 4 deletions components/drivers/serial/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ static int serial_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
}

#ifdef RT_USING_DFS_V2
static int serial_fops_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
static ssize_t serial_fops_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
#else
static int serial_fops_read(struct dfs_file *fd, void *buf, size_t count)
static ssize_t serial_fops_read(struct dfs_file *fd, void *buf, size_t count)
#endif
{
int size = 0;
Expand Down Expand Up @@ -174,9 +174,9 @@ static int serial_fops_read(struct dfs_file *fd, void *buf, size_t count)
}

#ifdef RT_USING_DFS_V2
static int serial_fops_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
static ssize_t serial_fops_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
#else
static int serial_fops_write(struct dfs_file *fd, const void *buf, size_t count)
static ssize_t serial_fops_write(struct dfs_file *fd, const void *buf, size_t count)
#endif
{
rt_device_t device;
Expand Down
8 changes: 4 additions & 4 deletions components/drivers/tty/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ static int tty_ioctl(struct dfs_file *fd, int cmd, void *args)
}

#ifdef RT_USING_DFS_V2
static int tty_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
static ssize_t tty_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
#else
static int tty_read(struct dfs_file *fd, void *buf, size_t count)
static ssize_t tty_read(struct dfs_file *fd, void *buf, size_t count)
#endif
{
int ret = 0;
Expand All @@ -327,9 +327,9 @@ static int tty_read(struct dfs_file *fd, void *buf, size_t count)
}

#ifdef RT_USING_DFS_V2
static int tty_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
static ssize_t tty_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
#else
static int tty_write(struct dfs_file *fd, const void *buf, size_t count )
static ssize_t tty_write(struct dfs_file *fd, const void *buf, size_t count )
#endif
{
int ret = 0;
Expand Down
8 changes: 4 additions & 4 deletions components/net/sal/dfs_net/dfs_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ static int dfs_net_ioctl(struct dfs_file* file, int cmd, void* args)
}

#ifdef RT_USING_DFS_V2
static int dfs_net_read(struct dfs_file* file, void *buf, size_t count, off_t *pos)
static ssize_t dfs_net_read(struct dfs_file* file, void *buf, size_t count, off_t *pos)
#else
static int dfs_net_read(struct dfs_file* file, void *buf, size_t count)
static ssize_t dfs_net_read(struct dfs_file* file, void *buf, size_t count)
#endif
{
int ret;
Expand All @@ -66,9 +66,9 @@ static int dfs_net_read(struct dfs_file* file, void *buf, size_t count)
}

#ifdef RT_USING_DFS_V2
static int dfs_net_write(struct dfs_file *file, const void *buf, size_t count, off_t *pos)
static ssize_t dfs_net_write(struct dfs_file *file, const void *buf, size_t count, off_t *pos)
#else
static int dfs_net_write(struct dfs_file *file, const void *buf, size_t count)
static ssize_t dfs_net_write(struct dfs_file *file, const void *buf, size_t count)
#endif
{
int ret;
Expand Down