Page MenuHomeFreeBSD

D35045.id105377.diff
No OneTemporary

D35045.id105377.diff

diff --git a/lib/libc/gen/sched_setaffinity.c b/lib/libc/gen/sched_setaffinity.c
--- a/lib/libc/gen/sched_setaffinity.c
+++ b/lib/libc/gen/sched_setaffinity.c
@@ -34,6 +34,7 @@
sched_setaffinity(pid_t pid, size_t cpusetsz, const cpuset_t *cpuset)
{
cpuset_t c;
+ int error;
if (cpusetsz > sizeof(cpuset_t)) {
errno = EINVAL;
@@ -42,6 +43,10 @@
memset(&c, 0, sizeof(c));
memcpy(&c, cpuset, cpusetsz);
}
- return (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID,
- pid == 0 ? -1 : pid, sizeof(cpuset_t), &c));
+ error = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID,
+ pid == 0 ? -1 : pid, sizeof(cpuset_t), &c);
+ if (error == EDEADLK)
+ error = EINVAL;
+
+ return (error);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 15, 5:56 PM (18 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15415353
Default Alt Text
D35045.id105377.diff (711 B)

Event Timeline