Kernel/LibC: Implement pthread_attr_init
This commit is contained in:
parent
4bcd3ed86f
commit
08f5833ca8
|
@ -2051,10 +2051,14 @@ namespace Kernel
|
||||||
|
|
||||||
BAN::ErrorOr<long> Process::sys_pthread_create(const pthread_attr_t* attr, void (*entry)(void*), void* arg)
|
BAN::ErrorOr<long> Process::sys_pthread_create(const pthread_attr_t* attr, void (*entry)(void*), void* arg)
|
||||||
{
|
{
|
||||||
if (attr != nullptr)
|
if (attr)
|
||||||
{
|
{
|
||||||
dwarnln("pthread attr not supported");
|
TRY(validate_pointer_access(attr, sizeof(*attr), false));
|
||||||
return BAN::Error::from_errno(ENOTSUP);
|
if (*attr)
|
||||||
|
{
|
||||||
|
dwarnln("pthread attr not supported");
|
||||||
|
return BAN::Error::from_errno(ENOTSUP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LockGuard _(m_process_lock);
|
LockGuard _(m_process_lock);
|
||||||
|
|
|
@ -80,6 +80,12 @@ void pthread_cleanup_push(void (*routine)(void*), void* arg)
|
||||||
s_cleanup_stack = cleanup;
|
s_cleanup_stack = cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pthread_attr_init(pthread_attr_t* attr)
|
||||||
|
{
|
||||||
|
*attr = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int pthread_create(pthread_t* __restrict thread_id, const pthread_attr_t* __restrict attr, void* (*start_routine)(void*), void* __restrict arg)
|
int pthread_create(pthread_t* __restrict thread_id, const pthread_attr_t* __restrict attr, void* (*start_routine)(void*), void* __restrict arg)
|
||||||
{
|
{
|
||||||
auto* info = static_cast<pthread_trampoline_info_t*>(malloc(sizeof(pthread_trampoline_info_t)));
|
auto* info = static_cast<pthread_trampoline_info_t*>(malloc(sizeof(pthread_trampoline_info_t)));
|
||||||
|
|
Loading…
Reference in New Issue