summaryrefslogtreecommitdiff
path: root/parallel/slurm-wlm/patches/patch-src_slurmd_common_task__plugin.c
blob: 4b3605fec8045739c7e5d9c2808a5738fb76d52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$NetBSD: patch-src_slurmd_common_task__plugin.c,v 1.2 2020/02/01 00:15:02 bacon Exp $

# NetBSD specifics

--- src/slurmd/common/task_plugin.c.orig	2020-01-19 02:41:02.593115935 +0000
+++ src/slurmd/common/task_plugin.c
@@ -514,7 +514,11 @@ extern void task_slurm_chkaffinity(cpu_s
 	fatal("%s: not supported on macOS", __func__);
 #else
 	char *bind_type, *action, *status, *units;
-	char mstr[1 + CPU_SETSIZE / 4];
+#ifdef __NetBSD__
+	char mstr[1 + cpuset_size(mask) / 4];
+#else
+ 	char mstr[1 + CPU_SETSIZE / 4];
+#endif
 	int task_gid = job->envtp->procid;
 	int task_lid = job->envtp->localid;
 	pid_t mypid = job->envtp->task_pid;
@@ -585,7 +589,11 @@ extern char *task_cpuset_to_str(const cp
 	char *ptr = str;
 	char *ret = NULL;
 
-	for (base = CPU_SETSIZE - 4; base >= 0; base -= 4) {
+#ifdef __NetBSD__
+	for (base = cpuset_size(mask) - 4; base >= 0; base -= 4) {
+#else
+ 	for (base = CPU_SETSIZE - 4; base >= 0; base -= 4) {
+#endif
 		char val = 0;
 		if (CPU_ISSET(base, mask))
 			val |= 1;