You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Noob <root@localhost> writes:
> Is sem_trywait equivalent to sem_timedwait with a timespec set to 0?
>
> I.e. is
> sem_trywait(sem);
> equivalent to
> struct timespec spec = { 0 };
> sem_timedwait(sem, &spec);
>
> Other than the value of errno when the semaphore is already
> locked (EAGAIN for trywait, ETIMEDOUT for timedwait).
The specification suggests that this is indeed the case.