From 35ca8fd8aa6a5045c30bfadff2845988db3f2e9c Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 15 Apr 2010 21:23:46 +0000 Subject: [PATCH] Added various missing functions to the error mapper. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36320 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/libs/posix_error_mapper/Jamfile | 1 + src/libs/posix_error_mapper/pthread_attr.cpp | 17 ++++++++++++++++- src/libs/posix_error_mapper/pthread_thread.cpp | 17 ++++++++++++++++- src/libs/posix_error_mapper/signal.cpp | 15 +++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 src/libs/posix_error_mapper/signal.cpp diff --git a/src/libs/posix_error_mapper/Jamfile b/src/libs/posix_error_mapper/Jamfile index 0218cf86aa..e20e27f027 100644 --- a/src/libs/posix_error_mapper/Jamfile +++ b/src/libs/posix_error_mapper/Jamfile @@ -12,4 +12,5 @@ StaticLibrary libposix_error_mapper.a : pthread_rwlock.cpp pthread_specific.cpp pthread_thread.cpp + signal.cpp ; diff --git a/src/libs/posix_error_mapper/pthread_attr.cpp b/src/libs/posix_error_mapper/pthread_attr.cpp index 5436eb6f1f..163220afeb 100644 --- a/src/libs/posix_error_mapper/pthread_attr.cpp +++ b/src/libs/posix_error_mapper/pthread_attr.cpp @@ -1,8 +1,9 @@ /* - * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. + * Copyright 2009-2010, Ingo Weinhold, ingo_weinhold@gmx.de. * Distributed under the terms of the MIT License. */ + #include #include "posix_error_mapper.h" @@ -58,3 +59,17 @@ WRAPPER_FUNCTION(int, pthread_attr_setscope, return B_TO_POSITIVE_ERROR(sReal_pthread_attr_setscope(attr, contentionScope)); ) + + +WRAPPER_FUNCTION(int, pthread_attr_setschedparam, + (pthread_attr_t *attr, const struct sched_param *param), + return B_TO_POSITIVE_ERROR(sReal_pthread_attr_setschedparam(attr, + param)); +) + + +WRAPPER_FUNCTION(int, pthread_attr_getschedparam, + (const pthread_attr_t *attr, struct sched_param *param), + return B_TO_POSITIVE_ERROR(sReal_pthread_attr_getschedparam(attr, + param)); +) diff --git a/src/libs/posix_error_mapper/pthread_thread.cpp b/src/libs/posix_error_mapper/pthread_thread.cpp index f3deb38d35..7fcca73b96 100644 --- a/src/libs/posix_error_mapper/pthread_thread.cpp +++ b/src/libs/posix_error_mapper/pthread_thread.cpp @@ -1,8 +1,9 @@ /* - * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. + * Copyright 2009-2010, Ingo Weinhold, ingo_weinhold@gmx.de. * Distributed under the terms of the MIT License. */ + #include #include "posix_error_mapper.h" @@ -50,3 +51,17 @@ WRAPPER_FUNCTION(int, pthread_setcancelstate, WRAPPER_FUNCTION(int, pthread_setcanceltype, (int type, int *_oldType), return B_TO_POSITIVE_ERROR(sReal_pthread_setcanceltype(type, _oldType)); ) + + +WRAPPER_FUNCTION(int, pthread_getschedparam, + (pthread_t thread, int *policy, struct sched_param *param), + return B_TO_POSITIVE_ERROR(sReal_pthread_getschedparam(thread, policy, + param)); +) + + +WRAPPER_FUNCTION(int, pthread_setschedparam, + (pthread_t thread, int policy, const struct sched_param *param), + return B_TO_POSITIVE_ERROR(sReal_pthread_setschedparam(thread, policy, + param)); +) diff --git a/src/libs/posix_error_mapper/signal.cpp b/src/libs/posix_error_mapper/signal.cpp new file mode 100644 index 0000000000..eac3a8012b --- /dev/null +++ b/src/libs/posix_error_mapper/signal.cpp @@ -0,0 +1,15 @@ +/* + * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de. + * Distributed under the terms of the MIT License. + */ + + +#include + +#include "posix_error_mapper.h" + + +WRAPPER_FUNCTION(int, pthread_sigmask, + (int how, const sigset_t *set, sigset_t *oldSet), + return B_TO_POSITIVE_ERROR(sReal_pthread_sigmask(how, set, oldSet)); +)