Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157266513
D35045.id105399.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
726 B
Referenced Files
None
Subscribers
None
D35045.id105399.diff
View Options
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 == -1 && errno == EDEADLK)
+ errno = EINVAL;
+
+ return (error);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 20, 9:13 PM (6 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33356968
Default Alt Text
D35045.id105399.diff (726 B)
Attached To
Mode
D35045: sched_getaffinity(3): more compatibility with Linux
Attached
Detach File
Event Timeline
Log In to Comment