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,8 +1,11 @@
#include <pthread.h>
#include <sys/uio.h>
#include <unistd.h>
ssize_t readv(int fildes, const struct iovec* iov, int iovcnt)
{
pthread_testcancel();
size_t result = 0;
for (int i = 0; i < iovcnt; i++)
{
@@ -25,6 +28,8 @@ ssize_t readv(int fildes, const struct iovec* iov, int iovcnt)
ssize_t writev(int fildes, const struct iovec* iov, int iovcnt)
{
pthread_testcancel();
size_t result = 0;
for (int i = 0; i < iovcnt; i++)
{