From 73848bd3d10ff511a6764284f586ebdb0f23c39a Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Mon, 7 Jun 2021 16:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E6=A0=BC=E5=BC=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- .../API/Linux_进程_线程与_CPU_的亲和性(Affinity).md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Software/Development/System/Linux/User/API/Linux_进程_线程与_CPU_的亲和性(Affinity).md b/Software/Development/System/Linux/User/API/Linux_进程_线程与_CPU_的亲和性(Affinity).md index 99b4fe1..a5cfe90 100644 --- a/Software/Development/System/Linux/User/API/Linux_进程_线程与_CPU_的亲和性(Affinity).md +++ b/Software/Development/System/Linux/User/API/Linux_进程_线程与_CPU_的亲和性(Affinity).md @@ -45,7 +45,7 @@ SYNOPSIS * 同样 , 如果 pid 的值为 0.也表示的是当前进程 */ RETURN VALUE - On success, sched_setaffinity() and sched_getaffinity() return 0. On error, -1 is returned, and errno is set appropriately. + On success, sched_setaffinity() and sched_getaffinity() return 0. On error, -1 is returned, and errno is set appropriately. ``` 设置 CPU Affinity 还需要用到一下宏函数 @@ -137,11 +137,11 @@ syscall 是执行一个系统调用,根据指定的参数 number 和所有系 ```cpp //syscall - indirect system call SYNOPSIS - #define _GNU_SOURCE /* See feature_test_macros(7) */ - #include - #include /* For SYS_xxx definitions */ + #define _GNU_SOURCE /* See feature_test_macros(7) */ + #include + #include /* For SYS_xxx definitions */ - int syscall(int number, ...); + int syscall(int number, ...); /* sysconf( _SC_PAGESIZE ); 此宏查看缓存内存页面的大小;打印用%ld 长整型。 sysconf( _SC_PHYS_PAGES ) 此宏查看内存的总页数;打印用%ld 长整型。