[haiku-commits] r41912 - haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper

Author: bonefish
Date: 2011-06-04 21:31:22 +0200 (Sat, 04 Jun 2011)
New Revision: 41912
Changeset: https://dev.haiku-os.org/changeset/41912

Added:
   
haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper/time.cpp
Modified:
   haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper/Jamfile
Log:
clock_nanosleep() and clock_getcpuclockid() return error codes directly and
therefore need to be wrapped.


Modified: 
haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper/Jamfile
===================================================================
--- 
haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper/Jamfile   
    2011-06-04 19:30:26 UTC (rev 41911)
+++ 
haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper/Jamfile   
    2011-06-04 19:31:22 UTC (rev 41912)
@@ -14,4 +14,5 @@
        pthread_spinlock.cpp
        pthread_thread.cpp
        signal.cpp
+       time.cpp
 ;

Added: 
haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper/time.cpp
===================================================================
--- 
haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper/time.cpp  
                            (rev 0)
+++ 
haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper/time.cpp  
    2011-06-04 19:31:22 UTC (rev 41912)
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2011, Ingo Weinhold, ingo_weinhold@xxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include <time.h>
+
+#include "posix_error_mapper.h"
+
+
+WRAPPER_FUNCTION(int, clock_nanosleep,
+               (clockid_t clockID, int flags, const struct timespec* time,
+                       struct timespec* remainingTime),
+       return B_TO_POSITIVE_ERROR(sReal_clock_nanosleep(clockID, flags, time,
+               remainingTime));
+)
+
+
+WRAPPER_FUNCTION(int, clock_getcpuclockid,
+               (pid_t pid, clockid_t* _clockID),
+       return B_TO_POSITIVE_ERROR(sReal_clock_getcpuclockid(pid, _clockID));
+)


Other related posts:

  • » [haiku-commits] r41912 - haiku/branches/developer/bonefish/signals/src/libs/posix_error_mapper - ingo_weinhold