* @brief Set the value of an interval timer. * * This function is used to set the value of a specified timer that generates periodic signals * after the specified intervals. The timer can be configured to generate a signal when it expires, * and it can be used for tasks like scheduling periodic events. * * @param[in] which Specifies which timer to set. Possible values include: *
| 10857 | * @see sys_getitimer(), sigaction(), alarm(), setitimer(). |
| 10858 | */ |
| 10859 | sysret_t sys_setitimer(int which, const struct itimerspec *restrict new, struct itimerspec *restrict old) |
| 10860 | { |
| 10861 | sysret_t rc = 0; |
| 10862 | rt_lwp_t lwp = lwp_self(); |
| 10863 | struct itimerspec new_value_k; |
| 10864 | struct itimerspec old_value_k; |
| 10865 | |
| 10866 | if (lwp_get_from_user(&new_value_k, (void *)new, sizeof(*new)) != sizeof(*new)) |
| 10867 | { |
| 10868 | return -EFAULT; |
| 10869 | } |
| 10870 | |
| 10871 | rc = lwp_signal_setitimer(lwp, which, &new_value_k, &old_value_k); |
| 10872 | if (old && lwp_put_to_user(old, (void *)&old_value_k, sizeof old_value_k) != sizeof old_value_k) |
| 10873 | return -EFAULT; |
| 10874 | |
| 10875 | return rc; |
| 10876 | } |
| 10877 | |
| 10878 | /** |
| 10879 | * @brief Set the robust list for the current thread. |
nothing calls this directly
no test coverage detected