|
1 | | -PSUTIL_CONN_NONE: int |
2 | | -SIDL: int |
3 | | -SRUN: int |
4 | | -SSLEEP: int |
5 | | -SSTOP: int |
6 | | -SZOMB: int |
7 | | -TCPS_CLOSED: int |
8 | | -TCPS_CLOSE_WAIT: int |
9 | | -TCPS_CLOSING: int |
10 | | -TCPS_ESTABLISHED: int |
11 | | -TCPS_FIN_WAIT_1: int |
12 | | -TCPS_FIN_WAIT_2: int |
13 | | -TCPS_LAST_ACK: int |
14 | | -TCPS_LISTEN: int |
15 | | -TCPS_SYN_RECEIVED: int |
16 | | -TCPS_SYN_SENT: int |
17 | | -TCPS_TIME_WAIT: int |
18 | | -version: int |
| 1 | +import sys |
19 | 2 |
|
20 | | -def boot_time(*args, **kwargs): ... |
21 | | -def check_pid_range(pid: int, /) -> None: ... |
22 | | -def cpu_count_cores(*args, **kwargs): ... |
23 | | -def cpu_count_logical(*args, **kwargs): ... |
24 | | -def cpu_freq(*args, **kwargs): ... |
25 | | -def cpu_stats(*args, **kwargs): ... |
26 | | -def cpu_times(*args, **kwargs): ... |
27 | | -def disk_io_counters(*args, **kwargs): ... |
28 | | -def disk_partitions(*args, **kwargs): ... |
29 | | -def disk_usage_used(*args, **kwargs): ... |
30 | | -def net_io_counters(*args, **kwargs): ... |
31 | | -def per_cpu_times(*args, **kwargs): ... |
32 | | -def pids(*args, **kwargs): ... |
33 | | -def proc_cmdline(*args, **kwargs): ... |
34 | | -def proc_net_connections(*args, **kwargs): ... |
35 | | -def proc_cwd(*args, **kwargs): ... |
36 | | -def proc_environ(*args, **kwargs): ... |
37 | | -def proc_exe(*args, **kwargs): ... |
38 | | -def proc_kinfo_oneshot(*args, **kwargs): ... |
39 | | -def proc_memory_uss(*args, **kwargs): ... |
40 | | -def proc_name(*args, **kwargs): ... |
41 | | -def proc_num_fds(*args, **kwargs): ... |
42 | | -def proc_open_files(*args, **kwargs): ... |
43 | | -def proc_pidtaskinfo_oneshot(*args, **kwargs): ... |
44 | | -def proc_threads(*args, **kwargs): ... |
45 | | -def sensors_battery(*args, **kwargs): ... |
46 | | -def set_debug(*args, **kwargs): ... |
47 | | -def swap_mem(*args, **kwargs): ... |
48 | | -def users(*args, **kwargs): ... |
49 | | -def virtual_mem(*args, **kwargs): ... |
| 3 | +# TODO: Detect available POSIX constants/methods and import them in this module |
| 4 | +# (see psutil_posix_add_constants / psutil_posix_add_methods) |
| 5 | + |
| 6 | +if sys.platform == "darwin": |
| 7 | + from _typeshed import StrOrBytesPath |
| 8 | + from collections.abc import Sequence |
| 9 | + from socket import AddressFamily, SocketKind |
| 10 | + from typing import Final, TypeVar |
| 11 | + |
| 12 | + from ._psutil_posix import ( |
| 13 | + AF_LINK as AF_LINK, |
| 14 | + getpagesize as getpagesize, |
| 15 | + net_if_addrs as net_if_addrs, |
| 16 | + net_if_duplex_speed as net_if_duplex_speed, |
| 17 | + net_if_flags as net_if_flags, |
| 18 | + net_if_is_running as net_if_is_running, |
| 19 | + net_if_mtu as net_if_mtu, |
| 20 | + proc_priority_get as proc_priority_get, |
| 21 | + proc_priority_set as proc_priority_set, |
| 22 | + ) |
| 23 | + |
| 24 | + _T = TypeVar("_T") |
| 25 | + |
| 26 | + version: Final[int] |
| 27 | + SIDL: Final = 1 |
| 28 | + SRUN: Final = 2 |
| 29 | + SSLEEP: Final = 3 |
| 30 | + SSTOP: Final = 4 |
| 31 | + SZOMB: Final = 5 |
| 32 | + TCPS_CLOSED: Final = 0 |
| 33 | + TCPS_CLOSING: Final = 7 |
| 34 | + TCPS_CLOSE_WAIT: Final = 5 |
| 35 | + TCPS_LISTEN: Final = 1 |
| 36 | + TCPS_ESTABLISHED: Final = 4 |
| 37 | + TCPS_SYN_SENT: Final = 2 |
| 38 | + TCPS_SYN_RECEIVED: Final = 3 |
| 39 | + TCPS_FIN_WAIT_1: Final = 6 |
| 40 | + TCPS_FIN_WAIT_2: Final = 9 |
| 41 | + TCPS_LAST_ACK: Final = 8 |
| 42 | + TCPS_TIME_WAIT: Final = 10 |
| 43 | + PSUTIL_CONN_NONE: Final = 128 |
| 44 | + |
| 45 | + def proc_cmdline(pid: int, /) -> list[str]: ... |
| 46 | + def proc_cwd(pid: int, /) -> str: ... |
| 47 | + def proc_environ(pid: int, /) -> str: ... |
| 48 | + def proc_exe(pid: int, /) -> str: ... |
| 49 | + def proc_is_zombie(pid: int, /) -> bool: ... |
| 50 | + def proc_kinfo_oneshot(pid: int, /) -> tuple[int, int, int, int, int, int, int, float, int, str]: ... |
| 51 | + def proc_memory_uss(pid: int, /) -> int: ... |
| 52 | + def proc_name(pid: int, /) -> str: ... |
| 53 | + def proc_net_connections( |
| 54 | + pid: int, af_filter: Sequence[AddressFamily | int | None], type_filter: Sequence[SocketKind | int | None], / |
| 55 | + ) -> list[ |
| 56 | + tuple[int, int, int, tuple[str | None, int], tuple[str | None, int] | tuple[()], int] |
| 57 | + | tuple[int, int, int, str, str, int] |
| 58 | + ]: ... |
| 59 | + def proc_num_fds(pid: int, /) -> int: ... |
| 60 | + def proc_open_files(pid: int, /) -> list[tuple[str, int]]: ... |
| 61 | + def proc_pidtaskinfo_oneshot(pid: int, /) -> tuple[float, float, int, int, int, int, int, int]: ... |
| 62 | + def proc_threads(pid: int, /) -> list[tuple[int, float, float]]: ... |
| 63 | + def boot_time() -> float: ... |
| 64 | + def cpu_count_cores() -> int | None: ... |
| 65 | + def cpu_count_logical() -> int | None: ... |
| 66 | + def cpu_freq() -> tuple[int, int, int]: ... |
| 67 | + def cpu_stats() -> tuple[int, int, int, int, int]: ... |
| 68 | + def cpu_times() -> tuple[float, float, float, float]: ... |
| 69 | + def disk_io_counters() -> dict[str, tuple[int, int, int, int, int, int]]: ... |
| 70 | + def disk_partitions() -> list[tuple[str, str, str, str]]: ... |
| 71 | + def disk_usage_used(mount_point: StrOrBytesPath, default: _T, /) -> int | _T: ... |
| 72 | + def has_cpu_freq() -> bool: ... |
| 73 | + def net_io_counters() -> dict[str, tuple[int, int, int, int, int, int, int, int]]: ... |
| 74 | + def per_cpu_times() -> list[tuple[float, float, float, float]]: ... |
| 75 | + def pids() -> list[int]: ... |
| 76 | + def sensors_battery() -> tuple[int, int, int]: ... |
| 77 | + def swap_mem() -> tuple[int, int, int, int, int]: ... |
| 78 | + def virtual_mem() -> tuple[int, int, int, int, int, int]: ... |
| 79 | + def check_pid_range(pid: int, /) -> None: ... |
| 80 | + def set_debug(value: bool, /) -> None: ... |
0 commit comments