summaryrefslogtreecommitdiffhomepage
path: root/src/libPThread
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-26 10:25:04 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-26 10:25:04 +0100
commit349b2aa2e14d3fc2ffadfe629870e6af8f4652f0 (patch)
tree69a67058f4d9f34abc2560c1d54343f3b1ed983a /src/libPThread
parentcfbf446b2cf962b08051638b41b7bb617d9ca538 (diff)
[FEAT] src/lib: System libraries fixes.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/libPThread')
-rw-r--r--src/libPThread/src/.keep0
-rw-r--r--src/libPThread/src/Thread.cpp11
2 files changed, 6 insertions, 5 deletions
diff --git a/src/libPThread/src/.keep b/src/libPThread/src/.keep
deleted file mode 100644
index e69de29b..00000000
--- a/src/libPThread/src/.keep
+++ /dev/null
diff --git a/src/libPThread/src/Thread.cpp b/src/libPThread/src/Thread.cpp
index 5324d979..0d5052f2 100644
--- a/src/libPThread/src/Thread.cpp
+++ b/src/libPThread/src/Thread.cpp
@@ -4,6 +4,7 @@
// Official repository: https://github.com/ne-foss-org/nekernel
#include <libPThread/PThreadKit/Thread.h>
+#include <libSystem/SystemKit/Err.h>
PTHREAD_SAFE SInt32 pthread_detach(ThreadRef thread) {
return ThrDetachThread(thread);
@@ -24,23 +25,23 @@ PTHREAD_SAFE SInt32 pthread_exit(SInt32 retval) {
PTHREAD_SAFE SInt32 pthread_join(ThreadRef thread, VoidPtr* retval) {
SInt32* ret = (SInt32*) retval;
- if (!ret) return -1;
+ if (!ret) return kErrorInvalidData;
*ret = ThrJoinThread(thread);
- return 0;
+ return kErrorSuccess;
}
PTHREAD_SAFE SInt32 pthread_create(_Output ThreadRef* thread, VoidPtr attr,
VoidPtr (*start_routine)(VoidPtr), VoidPtr arg) {
LIBSYS_UNUSED(attr);
- if (!attr || !thread || !arg || !start_routine) return -1;
+ if (!attr || !thread || !arg || !start_routine) return kErrorInvalidData;
/// @note passing zero means you'd have to read the argv until you hit a nullptr.
ThreadRef thrd = ThrCreateThread("pthread_thread", (ThrProcKind) start_routine, 0, arg, 0);
- if (!thrd) return -1;
+ if (!thrd) return kErrorInvalidData;
*thread = thrd;
- return 0;
+ return kErrorSuccess;
}