Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#5334 closed bug (invalid)

Non POSIX return value in sem_timedwait()

Reported by: kaliber Owned by: nobody
Priority: normal Milestone: R1
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Change History (3)

comment:1 by bonefish, 14 years ago

Resolution: invalid
Status: newclosed

That would be ETIMEDOUT, which is a valid error code.

BTW, the current standard is IEEE Std 1003.1™-2008.

comment:2 by kaliber, 14 years ago

You are right. I thought the POSIX codes are positive. Thank you for the information on the current POSIX standard.

But the test case does not work properly in Haiku. The function should return EINVAL instead of ETIMEDOUT. If you want, I can create a new ticket.

in reply to:  2 comment:3 by bonefish, 14 years ago

Replying to kaliber:

You are right. I thought the POSIX codes are positive.

They are indeed. For compatibility with BeOS Haiku has to use negative error codes, though. If a piece of software you're using requires positive error codes, there's an experimental (possibly not yet complete) way to do that:

  • Define the macro B_USE_POSITIVE_POSIX_ERRORS when compiling the code.
  • Link everything against libposix_error_mapper.a.
  • When mixing code using POSIX and Haiku API, the macros B_{FROM,TO}_POSIX_ERROR() have to be used explicitly.

But the test case does not work properly in Haiku. The function should return EINVAL instead of ETIMEDOUT. If you want, I can create a new ticket.

Please do. I don't want to work on this stuff ATM. Maybe someone else does.

Note: See TracTickets for help on using tickets.