#include "pthread.h" _syscall2(int, create_thread, unsigned long, start, void*, arg); _syscall2(int, syspthread_join, pthread_t, thread, void*, value_ptr); _syscall1(int, endthread, int, value); int pthread_attr_init(pthread_attr_t* attr) { ;;;;; return 0; } int pthread_create(pthread_t* thread, const pthread_attr_t* attr, void* (*start)(void*), void* arg) { int id = 0; if (!thread) return EINVAL; id = create_thread((unsigned long)start, (int*)arg); if (id < 0) return errno; *thread = id; return id; } void pthread_exit(void* value_ptr) { endthread((int)value_ptr); } int pthread_join(pthread_t thread, void** value_ptr) { syspthread_join(thread, value_ptr); return 0; }