Skip to content
Snippets Groups Projects
Commit 044e4627 authored by Videau Luc's avatar Videau Luc
Browse files

feat: add sys_create_mutex

parent e6726ba2
No related branches found
Tags tp1-act-4-4
No related merge requests found
......@@ -486,7 +486,19 @@ sys_pipe(void)
uint64
sys_create_mutex(void)
{
return -1;
char *name = "mutex";
int fd;
struct file *f;
if ((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0)
{
if(f){
fileclose(f);
}
return -1;
}
f->type = FD_MUTEX;
initsleeplock(&f->mutex, name);
return fd;
}
uint64
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment