Nice wrappers around process management
All checks were successful
Build documentation / build-and-deploy (push) Successful in 34s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 34s
This commit is contained in:
17
libmsl/proc/proc.c
Normal file
17
libmsl/proc/proc.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <alloc/liballoc.h>
|
||||
#include <m/status.h>
|
||||
#include <m/system.h>
|
||||
#include <proc/proc.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
int process_spawn (process_func_t func) {
|
||||
void* stack = malloc (PROC_STACK_SIZE);
|
||||
if (stack == NULL)
|
||||
return -ST_OOM_ERROR;
|
||||
|
||||
uintptr_t top = (uintptr_t)stack + PROC_STACK_SIZE;
|
||||
return clone (top, func);
|
||||
}
|
||||
|
||||
int process_quit (void) { return quit (); }
|
||||
Reference in New Issue
Block a user