Kernel/LibC: Implement pthread_kill

This commit is contained in:
2025-06-01 00:56:23 +03:00
parent c957f1ddca
commit 56fdf6002c
4 changed files with 37 additions and 2 deletions

View File

@@ -38,9 +38,18 @@ void psignal(int signum, const char* message)
fprintf(stderr, "%s\n", strsignal(signum));
}
int pthread_kill(pthread_t thread, int sig)
{
if (syscall(SYS_PTHREAD_KILL, thread, sig) == -1)
return errno;
return 0;
}
int pthread_sigmask(int how, const sigset_t* __restrict set, sigset_t* __restrict oset)
{
return syscall(SYS_SIGPROCMASK, how, set, oset);
if (syscall(SYS_SIGPROCMASK, how, set, oset) == -1)
return errno;
return 0;
}
int raise(int sig)
@@ -138,7 +147,12 @@ int sigpending(sigset_t* set)
int sigprocmask(int how, const sigset_t* __restrict set, sigset_t* __restrict oset)
{
return pthread_sigmask(how, set, oset);
if (int error = pthread_sigmask(how, set, oset))
{
errno = error;
return -1;
}
return 0;
}
int sigrelse(int sig)