summaryrefslogtreecommitdiffstats
path: root/src/test/test-cpu-set-util.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test-cpu-set-util: fix allocation size check on i386Zbigniew Jędrzejewski-Szmek2019-06-041-1/+3
| | | | | We get just 28 bytes not 32 as on 64-bit architectures (__cpu_set_t is 4 bytes, we need at least 26, so 28 satisfies the constraints).
* test-cpu-set-util: fix comparison for allocation sizeZbigniew Jędrzejewski-Szmek2019-06-041-11/+11
| | | | | | | On i386, __cpu_mask is 4 bytes, so we'd check if c.allocated >= 0, and gcc would warn about a bogus comparison. Let's round up. Fixes #12726.
* cpu-set-util: use %d-%d format in cpu_set_to_range_string() only for actual ↵Michal Sekletar2019-06-031-7/+9
| | | | ranges
* shared/cpu-set-util: only force range printing one timeZbigniew Jędrzejewski-Szmek2019-05-291-3/+4
| | | | | | | The idea is to have at least one range to make the new format clearly distinguishable from the old. But it is enough to just do it once. In particular, in case the affinity would be specified like 0, 2, 4, 6…, this gives much shorter output.
* shared/cpu-set-util: introduce cpu_set_to_range()Michal Sekletar2019-05-291-0/+50
|
* test-cpu-set-util: add test for dbus conversionsZbigniew Jędrzejewski-Szmek2019-05-291-0/+31
|
* test-cpu-set-util: add a smoke test for test_parse_cpu_set_extend()Zbigniew Jędrzejewski-Szmek2019-05-291-0/+25
|
* test-cpu-set-util: add simple test for cpus_in_affinity_mask()Zbigniew Jędrzejewski-Szmek2019-05-291-0/+9
|
* Rework cpu affinity parsingZbigniew Jędrzejewski-Szmek2019-05-291-81/+96
| | | | | | | | | | | | | | | | | | The CPU_SET_S api is pretty bad. In particular, it has a parameter for the size of the array, but operations which take two (CPU_EQUAL_S) or even three arrays (CPU_{AND,OR,XOR}_S) still take just one size. This means that all arrays must be of the same size, or buffer overruns will occur. This is exactly what our code would do, if it received an array of unexpected size over the network. ("Unexpected" here means anything different from what cpu_set_malloc() detects as the "right" size.) Let's rework this, and store the size in bytes of the allocated storage area. The code will now parse any number up to 8191, independently of what the current kernel supports. This matches the kernel maximum setting for any architecture, to make things more portable. Fixes #12605.
* shared/cpu-set-util: move the part to print cpu-set into a separate functionZbigniew Jędrzejewski-Szmek2019-05-211-0/+29
| | | | | Also avoid unnecessary asprintf() when we can write to the output area directly.
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-3/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* tree-wide: use cpu_set_mfree()Yu Watanabe2017-12-061-10/+10
|
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* test-cpu-set-util.c: fix typo in comment (#6916)Jan Synacek2017-09-261-1/+1
|
* tests: move cpu-set-util related tests to test-cpu-set-util.cRonny Chevalier2016-03-031-0/+143