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

Function sys_ksem_timedwait

freebsd/kern/uipc_sem.c:772–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

770};
771#endif
772int
773sys_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_
796struct ksem_trywait_args {

Callers

nothing calls this directly

Calls 2

kern_sem_waitFunction · 0.85
copyinFunction · 0.50

Tested by

no test coverage detected