Konstantin Belousov d9cacbf4b0 sched_get/setaffinity(): try to be more compatible with Linux
in handling the cpuset sizes different from sizeof(cpuset_t).

For both cases, cpuset size shorter than sizeof(cpuset_t) results
in EINVAL on Linux.

For sched_getaffinity(), be more permissive and accept cpuset size
larger than our cpuset_t, by clipping the syscall argument and zeroing
the rest of the output buffer.  For sched_setaffinity(), we should allow
shorter cpusets than current ABI size, again zeroing the rest of the bits.

With this change, python os.sched_get/setaffinity functions work.

Reported by:	se
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-01-03 04:31:40 +02:00
..
2017-02-28 23:42:47 +00:00
2020-04-13 08:42:13 +00:00
2020-12-11 00:13:39 +00:00
2017-05-23 06:53:31 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2019-08-01 18:51:06 +00:00
2017-02-28 23:42:47 +00:00
2017-05-23 06:56:57 +00:00
2020-05-15 11:58:01 +00:00
2017-02-28 23:42:47 +00:00
2020-10-24 00:03:11 +00:00
2020-12-27 12:57:26 +02:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2018-08-07 15:24:19 +00:00
2017-02-28 23:42:47 +00:00
2020-03-12 18:28:23 +00:00
2017-05-23 09:29:05 +00:00
2017-02-28 23:42:47 +00:00
2021-02-15 20:23:32 +01:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2020-09-09 18:07:13 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-04-26 14:28:27 +00:00
2017-02-28 23:42:47 +00:00
2021-04-18 10:20:11 +02:00
2017-02-28 23:42:47 +00:00
2018-02-27 10:55:33 +00:00
2017-02-28 23:42:47 +00:00
2021-02-23 20:08:10 +02:00
2019-07-17 19:41:44 +00:00
2020-12-03 05:49:59 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2020-03-30 21:25:00 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2020-08-31 21:55:25 +00:00
2017-02-28 23:42:47 +00:00
2020-11-13 14:56:34 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2021-05-13 16:23:44 +02:00
2021-12-31 12:57:01 -05:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-12-06 22:06:48 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2020-01-21 16:31:08 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2021-02-23 20:08:10 +02:00
2017-02-28 23:42:47 +00:00