diff options
author | Ryo Nakamura <upa@haeena.net> | 2024-02-06 21:54:04 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2024-02-06 21:54:04 +0900 |
commit | 4f0669f8f86acb09f10ffb5af273f86d8d6ddd34 (patch) | |
tree | 65d5d0adfd90e31b77474993addeb065edfeb75c /src/platform.c | |
parent | 76892a69f95f7dcf47050800385bc610f8ccf5f3 (diff) |
refactor error message-related functions
split message print fuctions (mpr_*), strerrno, and mscp_get/set_error
into print.c/h and strerrno.c/h.
ToDo: revise usages of priv_set_errv and pr_* functions.
Diffstat (limited to 'src/platform.c')
-rw-r--r-- | src/platform.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/platform.c b/src/platform.c index 668c571..e3d1421 100644 --- a/src/platform.c +++ b/src/platform.c @@ -22,9 +22,9 @@ #error unsupported platform #endif -#include <util.h> #include <platform.h> -#include <message.h> +#include <strerrno.h> +#include <print.h> #ifdef __APPLE__ @@ -34,7 +34,7 @@ int nr_cpus() size_t size = sizeof(n); if (sysctlbyname("machdep.cpu.core_count", &n, &size, NULL, 0) != 0) { - mscp_set_error("failed to get number of cpu cores: %s", strerrno()); + priv_set_errv("failed to get number of cpu cores: %s", strerrno()); return -1; } @@ -43,7 +43,7 @@ int nr_cpus() int set_thread_affinity(pthread_t tid, int core) { - pr_warn("setting thread afinity is not implemented on apple\n"); + pr_warn("setting thread afinity is not implemented on apple"); return 0; } @@ -124,8 +124,8 @@ int set_thread_affinity(pthread_t tid, int core) CPU_SET(core, &target_cpu_set); ret = pthread_setaffinity_np(tid, sizeof(target_cpu_set), &target_cpu_set); if (ret < 0) - mscp_set_error("failed to set thread/cpu affinity for core %d: %s", - core, strerrno()); + priv_set_errv("failed to set thread/cpu affinity for core %d: %s", + core, strerrno()); return ret; } |