mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/vfs: Add vfs_dstatvfs
This commit is contained in:
parent
ff1f81aac8
commit
599eade495
@ -715,6 +715,17 @@ int vfs_fstat(int fd, struct stat *buf);
|
||||
*/
|
||||
int vfs_fstatvfs(int fd, struct statvfs *buf);
|
||||
|
||||
/**
|
||||
* @brief Get file system status of the file system containing an open directory
|
||||
*
|
||||
* @param[in] dirp pointer to open directory
|
||||
* @param[out] buf pointer to statvfs struct to fill
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return <0 on error
|
||||
*/
|
||||
int vfs_dstatvfs(vfs_DIR *dirp, struct statvfs *buf);
|
||||
|
||||
/**
|
||||
* @brief Seek to position in file
|
||||
*
|
||||
|
@ -223,6 +223,20 @@ int vfs_fstatvfs(int fd, struct statvfs *buf)
|
||||
return filp->mp->fs->fs_op->statvfs(filp->mp, "/", buf);
|
||||
}
|
||||
|
||||
int vfs_dstatvfs(vfs_DIR *dirp, struct statvfs *buf)
|
||||
{
|
||||
DEBUG("vfs_dstatvfs: %p, %p\n", (void*)dirp, (void *)buf);
|
||||
if (buf == NULL) {
|
||||
return -EFAULT;
|
||||
}
|
||||
memset(buf, 0, sizeof(*buf));
|
||||
if (dirp->mp->fs->fs_op->statvfs == NULL) {
|
||||
/* file system driver does not implement statvfs() */
|
||||
return -EINVAL;
|
||||
}
|
||||
return dirp->mp->fs->fs_op->statvfs(dirp->mp, "/", buf);
|
||||
}
|
||||
|
||||
off_t vfs_lseek(int fd, off_t off, int whence)
|
||||
{
|
||||
DEBUG("vfs_lseek: %d, %ld, %d\n", fd, (long)off, whence);
|
||||
|
Loading…
Reference in New Issue
Block a user