summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libpthread/pthread_create.c
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2003-04-17 14:51:14 +0000
committerMystery Man <unknown@mandriva.org>2003-04-17 14:51:14 +0000
commitef016519fadd0d52908858470a704cce6a8ceeff (patch)
tree7dda80ef3508a0b6422cc2ea34ce1d933b81f2a4 /mdk-stage1/dietlibc/libpthread/pthread_create.c
parent327bd24f8e4291bd1882de1990dd7339f781a9cb (diff)
downloaddrakx-backup-do-not-use-ef016519fadd0d52908858470a704cce6a8ceeff.tar
drakx-backup-do-not-use-ef016519fadd0d52908858470a704cce6a8ceeff.tar.gz
drakx-backup-do-not-use-ef016519fadd0d52908858470a704cce6a8ceeff.tar.bz2
drakx-backup-do-not-use-ef016519fadd0d52908858470a704cce6a8ceeff.tar.xz
drakx-backup-do-not-use-ef016519fadd0d52908858470a704cce6a8ceeff.zip
This commit was manufactured by cvs2svn to create tag 'V1_1_9_55mdk'.V1_1_9_55mdk
Diffstat (limited to 'mdk-stage1/dietlibc/libpthread/pthread_create.c')
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_create.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_create.c b/mdk-stage1/dietlibc/libpthread/pthread_create.c
deleted file mode 100644
index b4a499081..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_create.c
+++ /dev/null
@@ -1,76 +0,0 @@
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_create (pthread_t *thread, const pthread_attr_t *attr,
- void *(*start_routine) (void *), void *arg)
-{
- int ret=0;
- _pthread_descr td;
- pthread_attr_t default_attr;
-
- __THREAD_INIT();
-
- if (start_routine==0) {
- (*(__errno_location()))=EINVAL;
- return -1;
- }
-
- td = __thread_get_free();
-
- if (td) {
- if (!(attr)) {
- pthread_attr_init(&default_attr);
- attr=&default_attr;
- }
-
- if ((td->policy!=SCHED_OTHER)&&(td->priority==0)) {
- (*(__errno_location()))=EINVAL;
- return -1;
- }
-
- if (attr->__inheritsched==PTHREAD_INHERIT_SCHED) {
- _pthread_descr this = __thread_self();
- td->policy = this->policy;
- td->priority = this->priority;
- } else {
- td->policy = attr->__schedpolicy;
- td->priority = attr->__schedparam.sched_priority;
- }
-
- td->func = start_routine;
- td->arg = arg;
-
- td->detached = attr->__detachstate;
-
- td->stack_size = attr->__stacksize;
-
- if (!(td->stack_addr)) {
- char *stack=(char*)malloc(td->stack_size);
- if (!(stack)) {
- (*(__errno_location()))=EINVAL;
- return -1;
- }
- td->stack_begin = stack;
- td->stack_addr = stack+td->stack_size;
- } else {
- td->stack_begin = 0;
- td->stack_addr = attr->__stackaddr;
- }
-
- ret = signal_manager_thread(td);
-
- if (ret>1)
- *thread=ret;
- else
- __thread_cleanup(td);
- }
- else
- (*(__errno_location()))=EAGAIN;
-
- if (ret<2) return -1;
- return ret;
-}