403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/psutil/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/psutil/__pycache__/_psosx.cpython-310.pyc
o

;j)>�@s�dZddlZddlZddlZddlmZddlmZddlmZddlm	Z
ddlmZdd	lmZdd
lm
Z
ddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZgZe
��Ze
jZe
jeje
jeje
jeje
jej e
j!ej"e
j#ej$e
j%ej&e
j'ej(e
j)ej*e
j+ej,e
j-ej.e
j/ej0iZ1e
j2ej3e
j4ej5e
j6ej7e
j8ej9e
j:ej;iZ<e=dddddddddddd�Z>e=ddddddddd�Z?dd�Z@dd �ZAe
jBZBe
jCZCd!d"�ZDd#d$�ZEd%d&�ZFd'd(�ZGd)d*�ZHe
�I�r�d+d,�ZJejKZKe
jLZLdDd.d/�ZMd0d1�ZNe
jOZOe
jPZPdEd3d4�ZQd5d6�ZRd7d8�ZSzeS�ZTWneU�y;ZVzed9eV���dZTWYdZV[VndZV[Vwwd:d;�ZWd<d=�ZXd>d?�ZYejZZZd@dA�Z[GdBdC�dC�Z\dS)FzmacOS platform implementation.�N�)�_common)�_ntuples)�_psposix)�_psutil_osx)�AccessDenied)�
NoSuchProcess)�
ZombieProcess)�	conn_tmap)�conn_to_ntuple)�debug)�
isfile_strict)�memoize_when_activated)�parse_environ_block)�
usage_percent��������	�
)�ppid�ruid�euid�suid�rgid�egid�sgid�ttynr�ctime�status�name)�cpuutime�cpustime�rss�vms�pfaults�pageins�
numthreads�volctxswc	
CsVt��\}}}}}}||}||}||8}t|||dd�}t�||||||||�S)z&System virtual memory as a namedtuple.r�Zround_)�cextZvirtual_memr�ntpZsvmem)	�totalZactiveZinactiveZwired�freeZspeculativeZavail�used�percent�r4�A/opt/saltstack/salt/lib/python3.10/site-packages/psutil/_psosx.py�virtual_memory[s�r6cCs4t��\}}}}}t||dd�}t�||||||�S)z=Swap system memory as a (total, used, free, sin, sout) tuple.rr-)r.Zswap_memrr/Zsswap)r0r2r1�sinZsoutr3r4r4r5�swap_memorylsr8cCs t��\}}}}t�||||�S)z(Return system CPU times as a namedtuple.)r.�	cpu_timesr/�	scputimes)�user�nice�system�idler4r4r5r9}sr9cCs<g}t��D]}|\}}}}t�||||�}|�|�q|S)z)Return system CPU times as a named tuple.)r.�
per_cpu_timesr/r:�append)�retZcpu_tr;r<r=r>�itemr4r4r5r?�sr?cC�t��S)z0Return the number of logical CPUs in the system.)r.�cpu_count_logicalr4r4r4r5rD��rDcCrC)z-Return the number of CPU cores in the system.)r.�cpu_count_coresr4r4r4r5rF�rErFcCs"t��\}}}}}t�||||�S�N)r.�	cpu_statsr/Z	scpustats)Zctx_switchesZ
interruptsZsoft_interruptsZsyscallsZ_trapsr4r4r5rH�s�rHcCst��\}}}t�|||�gS)z�Return CPU frequency.
        On macOS per-cpu frequency is not supported.
        Also, the returned frequency never changes, see:
        https://arstechnica.com/civis/viewtopic.php?f=19&t=465002.
        )r.�cpu_freqr/Zscpufreq)�currZmin_Zmax_r4r4r5rI�srIFc	Csjg}t��}|D]*}|\}}}}|dkrd}|s%tj�|�r$tj�|�s%qt�||||�}|�|�q|S)z8Return mounted disk partitions as a list of namedtuples.�none�)	r.�disk_partitions�os�path�isabs�existsr/Z	sdiskpartr@)	�all�retlistZ
partitions�	partitionZdeviceZ
mountpointZfstype�opts�ntupler4r4r5rM�srMcCsbz	t��\}}}Wn
tyYdSw|dk}|rtj}n|dkr&tj}n|d}t�|||�S)zReturn battery information.Nr����<)r.�sensors_battery�NotImplementedErrorrZPOWER_TIME_UNLIMITEDZPOWER_TIME_UNKNOWNr/Zsbattery)r3ZminsleftZ
power_pluggedZsecsleftr4r4r5rY�s�rY�inetc	Csfg}t�D]+}z	t|��|�}Wn	tyYqw|r0|D]}t|�|g}|�tj|��qq|S)z System-wide network connections.)�pids�Process�net_connectionsr�listr@r/Zsconn)�kindrA�pidZcons�cr4r4r5r^�s
��r^c
Cs�t���}i}|D]M}zt�|�}t�|�}t�|�\}}Wnty7}z
|jtjkr-�WYd}~q	d}~wwt	t
d�rBt
�|�}d�|�}d|v}	t
�|	||||�||<q	|S)z)Get NIC stats (isup, duplex, speed, mtu).N�	NicDuplex�,Zrunning)�net_io_counters�keysr.Z
net_if_mtuZnet_if_flagsZnet_if_duplex_speed�OSError�errnoZENODEV�hasattrrrc�joinr/Z	snicstats)
�namesrAr$Zmtu�flagsZduplexZspeed�errZoutput_flagsZisupr4r4r5�net_if_stats�s&


���


rncCrC)z:The system boot time expressed in seconds since the epoch.)r.�	boot_timer4r4r4r5rorErozignoring exception on import: cCsNtdkr|Stt�}|dkst|�dkr|Std�|dkr#||S||S)z!Account for system clock updates.rrz9system clock was updated; adjusting process create_time())�INIT_BOOT_TIMEro�absr)r"�diffr4r4r5�adjust_proc_create_times
rsc	Cs\g}t��}|D]#}|\}}}}}|dkrq|sqt�||pd|p"d||�}|�|�q|S)z:Return currently connected users as a list of namedtuples.�~N)r.�usersr/Zsuserr@)	rS�rawlistrBr;Ztty�hostnameZtstampra�ntr4r4r5ru+srucCsft��}d|vr1ztd���|�dd�W|Sty!Y|Sty0|�dd�Y|Sw|S�Nr)r.r\r]�create_time�insertrr)Zlsr4r4r5r\?s���r\cst����fdd��}|S)z`Decorator which translates bare OSError exceptions into
    NoSuchProcess and AccessDenied.
    c
s�|j|j|j}}}z�|g|�Ri|��WSty5}zt�|�r+t|||�|�t||�|�d}~wtyF}zt	||�|�d}~wtj
yY}zt|||�|�d}~wwrG)ra�_ppid�_name�ProcessLookupErrorr.Zproc_is_zombier	r�PermissionErrorrZZombieProcessError)�self�args�kwargsrarr$rm��funr4r5�wrapperWs
����z wrap_exceptions.<locals>.wrapper)�	functools�wraps)r�r�r4r�r5�wrap_exceptionsRs
r�c@sjeZdZdZgd�Zdd�Zeedd���Zeedd���Z	d	d
�Z
dd�Zed
d��Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zed#d$��Zed>d&d'��Zed(d)��Zed*d+��Zed,d-��Zed?d/d0��Zed1d2��Zed@d4d5��Zed6d7��Zed8d9��Z ed:d;��Z!ed<d=��Z"d3S)Ar]z1Wrapper class around underlying C implementation.)�_cacher}r|racCs||_d|_d|_dSrG)rar}r|)r�rar4r4r5�__init__ms
zProcess.__init__cC�$t�|j�}t|�tt�ksJ�|SrG)r.Zproc_kinfo_oneshotra�len�kinfo_proc_map�r�rAr4r4r5�_get_kinfo_procr�zProcess._get_kinfo_proccCr�rG)r.Zproc_pidtaskinfo_oneshotrar��pidtaskinfo_mapr�r4r4r5�_get_pidtaskinfozr�zProcess._get_pidtaskinfocC�|j�|�|j�|�dSrG)r�Zcache_activater��r�r4r4r5�
oneshot_enter��zProcess.oneshot_entercCr�rG)r�Zcache_deactivater�r�r4r4r5�oneshot_exit�r�zProcess.oneshot_exitcCs(|��td}|dur|St�|j�S)Nr$)r�r�r.Z	proc_namera)r�r$r4r4r5r$�szProcess.namecC�t�|j�SrG)r.Zproc_exerar�r4r4r5�exe��zProcess.execCr�rG)r.Zproc_cmdlinerar�r4r4r5�cmdline�r�zProcess.cmdlinecCstt�|j��SrG)rr.Zproc_environrar�r4r4r5�environ��zProcess.environcCs|��td|_|jS)Nr)r�r�r|r�r4r4r5r�szProcess.ppidcCr�rG)r.Zproc_cwdrar�r4r4r5�cwd�r�zProcess.cwdcC�.|��}t�|td|td|td�S)Nrrr�r�r/Zpuidsr��r�Zrawtupler4r4r5�uids��


�zProcess.uidscCr�)Nrrr r�r�r4r4r5�gids�r�zProcess.gidscCs8|��td}t��}z||WStyYdSw)Nr!)r�r�rZget_terminal_map�KeyError)r�Ztty_nrZtmapr4r4r5�terminal�s
�zProcess.terminalcCs8|��}t�|td|td|td|td�S)Nr'r(r)r*)r�r/Zpmemr�r�r4r4r5�memory_info�s



�zProcess.memory_infocCs$|��}t�|j�}tj||f�SrG)r�r.Zproc_memory_ussrar/Zpfullmem)r�Z	basic_memZussr4r4r5�memory_full_info�szProcess.memory_full_infocCs(|��}t�|td|tddd�S)Nr%r&g)r�r/Z	pcputimesr�r�r4r4r5r9�s

�zProcess.cpu_timesFcCs |��td}|st|�}|S)Nr")r�r�rs)r��	monotonicr"r4r4r5rz�szProcess.create_timecC�|��td}t�|d�S)Nr,r)r�r�r/Zpctxsw)r�Zvolr4r4r5�num_ctx_switches�szProcess.num_ctx_switchescCs|��tdS)Nr+)r�r�r�r4r4r5�num_threads�r�zProcess.num_threadscCsN|jdkrgSg}t�|j�}|D]\}}t|�r$t�||�}|�|�q|Sry)rar.Zproc_open_filesr
r/Z	popenfiler@)r��filesrvrO�fdrVr4r4r5�
open_files�s

�zProcess.open_filesr[c	Cs\t|\}}t�|j||�}g}|D]}|\}}}	}
}}t|||	|
||t�}
|�|
�q|SrG)r
r.Zproc_net_connectionsrar�TCP_STATUSESr@)r�r`Zfamilies�typesrvrArBr�Zfam�type�laddr�raddrr#rxr4r4r5r^�s�zProcess.net_connectionscCs|jdkrdSt�|j�Sry)rar.Zproc_num_fdsr�r4r4r5�num_fdss
zProcess.num_fdsNcC�t�|j|�SrG)rZwait_pidra)r��timeoutr4r4r5�wait�zProcess.waitcCr�rG)r.Zproc_priority_getrar�r4r4r5�nice_getr�zProcess.nice_getcCr�rG)r.Zproc_priority_setra)r��valuer4r4r5�nice_setr�zProcess.nice_setcCr�)Nr#�?)r�r��
PROC_STATUSES�get)r��coder4r4r5r#szProcess.statuscCs<t�|j�}g}|D]\}}}t�|||�}|�|�q
|SrG)r.Zproc_threadsrar/Zpthreadr@)r�rvrSZ	thread_id�utimeZstimerVr4r4r5�threadsszProcess.threads�F�r[rG)#�__name__�
__module__�__qualname__�__doc__�	__slots__r�r�rr�r�r�r�r$r�r�r�rr�r�r�r�r�r�r9rzr�r�r�r^r�r�r�r�r#r�r4r4r4r5r]hst









	









r]r�r�)]r�rhr�rNrLrrr/rrr.rrr	r
rrr
rrrZ__extra__all__ZgetpagesizeZPAGESIZEZAF_LINKZTCPS_ESTABLISHEDZCONN_ESTABLISHEDZ
TCPS_SYN_SENTZ
CONN_SYN_SENTZTCPS_SYN_RECEIVEDZ
CONN_SYN_RECVZTCPS_FIN_WAIT_1ZCONN_FIN_WAIT1ZTCPS_FIN_WAIT_2ZCONN_FIN_WAIT2ZTCPS_TIME_WAITZCONN_TIME_WAITZTCPS_CLOSEDZ
CONN_CLOSEZTCPS_CLOSE_WAITZCONN_CLOSE_WAITZ
TCPS_LAST_ACKZ
CONN_LAST_ACKZTCPS_LISTENZCONN_LISTENZTCPS_CLOSINGZCONN_CLOSINGZPSUTIL_CONN_NONEZ	CONN_NONEr�ZSIDLZSTATUS_IDLEZSRUNZSTATUS_RUNNINGZSSLEEPZSTATUS_SLEEPINGZSSTOPZSTATUS_STOPPEDZSZOMBZ
STATUS_ZOMBIEr��dictr�r�r6r8Z	heap_infoZ	heap_trimr9r?rDrFrHZhas_cpu_freqrI�
disk_usageZdisk_io_countersrMrYreZnet_if_addrsr^rnrorp�	Exceptionrmrsrur\Z
pid_existsr�r]r4r4r4r5�<module>s�����



��

Youez - 2016 - github.com/yon3zu
LinuXploit