* @brief Get the resolution of the specified clock. * * This function retrieves the resolution of the specified clock, which is the smallest time interval that the clock can measure. * The resolution is returned in a `struct timespec` which contains seconds and nanoseconds. * * @param[in] clk The clock ID for which to get the resolution. The clock can be one of the following: *
| 8219 | * @see sys_clock_gettime(), sys_clock_settime(), sys_clock_nanosleep() |
| 8220 | */ |
| 8221 | sysret_t sys_clock_getres(clockid_t clk, struct timespec *ts) |
| 8222 | { |
| 8223 | int ret = 0; |
| 8224 | #ifdef ARCH_MM_MMU |
| 8225 | struct timespec kts; |
| 8226 | size_t size = sizeof(struct timespec); |
| 8227 | |
| 8228 | if (!lwp_user_accessable((void *)ts, size)) |
| 8229 | { |
| 8230 | return -EFAULT; |
| 8231 | } |
| 8232 | |
| 8233 | ret = clock_getres(clk, &kts); |
| 8234 | |
| 8235 | if (ret != -1) |
| 8236 | lwp_put_to_user(ts, &kts, size); |
| 8237 | #else |
| 8238 | if (!lwp_user_accessable((void *)ts, sizeof(struct timespec))) |
| 8239 | { |
| 8240 | return -EFAULT; |
| 8241 | } |
| 8242 | ret = clock_getres(clk, ts); |
| 8243 | #endif |
| 8244 | return (ret < 0 ? GET_ERRNO() : ret); |
| 8245 | } |
| 8246 | |
| 8247 | /** |
| 8248 | * @brief Rename or move a file or directory. |
nothing calls this directly
no test coverage detected