Your IP : 18.117.196.141
�
��bg5 ����dZddlZddlZddlZddlZddlZddlmZddlmZddlm Z ddlm
Z
ddlmZdd lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZerddlmZejdkrddlZndZgd�Zd�Ze�9eed��r-ejded�ejD������Zd�Znd�Zddej e!edej��e"ej#efd�Z$d�Z%e d���Z&dS)z%Routines common to all posix systems.�N�)�MACOS��TimeoutExpired)�memoize)�
sdiskusage)�
usage_percent)�PY3)�ChildProcessError)�FileNotFoundError)�InterruptedError)�PermissionError)�ProcessLookupError)�unicode)�_psutil_osx)��)�
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�killrr)�pids �F/opt/cloudlinux/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%Bs#��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+Ds7�� ��S�>�>�!��� � � ��J�J�J� ���s�� � c��|S)Nr r)s rr+r+Ks���
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>.sleepnsU������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+�WTERMSIGr
r)rr7r5�_waitpidr4r2r3�_pid_existsr1�flagsr8�retpid�statusr6s``` ``` @rrrOs����������.�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
}trtj||��}||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)r
r�statvfs�UnicodeEncodeError�
isinstancer�encode�sys�getfilesystemencoding�f_blocks�f_frsize�f_bfree�f_bavailrr�disk_usage_usedr r)�path�strF�
avail_to_root�
avail_to_userrG�
total_user�usage_percent_users rrr�sV����
�Z��
�
���
���D�!�!�B�B��!� � � ��$��(�(�
���;�;�s�'@�'B�'B�C�C�D�D��)�����D������Z��%�%������
�����[�2�;�
&�E��Z�"�+�-�M��[�2�;�.�M��M�!�D��7��*�4��6�6���
�%�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�lsr!s rrr�s���
�C�
��;� � �$�)�L�"9�"9� 9�B������3�������� �)-�C����
�
�%�&�&�� � � � ��D� �����Js�A�
A)�(A))'�__doc__r\r�signalrN�time�_commonrrrrr �_compatr
rrr
rrr�r�version_info�enum�__all__r�hasattr�IntEnum�dictrrr+r:�getattr�minr8rrrr r&r�<module>ros[��
,�+����� � � � �
�
�
�
�
�
�
�
�����������#�#�#�#�#�#�������������"�"�"�"�"�"�������&�&�&�&�&�&�&�&�&�&�&�&�%�%�%�%�%�%�$�$�$�$�$�$�'�'�'�'�'�'������� ����������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�p1P�1P�1P�h ��� ����r&
?>