[Bug 1570] New: sem_timedwait() returns error code instead of assigning errno and returning -1

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Thu Jun 17 12:07:37 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1570

           Summary: sem_timedwait() returns error code instead of
                    assigning errno and returning -1
           Product: RTEMS
           Version: 4.10
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: dufault at hda.com


Opengroup says:
"If the call was unsuccessful, the state of the semaphore shall be unchanged,
and the function shall return a value of -1 and set errno to indicate the
error".
The RTEMS implementation returns the error instead of doing that:

  if ( !do_wait && (lock_status == EBUSY) ) {
    switch (lock_status) {
      case POSIX_ABSOLUTE_TIMEOUT_INVALID:
        return EINVAL;
      case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST:
      case POSIX_ABSOLUTE_TIMEOUT_IS_NOW:
        return ETIMEDOUT;
      case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
        break;
    }
  }

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list