Get the CPU number on which the calling process last executed

# pcntl_getcpu

(No version information available, might only be in Git)

pcntl_getcpu — Get the CPU number on which the calling process last executed

### 说明

function pcntl_getcpu(): int

pcntl_getcpu() returns the number of the CPU on which the calling process was last executed. This function uses the `sched_getcpu(3)` system call available on Linux.

### 参数

此函数没有参数。

### 返回值

Returns the CPU number as an int.

### 参见

- pcntl_getcpuaffinity() - Get the cpu affinity of a process
- pcntl_setcpuaffinity() - Set the cpu affinity of a process

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open