* @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
| 9719 | * @see sys_fstatfs |
| 9720 | */ |
| 9721 | sysret_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 | |
| 9746 | static char *_cp_from_usr_string(char *dst, char *src, size_t length) |
| 9747 | { |
nothing calls this directly
no test coverage detected