2 * Copyright 2009-2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
10 #include "posix_error_mapper.h"
13 WRAPPER_FUNCTION(int, pthread_create
,
14 (pthread_t
*thread
, const pthread_attr_t
*attr
,
15 void *(*start_routine
)(void*), void *arg
),
16 return B_TO_POSITIVE_ERROR(sReal_pthread_create(thread
, attr
, start_routine
,
21 WRAPPER_FUNCTION(int, pthread_detach
, (pthread_t thread
),
22 return B_TO_POSITIVE_ERROR(sReal_pthread_detach(thread
));
26 WRAPPER_FUNCTION(int, pthread_join
, (pthread_t thread
, void **_value
),
27 return B_TO_POSITIVE_ERROR(sReal_pthread_join(thread
, _value
));
31 WRAPPER_FUNCTION(int, pthread_kill
, (pthread_t thread
, int sig
),
32 return B_TO_POSITIVE_ERROR(sReal_pthread_kill(thread
, sig
));
36 WRAPPER_FUNCTION(int, pthread_setconcurrency
, (int newLevel
),
37 return B_TO_POSITIVE_ERROR(sReal_pthread_setconcurrency(newLevel
));
41 WRAPPER_FUNCTION(int, pthread_cancel
, (pthread_t thread
),
42 return B_TO_POSITIVE_ERROR(sReal_pthread_cancel(thread
));
46 WRAPPER_FUNCTION(int, pthread_setcancelstate
,
47 (int state
, int *_oldState
),
48 return B_TO_POSITIVE_ERROR(sReal_pthread_setcancelstate(state
, _oldState
));
52 WRAPPER_FUNCTION(int, pthread_setcanceltype
, (int type
, int *_oldType
),
53 return B_TO_POSITIVE_ERROR(sReal_pthread_setcanceltype(type
, _oldType
));
57 WRAPPER_FUNCTION(int, pthread_getschedparam
,
58 (pthread_t thread
, int *policy
, struct sched_param
*param
),
59 return B_TO_POSITIVE_ERROR(sReal_pthread_getschedparam(thread
, policy
,
64 WRAPPER_FUNCTION(int, pthread_setschedparam
,
65 (pthread_t thread
, int policy
, const struct sched_param
*param
),
66 return B_TO_POSITIVE_ERROR(sReal_pthread_setschedparam(thread
, policy
,