From 4f0669f8f86acb09f10ffb5af273f86d8d6ddd34 Mon Sep 17 00:00:00 2001 From: Ryo Nakamura Date: Tue, 6 Feb 2024 21:54:04 +0900 Subject: 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. --- src/platform.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/platform.c') 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 #include -#include +#include +#include #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; } -- cgit v1.2.3