| 986 | } |
| 987 | |
| 988 | int |
| 989 | freebsd32_ksem_timedwait(struct thread *td, |
| 990 | struct freebsd32_ksem_timedwait_args *uap) |
| 991 | { |
| 992 | struct timespec32 abstime32; |
| 993 | struct timespec *ts, abstime; |
| 994 | int error; |
| 995 | |
| 996 | /* |
| 997 | * We allow a null timespec (wait forever). |
| 998 | */ |
| 999 | if (uap->abstime == NULL) |
| 1000 | ts = NULL; |
| 1001 | else { |
| 1002 | error = copyin(uap->abstime, &abstime32, sizeof(abstime32)); |
| 1003 | if (error != 0) |
| 1004 | return (error); |
| 1005 | CP(abstime32, abstime, tv_sec); |
| 1006 | CP(abstime32, abstime, tv_nsec); |
| 1007 | if (abstime.tv_nsec >= 1000000000 || abstime.tv_nsec < 0) |
| 1008 | return (EINVAL); |
| 1009 | ts = &abstime; |
| 1010 | } |
| 1011 | return (kern_sem_wait(td, uap->id, 0, ts)); |
| 1012 | } |
| 1013 | |
| 1014 | static struct syscall_helper_data ksem32_syscalls[] = { |
| 1015 | SYSCALL32_INIT_HELPER(freebsd32_ksem_init), |
nothing calls this directly
no test coverage detected