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

@@ -1,13 +1,16 @@
#include <pthread.h>
#include <sys/syscall.h>
#include <sys/wait.h>
#include <unistd.h>
pid_t wait(int* stat_loc)
{
pthread_testcancel();
return waitpid(-1, stat_loc, 0);
}
pid_t waitpid(pid_t pid, int* stat_loc, int options)
{
pthread_testcancel();
return (pid_t)syscall(SYS_WAIT, pid, stat_loc, options);
}