diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-06-12 15:15:09 +0200 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-07-22 10:07:15 -0700 |
commit | c85f307e6233397993e18b31d0034ed77bed73d9 (patch) | |
tree | 9a9e344799bb9588b848273d0fecbffe1957e3d4 /Userland/Libraries/LibC/signal.cpp | |
parent | 899fd74f8ecc7c0b57a555babbad445f87ac36b4 (diff) | |
download | serenity-c85f307e6233397993e18b31d0034ed77bed73d9.zip |
LibC: Mark a bunch of functions as cancellation points
Diffstat (limited to 'Userland/Libraries/LibC/signal.cpp')
-rw-r--r-- | Userland/Libraries/LibC/signal.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/signal.cpp b/Userland/Libraries/LibC/signal.cpp index 850dd48caa..f15a313d75 100644 --- a/Userland/Libraries/LibC/signal.cpp +++ b/Userland/Libraries/LibC/signal.cpp @@ -6,6 +6,7 @@ #include <AK/Format.h> #include <assert.h> +#include <bits/pthread_cancel.h> #include <errno.h> #include <setjmp.h> #include <signal.h> @@ -175,6 +176,8 @@ void siglongjmp(jmp_buf env, int val) // https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigsuspend.html int sigsuspend(sigset_t const* set) { + __pthread_maybe_cancel(); + int rc = syscall(SC_sigsuspend, set); __RETURN_WITH_ERRNO(rc, rc, -1); } @@ -182,6 +185,8 @@ int sigsuspend(sigset_t const* set) // https://pubs.opengroup.org/onlinepubs/009604499/functions/sigwait.html int sigwait(sigset_t const* set, int* sig) { + __pthread_maybe_cancel(); + int rc = syscall(Syscall::SC_sigtimedwait, set, nullptr, nullptr); VERIFY(rc != 0); if (rc < 0) @@ -199,6 +204,8 @@ int sigwaitinfo(sigset_t const* set, siginfo_t* info) // https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigtimedwait.html int sigtimedwait(sigset_t const* set, siginfo_t* info, struct timespec const* timeout) { + __pthread_maybe_cancel(); + int rc = syscall(Syscall::SC_sigtimedwait, set, info, timeout); __RETURN_WITH_ERRNO(rc, rc, -1); } |