mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-20 09:21:55 +00:00
LibC: Mark a bunch of functions as cancellation points
This commit is contained in:
parent
899fd74f8e
commit
c85f307e62
Notes:
sideshowbarker
2024-07-17 08:39:41 +09:00
Author: https://github.com/timschumi
Commit: c85f307e62
Pull-request: https://github.com/SerenityOS/serenity/pull/14629
Reviewed-by: https://github.com/bgianfo
15 changed files with 78 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <bits/pthread_cancel.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/poll.h>
|
||||
|
@ -18,6 +19,8 @@ extern "C" {
|
|||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/select.html
|
||||
int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, timeval* timeout_tv)
|
||||
{
|
||||
__pthread_maybe_cancel();
|
||||
|
||||
timespec* timeout_ts = nullptr;
|
||||
timespec timeout;
|
||||
if (timeout_tv) {
|
||||
|
@ -30,6 +33,8 @@ int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, timev
|
|||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/pselect.html
|
||||
int pselect(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, timespec const* timeout, sigset_t const* sigmask)
|
||||
{
|
||||
__pthread_maybe_cancel();
|
||||
|
||||
Vector<pollfd, FD_SETSIZE> fds;
|
||||
|
||||
if (nfds < 0 || static_cast<size_t>(nfds) >= fds.capacity())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue