From 9097327dc1c667fc51b8e05cc7c0626fac96665d Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Mon, 14 May 2001 14:17:54 +0000 Subject: Initial revision --- .../dietlibc/libpthread/pthread_setcanceltype.c | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c (limited to 'mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c') diff --git a/mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c b/mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c new file mode 100644 index 000000000..03d1f53de --- /dev/null +++ b/mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c @@ -0,0 +1,25 @@ +#include +#include + +#include +#include "thread_internal.h" + +int pthread_setcanceltype(int type, int *oldtype) +{ + _pthread_descr thread; + + __THREAD_INIT(); + + if ((type==PTHREAD_CANCEL_DEFERRED) || (type==PTHREAD_CANCEL_ASYNCHRONOUS)) + { + thread = __thread_self(); + + if (oldtype) *oldtype = thread->canceltype; + thread->canceltype = type; + + return 0; + } + + (*(__errno_location()))=EINVAL; + return -1; +} -- cgit v1.2.1