Commit Graph

2 Commits

Author SHA1 Message Date
Brad Fitzpatrick
dd9ec17814 unix: fix build on Go 1.8
Don't use math/bits yet. Go 1.8 doesn't have it, and Go 1.8 is still
supported for a few weeks.

Fixes golang/go#23353

Change-Id: Ie69163f6f6dca95d4652441849e0152d2e346cd0
Reviewed-on: https://go-review.googlesource.com/86477
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-06 05:20:50 +00:00
Tobias Klauser
12d9d5b281 unix: add SchedGetaffinity and SchedSetaffinity on Linux
SchedGetaffinity and SchedSetaffinity are used to get and set a thread's
CPU affinity mask.

See http://man7.org/linux/man-pages/man2/sched_setaffinity.2.html for
details.

Also add a manual implementation of CpuSet_t and the corresponding
accessor functions (mimicking the CPU_* macros from sched.h).

Fixes golang/go#11243

Change-Id: Ia5abc0053cd06810b3b09ab65c27434f5323c1ad
Reviewed-on: https://go-review.googlesource.com/85915
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-05 20:31:47 +00:00