MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / fstatfs

Function fstatfs

components/dfs/dfs_v1/src/dfs_posix.c:617–631  ·  view source on GitHub ↗

* this function is a POSIX compliant version, which will return the * information about a mounted file system. * * @param fildes the file description. * @param buf the buffer to save the returned information. * * @return 0 on successful, others on failed. */

Source from the content-addressed store, hash-verified

615 * @return 0 on successful, others on failed.
616 */
617int fstatfs(int fildes, struct statfs *buf)
618{
619 struct dfs_file *d;
620
621 /* get the fd */
622 d = fd_get(fildes);
623 if (d == NULL)
624 {
625 rt_set_errno(-EBADF);
626
627 return -1;
628 }
629
630 return statfs(d->vnode->fullpath, buf);
631}
632RTM_EXPORT(fstatfs);
633
634/**

Callers 2

sys_fstatfsFunction · 0.50
sys_fstatfs64Function · 0.50

Calls 3

rt_set_errnoFunction · 0.85
fd_getFunction · 0.70
statfsFunction · 0.70

Tested by

no test coverage detected