LibC: Cleanup pthread code and add some pthread_attr functions

errno, pthread cleanup and pthread id are now stored in uthread. This
allows using these without TLS
This commit is contained in:
2025-05-31 23:34:26 +03:00
parent 423386a052
commit c957f1ddca
17 changed files with 368 additions and 146 deletions

View File

@@ -350,6 +350,9 @@ namespace Kernel
.self = reinterpret_cast<struct uthread*>(region->vaddr() + master_size),
.master_tls_addr = reinterpret_cast<void*>(master_addr),
.master_tls_size = master_size,
.cleanup_stack = nullptr,
.id = -1,
.errno_ = 0,
};
const uintptr_t dtv[2] { 1, region->vaddr() };
@@ -2468,11 +2471,7 @@ namespace Kernel
if (attr)
{
TRY(validate_pointer_access(attr, sizeof(*attr), false));
if (*attr)
{
dwarnln("pthread attr not supported");
return BAN::Error::from_errno(ENOTSUP);
}
dwarnln("TODO: ignoring thread attr");
}
LockGuard _(m_process_lock);