LibC: Implement pthread cancelation

This code is not tested at all but it looks correct xD
This commit is contained in:
2025-06-01 00:59:22 +03:00
parent 56fdf6002c
commit dbdefa0f4a
15 changed files with 165 additions and 16 deletions

View File

@@ -4,6 +4,7 @@
#include <ctype.h>
#include <errno.h>
#include <langinfo.h>
#include <pthread.h>
#include <string.h>
#include <sys/syscall.h>
#include <time.h>
@@ -20,6 +21,7 @@ int clock_gettime(clockid_t clock_id, struct timespec* tp)
int nanosleep(const struct timespec* rqtp, struct timespec* rmtp)
{
pthread_testcancel();
return syscall(SYS_NANOSLEEP, rqtp, rmtp);
}