|
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 $ |
2 | 2 |
|
3 | 3 | Apply MacPorts patch-libuv-unix-core-close-nocancel.diff for |
4 | 4 | - older gcc versions to not error on pragmas |
5 | 5 | - 32bit code to link correctly |
6 | 6 | - Tiger to work around not having a non-cancellable close function |
7 | 7 |
|
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 @@ |
11 | 13 | * will unwind the thread when it's in the cancel state. Work around that |
12 | 14 | * by making the system call directly. Musl libc is unaffected. |
13 | 15 | */ |
@@ -46,3 +48,14 @@ Apply MacPorts patch-libuv-unix-core-close-nocancel.diff for |
46 | 48 | #elif defined(__linux__) && defined(__SANITIZE_THREAD__) && defined(__clang__) |
47 | 49 | long rc; |
48 | 50 | __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