[haiku-bugs] Re: [Haiku] #5334: Non POSIX return value in sem_timedwait()

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Fri, 29 Jan 2010 16:45:17 -0000

#5334: Non POSIX return value in sem_timedwait()
---------------------------+------------------------------------------------
  Reporter:  kaliber       |       Owner:  nobody        
      Type:  bug           |      Status:  closed        
  Priority:  normal        |   Milestone:  R1            
 Component:  System/POSIX  |     Version:  R1/Development
Resolution:  invalid       |    Keywords:                
 Blockedby:                |    Platform:  All           
  Blocking:                |  
---------------------------+------------------------------------------------

Comment(by bonefish):

 Replying to [comment:2 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.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5334#comment:3>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: