void-packages/srcpkgs/musl/patches/epoll_cp.patch
Érico Nogueira beb3f7fb1f musl: backport reallocarray and others.
It's in POSIX-future and some applications have started depending on it.
It's easier to backport into musl than fix each individual package.

Since we are adding a new interface to libc, update common/shlibs entry
as well. This should probably have been done for all musl updates.

And since we are here, also backport:
- isascii fix (removes the need for a patch in fceux)
- make epoll a cancellation point (fixes a bug in jack pipewire utilities)
2021-05-24 18:45:30 -03:00

28 lines
1.1 KiB
Diff

From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Sat, 3 Apr 2021 21:16:41 -0400
Subject: [PATCH] make epoll_[p]wait a cancellation point
this is a Linux-specific function and not covered by POSIX's
requirements for which interfaces are cancellation points, but glibc
makes it one and existing software relies on it being one.
at some point a review for similar functions that should be made
cancellation points should be done.
diff --git src/linux/epoll.c src/linux/epoll.c
index deff5b10..93baa814 100644
--- src/linux/epoll.c
+++ src/linux/epoll.c
@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
{
- int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
+ int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
#ifdef SYS_epoll_wait
- if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
+ if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
#endif
return __syscall_ret(r);
}