| 770 | }; |
| 771 | #endif |
| 772 | int |
| 773 | sys_ksem_timedwait(struct thread *td, struct ksem_timedwait_args *uap) |
| 774 | { |
| 775 | struct timespec abstime; |
| 776 | struct timespec *ts; |
| 777 | int error; |
| 778 | |
| 779 | /* |
| 780 | * We allow a null timespec (wait forever). |
| 781 | */ |
| 782 | if (uap->abstime == NULL) |
| 783 | ts = NULL; |
| 784 | else { |
| 785 | error = copyin(uap->abstime, &abstime, sizeof(abstime)); |
| 786 | if (error != 0) |
| 787 | return (error); |
| 788 | if (abstime.tv_nsec >= 1000000000 || abstime.tv_nsec < 0) |
| 789 | return (EINVAL); |
| 790 | ts = &abstime; |
| 791 | } |
| 792 | return (kern_sem_wait(td, uap->id, 0, ts)); |
| 793 | } |
| 794 | |
| 795 | #ifndef _SYS_SYSPROTO_H_ |
| 796 | struct ksem_trywait_args { |
nothing calls this directly
no test coverage detected