LibC: Add semaphore stubs

These are needed for our bochs port
This commit is contained in:
Bananymous 2025-08-07 02:15:06 +03:00
parent e17ee831a7
commit 6240374dd1
2 changed files with 48 additions and 0 deletions

View File

@ -27,6 +27,7 @@ set(LIBC_SOURCES
pwd.cpp
scanf_impl.cpp
sched.cpp
semaphore.cpp
setjmp.cpp
signal.cpp
stdio.cpp

View File

@ -0,0 +1,47 @@
#include <BAN/Debug.h>
#include <errno.h>
#include <semaphore.h>
int sem_destroy(sem_t* sem)
{
(void)sem;
dwarnln("TODO: sem_destroy");
errno = ENOTSUP;
return -1;
}
int sem_init(sem_t* sem, int pshared, unsigned value)
{
(void)sem;
(void)pshared;
(void)value;
dwarnln("TODO: sem_init");
errno = ENOTSUP;
return -1;
}
int sem_post(sem_t* sem)
{
(void)sem;
dwarnln("TODO: sem_post");
errno = ENOTSUP;
return -1;
}
int sem_trywait(sem_t* sem)
{
(void)sem;
dwarnln("TODO: sem_trywait");
errno = ENOTSUP;
return -1;
}
int sem_wait(sem_t* sem)
{
(void)sem;
dwarnln("TODO: sem_wait");
errno = ENOTSUP;
return -1;
}