Kernel/LibC: Implement simple futex

This commit is contained in:
2025-08-05 00:07:17 +03:00
parent 658a001d91
commit 5940e912b3
6 changed files with 159 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
#include <errno.h>
#include <sys/futex.h>
#include <sys/syscall.h>
#include <unistd.h>
int futex(int op, const uint32_t* addr, uint32_t value, const struct timespec* abstime)
{
errno = 0;
while (syscall(SYS_FUTEX, op, addr, value, abstime) == -1 && errno == EINTR)
errno = 0;
return errno;
}