MCPcopy Create free account
hub / github.com/F-Stack/f-stack / freebsd32_ksem_timedwait

Function freebsd32_ksem_timedwait

freebsd/kern/uipc_sem.c:988–1012  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

986}
987
988int
989freebsd32_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
1014static struct syscall_helper_data ksem32_syscalls[] = {
1015 SYSCALL32_INIT_HELPER(freebsd32_ksem_init),

Callers

nothing calls this directly

Calls 2

kern_sem_waitFunction · 0.85
copyinFunction · 0.50

Tested by

no test coverage detected