#796 closed defect (fixed)

sem_timedwait is using relative time instead of absolute time

Reported by: dufault Owned by: Joel Sherrill
Priority: normal Milestone: 2
Component: score Version: 4.6
Severity: major Keywords:
Cc: bugs@… Blocked By:


POSIX specifies an absolute time for sem_timedwait(). RTEMS is using a relative time. The code from pthread_cond timedwait() can be used, as in the attachment. Note, though, that POSIX specifies that the struct timespec shouldn't be examined if the semaphore won't block - someone will have to look deeper to check that.


RTEMS POSIX interface

Try to do a timed wait specifying five seconds after midnight, January 1 1970. It should timeout immediately, RTEMS will timeout after five seconds.

Attachments (2)

pr796.diff (1.5 KB) - added by dufault on 12/03/06 at 13:31:13.
semtimedwait.txt (974 bytes) - added by dufault on 12/03/06 at 13:31:13.

Download all attachments as: .zip

Change History (2)

comment:1 Changed on 09/01/05 at 13:46:10 by Joel Sherrill

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: Attached patch applied to 4.6 branch and trunk. I took your
patch and added the error checking required.

Changed on 12/03/06 at 13:31:13 by dufault

Attachment: semtimedwait.txt added


Note: See TracTickets for help on using tickets.