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

Function sys_fstatfs64

components/lwp/lwp_syscall.c:9721–9744  ·  view source on GitHub ↗

* @brief Get 64-bit filesystem statistics for a file descriptor. * * This function retrieves 64-bit statistics about the filesystem containing the file referred to by * the file descriptor `fd`. The statistics are stored in the provided `statfs` structure, which * includes details such as total blocks, free blocks, available inodes, etc. The function differs * from `sys_fstatfs` in that it su

Source from the content-addressed store, hash-verified

9719 * @see sys_fstatfs
9720 */
9721sysret_t sys_fstatfs64(int fd, size_t sz, struct statfs *buf)
9722{
9723 int ret = 0;
9724 struct statfs statfsbuff = {0};
9725
9726 if (!lwp_user_accessable((void *)buf, sizeof(struct statfs)))
9727 {
9728 return -EFAULT;
9729 }
9730
9731 if (sz != sizeof(struct statfs))
9732 {
9733 return -EINVAL;
9734 }
9735
9736 ret = _SYS_WRAP(fstatfs(fd, &statfsbuff));
9737
9738 if (ret == 0)
9739 {
9740 lwp_put_to_user(buf, &statfsbuff, sizeof statfsbuff);
9741 }
9742
9743 return ret;
9744}
9745
9746static char *_cp_from_usr_string(char *dst, char *src, size_t length)
9747{

Callers

nothing calls this directly

Calls 3

lwp_user_accessableFunction · 0.85
lwp_put_to_userFunction · 0.85
fstatfsFunction · 0.50

Tested by

no test coverage detected