#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
sem_timedwait() may return non POSIX code, Eg -2147483639 (0x80000009: Operation timed out)
Specification: http://www.opengroup.org/onlinepubs/009695399/functions/sem_timedwait.html
Change History (3)
comment:1 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
follow-up: 3 comment:2 by , 15 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.
comment:3 by , 15 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.
That would be ETIMEDOUT, which is a valid error code.
BTW, the current standard is IEEE Std 1003.1™-2008.