diff options
| author | Michael Forney <mforney@mforney.org> | 2022-04-10 14:43:07 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2022-04-10 14:43:07 -0700 |
| commit | d20d4f021cf95495708646500a5046f5273f646e (patch) | |
| tree | 2a4dde97df71cf100484cc8560f694320ff3c515 /pkg/musl/patch | |
| parent | 47c384760c9c49b93295eef913e4853f62293f1d (diff) | |
musl: Update to 1.2.3
Diffstat (limited to 'pkg/musl/patch')
| -rw-r--r-- | pkg/musl/patch/0002-add-pthread_getname_np-function.patch | 58 | ||||
| -rw-r--r-- | pkg/musl/patch/0002-use-preferred-syntactic-location-for-epoll_event-pac.patch (renamed from pkg/musl/patch/0003-use-preferred-syntactic-location-for-epoll_event-pac.patch) | 0 |
2 files changed, 0 insertions, 58 deletions
diff --git a/pkg/musl/patch/0002-add-pthread_getname_np-function.patch b/pkg/musl/patch/0002-add-pthread_getname_np-function.patch deleted file mode 100644 index 2b732706..00000000 --- a/pkg/musl/patch/0002-add-pthread_getname_np-function.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 88632ac04b21a909df28f71ac325ce4bc0a80ab9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org> -Date: Tue, 20 Apr 2021 16:15:15 -0300 -Subject: [PATCH] add pthread_getname_np function - -based on the pthread_setname_np implementation ---- - include/pthread.h | 1 + - src/thread/pthread_getname_np.c | 25 +++++++++++++++++++++++++ - 2 files changed, 26 insertions(+) - create mode 100644 src/thread/pthread_getname_np.c - -diff --git a/include/pthread.h b/include/pthread.h -index 0492f26a..89fd9ff7 100644 ---- a/include/pthread.h -+++ b/include/pthread.h -@@ -221,6 +221,7 @@ int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *); - int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *); - int pthread_getattr_np(pthread_t, pthread_attr_t *); - int pthread_setname_np(pthread_t, const char *); -+int pthread_getname_np(pthread_t, char *, size_t); - int pthread_getattr_default_np(pthread_attr_t *); - int pthread_setattr_default_np(const pthread_attr_t *); - int pthread_tryjoin_np(pthread_t, void **); -diff --git a/src/thread/pthread_getname_np.c b/src/thread/pthread_getname_np.c -new file mode 100644 -index 00000000..85504e45 ---- /dev/null -+++ b/src/thread/pthread_getname_np.c -@@ -0,0 +1,25 @@ -+#define _GNU_SOURCE -+#include <fcntl.h> -+#include <unistd.h> -+#include <sys/prctl.h> -+ -+#include "pthread_impl.h" -+ -+int pthread_getname_np(pthread_t thread, char *name, size_t len) -+{ -+ int fd, cs, status = 0; -+ char f[sizeof "/proc/self/task//comm" + 3*sizeof(int)]; -+ -+ if (len < 16) return ERANGE; -+ -+ if (thread == pthread_self()) -+ return prctl(PR_GET_NAME, (unsigned long)name, 0UL, 0UL, 0UL) ? errno : 0; -+ -+ snprintf(f, sizeof f, "/proc/self/task/%d/comm", thread->tid); -+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); -+ if ((fd = open(f, O_RDONLY|O_CLOEXEC)) < 0 || (len = read(fd, name, len)) == -1) status = errno; -+ else name[len-1] = 0; /* remove trailing new line only if successful */ -+ if (fd >= 0) close(fd); -+ pthread_setcancelstate(cs, 0); -+ return status; -+} --- -2.32.0 - diff --git a/pkg/musl/patch/0003-use-preferred-syntactic-location-for-epoll_event-pac.patch b/pkg/musl/patch/0002-use-preferred-syntactic-location-for-epoll_event-pac.patch index c3e9891a..c3e9891a 100644 --- a/pkg/musl/patch/0003-use-preferred-syntactic-location-for-epoll_event-pac.patch +++ b/pkg/musl/patch/0002-use-preferred-syntactic-location-for-epoll_event-pac.patch |
