mirror of
https://github.com/thepigeongenerator/cpusetcores.git
synced 2025-12-18 06:25:46 +01:00
rename get/set -core to -cpu
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
char const* const cpu_path = "/sys/devices/system/cpu/cpu%i/online";
|
char const* const cpu_path = "/sys/devices/system/cpu/cpu%i/online";
|
||||||
|
|
||||||
bool getcore(uint32_t id) {
|
bool getcpu(uint32_t id) {
|
||||||
// get the file path
|
// get the file path
|
||||||
char path[64]; // contains the file path (max length is 64 due to the path and a bunch of extra wiggle room)
|
char path[64]; // contains the file path (max length is 64 due to the path and a bunch of extra wiggle room)
|
||||||
snprintf(path, 64, cpu_path, id); // writes the path using the id
|
snprintf(path, 64, cpu_path, id); // writes the path using the id
|
||||||
@@ -26,7 +26,7 @@ bool getcore(uint32_t id) {
|
|||||||
return !!state;
|
return !!state;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setcore(uint32_t id, bool state) {
|
void setcpu(uint32_t id, bool state) {
|
||||||
char path[64];
|
char path[64];
|
||||||
snprintf(path, 64, cpu_path, id);
|
snprintf(path, 64, cpu_path, id);
|
||||||
|
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
bool getcore(uint32_t); // gets the state of core (id)
|
bool getcpu(uint32_t); // gets the state of core (id)
|
||||||
void setcore(uint32_t, bool); // sets the state of core (id)
|
void setcpu(uint32_t, bool); // sets the state of core (id)
|
||||||
|
|||||||
Reference in New Issue
Block a user