#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:
Blocking:

Description

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.

Release:
4.6.99

Environment:
RTEMS POSIX interface

How-To-Repeat:
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.
pr796.diff
semtimedwait.txt (974 bytes) - added by dufault on 12/03/06 at 13:31:13.
semtimedwait.txt

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

semtimedwait.txt

Note: See TracTickets for help on using tickets.