* @brief Retrieves the current time and interval of a timer. * * This system call fetches the current expiration time (`it_value`) and interval (`it_interval`) * of a previously created timer. It allows the caller to determine the current state of the timer, * whether it is one-shot or periodic, and the remaining time before expiration. * * @param[in] timerid The ID of the timer to que
| 3178 | * will result in errors. |
| 3179 | */ |
| 3180 | sysret_t sys_timer_gettime(timer_t timerid, struct itimerspec *curr_value) |
| 3181 | { |
| 3182 | int ret = 0; |
| 3183 | #ifdef ARCH_MM_MMU |
| 3184 | |
| 3185 | struct itimerspec curr_value_k; |
| 3186 | lwp_get_from_user(&curr_value_k, (void *)curr_value, sizeof curr_value_k); |
| 3187 | ret = timer_gettime(timerid, &curr_value_k); |
| 3188 | lwp_put_to_user(curr_value, (void *)&curr_value_k, sizeof curr_value_k); |
| 3189 | #else |
| 3190 | ret = timer_gettime(timerid, curr_value); |
| 3191 | #endif |
| 3192 | return (ret < 0 ? GET_ERRNO() : ret); |
| 3193 | } |
| 3194 | |
| 3195 | /** |
| 3196 | * @brief Retrieves the overrun count for a periodic timer. |
nothing calls this directly
no test coverage detected