* @brief Retrieve the current configuration of a timer. * * This function is used to obtain the current expiration time and interval of a timer associated * with a file descriptor created by `sys_timerfd_create`. It allows querying the current state * of the timer, including the time remaining until the next expiration and the period (for periodic timers). * * @param[in] fd The file descr
| 10742 | * contain a value of `0`. |
| 10743 | */ |
| 10744 | sysret_t sys_timerfd_gettime(int fd, struct itimerspec *cur) |
| 10745 | { |
| 10746 | int ret = -1; |
| 10747 | struct itimerspec *kcur; |
| 10748 | |
| 10749 | if (cur == RT_NULL) |
| 10750 | return -EINVAL; |
| 10751 | |
| 10752 | if (!lwp_user_accessable((void *)cur, sizeof(struct itimerspec))) |
| 10753 | { |
| 10754 | return -EFAULT; |
| 10755 | } |
| 10756 | |
| 10757 | kcur = kmem_get(sizeof(struct itimerspec)); |
| 10758 | |
| 10759 | if (kcur) |
| 10760 | { |
| 10761 | lwp_get_from_user(kcur, cur, sizeof(struct itimerspec)); |
| 10762 | ret = timerfd_gettime(fd, kcur); |
| 10763 | lwp_put_to_user(cur, kcur, sizeof(struct itimerspec)); |
| 10764 | kmem_put(kcur); |
| 10765 | } |
| 10766 | |
| 10767 | return (ret < 0 ? GET_ERRNO() : ret); |
| 10768 | } |
| 10769 | |
| 10770 | /** |
| 10771 | * @brief Create a file descriptor for receiving signals. |
nothing calls this directly
no test coverage detected