Skip to content

Commit fd4568f

Browse files
committed
libuv: fix NetBSD cpuset handling, for GCC 14.
via mrg@pkgsrc
1 parent 11eea0f commit fd4568f

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

devel/libuv/distinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BLAKE2s (libuv-1.50.0.tar.gz) = 678e36b7b999e1625192fb4ed81b69ae1c03d64cd514ea8d
44
SHA512 (libuv-1.50.0.tar.gz) = 9073d9dcd17980a57c76030fb8a273300e06c25dc6494a9b1e7b16d849340820bd8188b8247cc5505b5a480ea9c56d970321c6a15c219c50c75c8a83b5ee4fb4
55
Size (libuv-1.50.0.tar.gz) = 1345090 bytes
66
SHA1 (patch-autogen.sh) = 99790076b91d579eb55506749e4803ab7cdfaa4c
7-
SHA1 (patch-src_unix_core.c) = 2daf6aeed2d32b0db49c36cf7c129d7f7962178e
7+
SHA1 (patch-src_unix_core.c) = 1b1bb19b185f87aeb54aca3dcfedb1cd0978c384
88
SHA1 (patch-src_unix_fs.c) = 510693bb63cac7bf25e04c64e2d231de80b149d1
99
SHA1 (patch-src_unix_netbsd.c) = 071a2a853f9a73dc72e24d63316aa21b28669469
1010
SHA1 (patch-src_unix_tty.c) = 157be1b1272dc38b3605a9822316e6cb2ddb6f22

devel/libuv/patches/patch-src_unix_core.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
$NetBSD: patch-src_unix_core.c,v 1.3 2024/10/13 07:48:02 wiz Exp $
1+
$NetBSD: patch-src_unix_core.c,v 1.4 2025/09/19 07:06:49 mrg Exp $
22

33
Apply MacPorts patch-libuv-unix-core-close-nocancel.diff for
44
- older gcc versions to not error on pragmas
55
- 32bit code to link correctly
66
- Tiger to work around not having a non-cancellable close function
77

8-
--- src/unix/core.c.orig 2024-09-25 08:17:20.000000000 +0000
9-
+++ src/unix/core.c
10-
@@ -595,18 +595,31 @@ int uv__accept(int sockfd) {
8+
Also fix NetBSD cpuset handling.
9+
10+
--- src/unix/core.c.orig 2025-04-25 02:50:27.000000000 -0700
11+
+++ src/unix/core.c 2025-09-19 00:00:12.596197154 -0700
12+
@@ -597,18 +597,31 @@
1113
* will unwind the thread when it's in the cancel state. Work around that
1214
* by making the system call directly. Musl libc is unaffected.
1315
*/
@@ -46,3 +48,14 @@ Apply MacPorts patch-libuv-unix-core-close-nocancel.diff for
4648
#elif defined(__linux__) && defined(__SANITIZE_THREAD__) && defined(__clang__)
4749
long rc;
4850
__sanitizer_syscall_pre_close(fd);
51+
@@ -1998,8 +2011,8 @@
52+
#elif defined(__NetBSD__)
53+
cpuset_t* set = cpuset_create();
54+
if (set != NULL) {
55+
- if (0 == sched_getaffinity_np(getpid(), sizeof(set), &set))
56+
- rc = uv__cpu_count(&set);
57+
+ if (0 == sched_getaffinity_np(getpid(), cpuset_size(set), set))
58+
+ rc = uv__cpu_count(set);
59+
cpuset_destroy(set);
60+
}
61+
#elif defined(__APPLE__)

0 commit comments

Comments
 (0)