Your IP : 3.135.214.226


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/psutil/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/psutil/__pycache__/_psposix.cpython-311.pyc

�

]�Dgm����dZddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZejdkrddlZndZgd�Zd�Ze�9eed��r-ejded�ejD������Zd�Znd�Zddejeedej��eej efd�Z!d�Z"ed���Z#dS)z%Routines common to all posix systems.�N�)�memoize)�
sdiskusage��TimeoutExpired)�
usage_percent)�ChildProcessError)�FileNotFoundError)�InterruptedError)�PermissionError)�ProcessLookupError)�PY3)�unicode)��)�
pid_exists�wait_pid�
disk_usage�get_terminal_mapc�|�|dkrdS	tj|d��dS#t$rYdSt$rYdSwxYw)z6Check whether pid exists in the current process table.rTF)�os�killr
r)�pids �F/opt/imunify360/venv/lib64/python3.11/site-packages/psutil/_psposix.pyrr"sj��
�a�x�x��t�
�
���Q�����t�������u�u������t�t����s�!�
;�	;�;�Signals�	Negsignalc�,�g|]}|j|jf��S�)�name�value)�.0�xs  r�
<listcomp>r#<s#��F�F�F�!�A�F�Q�W�H�-�F�F�F�c�F�	t|��S#t$r|cYSwxYw)z+Convert a negative signal value to an enum.)r�
ValueError��nums r�negsig_to_enumr)>s7��	��S�>�>�!���	�	�	��J�J�J�	���s�� � c��|S)Nrr's rr)r)Es���
r$�	monotonicc�^�������
��dkrtd���d}d}	��|	tjz}	����z�
������
�fd�}
		tj�|	��\}}|dkr|
|��}�,tj|��rtj|��Stj|��r"ttj|����Std|z���#t$r|
|��}Yn1t$r%|���r|
|��}|����YdSwxYw��)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?Nc�|���� ����krt��������|���|dzd��S)N)rr�g{�G�z�?r)�interval�_min�_sleep�_timerr�	proc_name�stop_at�timeouts �������r�sleepzwait_pid.<locals>.sleephsU������v�x�x�7�"�"�$�W�#�I�F�F�F�F���x�����t�H�q�L�$�'�'�'r$Tzunknown process exit status %r)r&r�WNOHANG�waitpid�	WIFEXITED�WEXITSTATUS�WIFSIGNALEDr)�WTERMSIGrr	)rr5r3�_waitpidr2r0r1�_pid_existsr/�flagsr6�retpid�statusr4s``` ```      @rrrIs����������.�a�x�x��/�0�0�0��H�
�E���
������&�(�(�W�$��(�(�(�(�(�(�(�(�(�(�(�-L�,	L��Z��U�3�3�N�F�F���{�{� �5��?�?�����f�%�%�
L��~�f�-�-�-����'�'�
L�&�r�{�6�':�':�&:�;�;�;�"!�!A�F�!J�K�K�K��U �	'�	'�	'��u�X���H�H�H� �		�		�		��+�c�"�"�
+� �5��?�?���+�c�"�"�
+��F�F�		����-Ls�C&�&D+�=*D+�*D+c��trtj|��}n�	tj|��}ns#t$rft	|t
��rM	|�tj����}n#t$rYnwxYwtj|��}n�YnwxYw|j	|j
z}|j|j
z}|j|j
z}||z
}||z}t||d���}t||||���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�strD�
avail_to_root�
avail_to_userrE�
total_user�usage_percent_users        rrr�s<����
�Z��
�
���

	���D�!�!�B�B��!�	�	�	��$��(�(�
���;�;�s�'@�'B�'B�C�C�D�D��)�����D������Z��%�%������
	�����[�2�;�
&�E��Z�"�+�-�M��[�2�;�.�M��M�!�D��
�%�J�'�t�Z��B�B�B��
��$�]�<N�P�P�P�Ps3�3�B#�&A:�9B#�:
B�B#�B�B#�"B#c���i}tjd��tjd��z}|D]=}||vs
J|���	||tj|��j<�.#t$rY�:wxYw|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�lsrs   rrr�s���

�C�	
��;�	�	�$�)�L�"9�"9�	9�B������3��������	�)-�C����
�
�%�&�&�� �	�	�	��D�	�����Js�A�
A)�(A))$�__doc__rYr�signalrL�time�_commonrrrr�_compatr	r
rrr
rr�version_info�enum�__all__r�hasattr�IntEnum�dictrrr)r8�getattr�minr6rrrrr$r�<module>rks+��
,�+�����	�	�	�	�
�
�
�
�
�
�
�
�����������������#�#�#�#�#�#�"�"�"�"�"�"�&�&�&�&�&�&�&�&�&�&�&�&�%�%�%�%�%�%�$�$�$�$�$�$�'�'�'�'�'�'���������������v����K�K�K�K��D�G�
F�
F�����0�����	�2�2������T�T�F�F�v�~�F�F�F�G�G�I�I�I���������$��j��G�D�+�t�y�9�9���J�#�UL�UL�UL�UL�p.P�.P�.P�b	���	����r$

?>