HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/fm-agent/dependencies/linux/python3.9/psutil/__pycache__/_psposix.cpython-39.pyc
a

��in�@sZdZddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZejdkr�ddlZndZgd�Zdd�Zedu�reed��re�dedd�ejD���Zdd�Zndd�Zddejeedej�eej efdd�Z!dd�Z"edd ��Z#dS)!z%Routines common to all posix systems.�N���TimeoutExpired)�memoize)�
sdiskusage)�
usage_percent)�PY3)�ChildProcessError)�FileNotFoundError)�InterruptedError)�PermissionError)�ProcessLookupError)�unicode)��)�
pid_exists�wait_pid�
disk_usage�get_terminal_mapcCsL|dkrdSzt�|d�Wn&ty0YdStyBYdS0dSdS)z6Check whether pid exists in the current process table.rTFN)�os�killr
r)�pid�r�A/usr/lib/fm-agent/dependencies/linux/python3.9/psutil/_psposix.pyr#sr�Signals�	NegsignalcCsg|]}|j|jf�qSr)�name�value)�.0�xrrr�
<listcomp>=�r cCs&z
t|�WSty |YS0dS)z+Convert a negative signal value to an enum.N)r�
ValueError��numrrr�negsig_to_enum?s
r%cCs|S)Nrr#rrrr%Fs�	monotonicc
s��dkrtd��d}d}	�dur4|	tjO}	�����������fdd�}
zt��|	�\}}Wn>tyz|
|�}YqLty�|��r�|
|�}q�YdS0|dkr�|
|�}qLqLt�|�r�t�|�St�|�r�t	t�
|��Std|��qLdS)a�Wait for a process PID to terminate.

    If the process terminated normally by calling exit(3) or _exit(2),
    or by returning from main(), the return value is the positive integer
    passed to *exit().

    If it was terminated by a signal it returns the negated value of the
    signal which caused the termination (e.g. -SIGTERM).

    If PID is not a children of os.getpid() (current process) just
    wait until the process disappears and return None.

    If PID does not exist at all return None immediately.

    If *timeout* != None and process is still alive raise TimeoutExpired.
    timeout=0 is also possible (either return immediately or raise).
    rzcan't wait for PID 0g-C��6?Ncs6�dur ���kr t���d���|��|dd�S)N)rr�g{�G�z�?r)�interval��_min�_sleep�_timerr�	proc_nameZstop_at�timeoutrr�sleepis

zwait_pid.<locals>.sleepzunknown process exit status %r)r"r�WNOHANG�waitpidrr	�	WIFEXITED�WEXITSTATUS�WIFSIGNALEDr%�WTERMSIG)
rr.r-�_waitpidr,r*r+Z_pid_existsr(�flagsr/Zretpid�statusrr)rrJs0






rcCs�trt�|�}n`zt�|�}WnPtynt|t�rhz|�t���}WntyZYn0t�|�}n�Yn0|j	|j
}|j|j
}|j|j
}||}||}t
||dd�}t||||d�S)a.Return disk usage associated with path.
    Note: UNIX usually reserves 5% disk space which is not accessible
    by user. In this function "total" and "used" values reflect the
    total and used disk space whereas "free" and "percent" represent
    the "free" and "used percent" user disk space.
    r)�round_)�total�used�free�percent)rr�statvfs�UnicodeEncodeError�
isinstancer�encode�sys�getfilesystemencoding�f_blocks�f_frsize�f_bfree�f_bavailrr)�path�str:Z
avail_to_rootZ
avail_to_userr;Z
total_userZusage_percent_userrrrr�s*
�rc	Cs^i}t�d�t�d�}|D]<}||vs0J|��z||t�|�j<WqtyVYq0q|S)zMGet a map of device-id -> path as a dict.
    Used by Process.terminal()
    z	/dev/tty*z
/dev/pts/*)�globr�stat�st_rdevr
)�ret�lsrrrrr�sr)$�__doc__rJr�signalrB�time�_commonrrrr�_compatrr	r
rrr
r�version_info�enum�__all__r�hasattr�IntEnum�dictrrr%r1�getattr�minr/rrrrrrr�<module>sJ

�
�
X1