diff --git a/repos/libports/lib/symbols/libc b/repos/libports/lib/symbols/libc index b75d1d695..2df5d8ac2 100644 --- a/repos/libports/lib/symbols/libc +++ b/repos/libports/lib/symbols/libc @@ -948,6 +948,7 @@ _ZN16Pthread_registry6insertEP7pthread T _ZN16Pthread_registry6removeEP7pthread T _ZN16Pthread_registry8containsEP7pthread T _ZN4Libc14pthread_createEPP7pthreadPFPvS3_ES3_mPKcPN6Genode11Cpu_sessionENS8_8Affinity8LocationE T +_ZN4Libc14pthread_createEPP7pthreadRN6Genode6ThreadE T # # Libc plugin interface diff --git a/repos/libports/src/lib/libc/thread_create.cc b/repos/libports/src/lib/libc/thread_create.cc index 305f9896f..f0f891670 100644 --- a/repos/libports/src/lib/libc/thread_create.cc +++ b/repos/libports/src/lib/libc/thread_create.cc @@ -37,6 +37,18 @@ int Libc::pthread_create(pthread_t *thread, } +int Libc::pthread_create(pthread_t *thread, Genode::Thread &t) +{ + pthread_t thread_obj = new pthread(t); + + if (!thread_obj) + return EAGAIN; + + *thread = thread_obj; + return 0; +} + + extern "C" { int pthread_create(pthread_t *thread, const pthread_attr_t *attr, diff --git a/repos/libports/src/lib/libc/thread_create.h b/repos/libports/src/lib/libc/thread_create.h index 94027687c..3f7493d78 100644 --- a/repos/libports/src/lib/libc/thread_create.h +++ b/repos/libports/src/lib/libc/thread_create.h @@ -21,4 +21,6 @@ namespace Libc { void *(*start_routine) (void *), void *arg, size_t stack_size, char const * name, Genode::Cpu_session * cpu, Genode::Affinity::Location location); + + int pthread_create(pthread_t *, Genode::Thread &); }