Page MenuHomeFreeBSD

sched_getaffinity(3): more compatibility with Linux
ClosedPublic

Authored by kib on Apr 24 2022, 10:13 PM.
Tags
None
Referenced Files
F163624745: D35045.id105377.diff
Fri, Jul 24, 11:12 PM
F163576599: D35045.id105399.diff
Fri, Jul 24, 4:02 PM
Unknown Object (File)
Thu, Jul 23, 4:30 AM
Unknown Object (File)
Wed, Jul 22, 10:19 PM
Unknown Object (File)
Sun, Jul 19, 3:09 AM
Unknown Object (File)
Sat, Jul 18, 11:54 PM
Unknown Object (File)
Fri, Jul 3, 4:29 AM
Unknown Object (File)
Jun 7 2026, 7:13 PM
Subscribers

Details

Summary

Report EINVAL instead of EDEADLK when impossible cpu mask is set.

Noted by: dchagin

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

btw, glibc defines CPU_SETSIZE as 1024 https://sourceware.org/git/?p=glibc.git;a=blob;f=posix/bits/cpu-set.h;h=afc1622f7ea4063ea1bd84e20d491d72e378376c;hb=refs/heads/master
so if the storage for cpu_set_t is not allocated by CPU_ALLOC with count = 256 our sched_setaffinity should fails

This revision is now accepted and ready to land.Apr 25 2022, 7:01 AM
lib/libc/gen/sched_setaffinity.c
49

Don't we have to check and set errno, not error?

This revision now requires review to proceed.Apr 25 2022, 1:22 PM
kib marked an inline comment as done.Apr 25 2022, 1:22 PM
This revision is now accepted and ready to land.Apr 25 2022, 1:25 PM