mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:27:45 +00:00
Kernel+LibC: Add a simple create_thread() syscall.
It takes two parameters, a function pointer for the entry function, and a void* argument to be passed to that function on the new thread.
This commit is contained in:
parent
7f1757b16c
commit
e561ab1b0b
10 changed files with 45 additions and 5 deletions
|
@ -410,4 +410,10 @@ char* getlogin()
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
int create_thread(int(*entry)(void*), void* argument)
|
||||
{
|
||||
int rc = syscall(SC_create_thread, entry, argument);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ __BEGIN_DECLS
|
|||
|
||||
extern char** environ;
|
||||
|
||||
int create_thread(int(*)(void*), void*);
|
||||
int create_shared_buffer(pid_t peer_pid, int, void** buffer);
|
||||
void* get_shared_buffer(int shared_buffer_id);
|
||||
int release_shared_buffer(int shared_buffer_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue