parent
3832ea5e2e
commit
73848bd3d1
|
@ -45,7 +45,7 @@ SYNOPSIS
|
||||||
* 同样 , 如果 pid 的值为 0.也表示的是当前进程 */
|
* 同样 , 如果 pid 的值为 0.也表示的是当前进程 */
|
||||||
|
|
||||||
RETURN VALUE
|
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 还需要用到一下宏函数
|
设置 CPU Affinity 还需要用到一下宏函数
|
||||||
|
@ -137,11 +137,11 @@ syscall 是执行一个系统调用,根据指定的参数 number 和所有系
|
||||||
```cpp
|
```cpp
|
||||||
//syscall - indirect system call
|
//syscall - indirect system call
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/syscall.h> /* For SYS_xxx definitions */
|
#include <sys/syscall.h> /* For SYS_xxx definitions */
|
||||||
|
|
||||||
int syscall(int number, ...);
|
int syscall(int number, ...);
|
||||||
|
|
||||||
/* sysconf( _SC_PAGESIZE ); 此宏查看缓存内存页面的大小;打印用%ld 长整型。
|
/* sysconf( _SC_PAGESIZE ); 此宏查看缓存内存页面的大小;打印用%ld 长整型。
|
||||||
sysconf( _SC_PHYS_PAGES ) 此宏查看内存的总页数;打印用%ld 长整型。
|
sysconf( _SC_PHYS_PAGES ) 此宏查看内存的总页数;打印用%ld 长整型。
|
||||||
|
|
Loading…
Reference in New Issue