File: pid.md

package info (click to toggle)
rust-sysinfo 0.30.13-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,468 kB
  • sloc: ansic: 148; makefile: 27
file content (20 lines) | stat: -rw-r--r-- 618 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Process ID.

Can be used as an integer type by simple casting. For example:

```
use sysinfo::Pid;

// 0's type will be different depending on the platform!
let p = Pid::from(0);

// For something more "general":
let p = Pid::from_u32(0);
let i: u32 = p.as_u32();
```

On glibc systems this is a glibc [`pid_t`](https://www.gnu.org/software/libc/manual/html_node/Process-Identification.html).

On Windows systems this is a [`usize` and represents a windows process identifier](https://docs.microsoft.com/en-us/windows/win32/procthread/process-handles-and-identifiers).

On unsupported systems, this is also a `usize`.