+
    }i7-                     ,   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^RIH	t
 ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ]'       d   ^RIHt . ROtR	 t]P(                  ! R
]P*                   U u/ uF  q P,                  V P.                  ) bK  	  up 4      tR tR tR]P6                  ]! ]R]P                  4      ]]P<                  ]3R ltR t RR lt!RR lt"]R 4       t#]R 4       t$RR lt%]P                   ]%n         R t&]R 4       t'R# u up i )z%Routines common to all posix systems.N)_ntuples)MACOSTimeoutExpired)debug)memoize)usage_percent)_psutil_osxc                    V ^ 8X  d   R#  \         P                  ! V ^ 4       R#   \         d     R# \         d     R# i ; i)z6Check whether pid exists in the current process table.TF)oskillProcessLookupErrorPermissionError)pids   &a/Users/ahmad/.openclaw/workspace/my-crawler/.venv/lib/python3.14/site-packages/psutil/_psposix.py
pid_existsr      sD    
ax 

Q    s   $ A A A A 	Negsignalc                @     \        V 4      #   \         d    T u # i ; i)z+Convert a negative signal value to an enum.)r   
ValueError)nums   &r   negsig_to_enumr   8   s%    ~ 
s   
 c                    \         P                  ! V 4      '       d   \         P                  ! V 4      # \         P                  ! V 4      '       d!   \	        \         P
                  ! V 4      ) 4      # RV : 2p\        V4      h)z.Convert a os.waitpid() status to an exit code.zunknown process exit status )r   	WIFEXITEDWEXITSTATUSWIFSIGNALEDr   WTERMSIGr   )statusmsgs   & r   convert_exit_coder   @   sb    	||F ~~f%%	~~f r{{62233" )

3C
S/    	monotonicc                T  aaaaaa RpRo^ pRoSe-   V\         P                  ,          pS^ 8w  d   S! 4       S,           oVVVVVV3R lp	  \         P                  ! W4      w  rV
^ 8X  d   V	! V4      pK+  \        V4      #   \         d    T! T 4      '       d   T	! T4      pK   R# i ; i)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 is specified and process is still alive raise
TimeoutExpired.

If timeout=0 either return immediately or raise TimeoutExpired
(non-blocking).
g-C6?g{Gz?Nc                 x   < S^ 8X  g   Se   S! 4       S8  d   \        S4      hS! V 4       S! V ^,          S4      #     r   )interval_min_sleep_timermax_intervalstop_attimeouts   &r   sleep_or_timeout(wait_pid_posix.<locals>.sleep_or_timeout   s<    a<G/FH4G ))xHqL,//r   )r   WNOHANGwaitpidr   ChildProcessError)r   r+   _waitpidr(   r&   r'   _pid_existsr%   flagsr,   retpidr   r)   r*   s   &f&fff&     @@r   wait_pid_posixr5   _   s    : HLEGa<h(G0 0 	1ZZ3NF {+H5(00 ! 		 c""+H5		s   B   B'
B'&B'c                     \         P                  ! V ^ 4      w  r#V^ 8w  g   Q h\        V4      #   \         d    \	        Y4      u # i ; i)z`Wrapper around os.waitpid(). PID is supposed to be gone already,
it just returns the exit code.
)r   r/   r   r0   r5   )r   r+   r4   r   s   &&  r   r1   r1      sN    )C+
 {{ ((  ,c++,s   / AAc                    \         P                  ! V ^ 4      p \        P                  ! 4       pTP                  T\        P                  4       Tf   RM\        TR,          4      pTP                  T4      pT'       g   \        T4      h\!        Y4      \         P"                  ! T4       #   \         d   pTP                  \        P                  8X  d   \        Y4      u Rp?# TP                  \        P                  \        P                  \        P                  09   d!   \        RT: R24       \        Y4      u Rp?# h Rp?ii ; i  \         P"                  ! T4       i ; i)zZWait for PID to terminate using pidfd_open() + poll(). Linux >=
5.3 + Python >= 3.9 only.
Nzpidfd_open() failed (); use fallbacki  )r   
pidfd_openOSErrorerrnoESRCHr5   EMFILEENFILEENODEVr   selectpollregisterPOLLINintr   r1   close)r   r+   pidfderrpoller
timeout_mseventss   &&     r   wait_pid_pidfd_openrK      s    c1%
 v}}-$_T#gn2E
Z( ))%
5  
99# "#//99u||U\\BB )#@A!#//
4 	sB   B, A%E  E ,E
7)E E
&AE>E
EE
E%c                \    \         P                  ! 4       p \         P                  ! T \         P                  \         P                  \         P                  ,          \         P                  R7      p TP                  T.^T4      pT'       g   \        T4      h\        Y4      TP!                  4        #   \         dV   pTP                  \        P                  \        P
                  09   d!   \        RT: R24       \        Y4      u Rp?# h Rp?ii ; i  \         du   pTP                  \        P"                  \        P$                  \        P&                  09   d1   \        RT: R24       \        Y4      u Rp?TP!                  4        # h Rp?ii ; i  TP!                  4        i ; i)z=Wait for PID to terminate using kqueue(). macOS and BSD only.zkqueue() failed (r8   Nfilterr3   fflagszkqueue.control() failed ()r@   kqueuer:   r;   r=   r>   r   r5   keventKQ_FILTER_PROC	KQ_EV_ADDKQ_EV_ONESHOTKQ_NOTE_EXITcontrolr   r1   rE   EACCESEPERMr<   )r   r+   kqrG   kevrJ   s   &&    r   wait_pid_kqueuer[      s<   ]]_mm((""V%9%99&&	

	*ZZq'2F $W--C)

3  99u||44%cWO<=!#//	  	yyU\\5;;DD1#HI%c33 	
 		 	
sg   B4 AF 2D F 4D?A	DDDDF"AF:F;F FFF F+c                  T   \        \        R 4      '       g   R#  \        P                  ! \        P                  ! 4       ^ 4      p \        P                  ! V 4       R#   \
         dA   pTP                  \        P                  \        P                  09   d    Rp?R#  Rp?R# Rp?ii ; i)r9   FTN)	hasattrr   r9   getpidrE   r:   r;   r=   r>   )rF   rG   s     r   can_use_pidfd_openr_      sr     2|$$biik1- 	  99u||44 s   *A B''/B""B'c                     Rp \         ;QJ d    R V  4       F  '       d   K   RM	  RM! R V  4       4      '       g   R# Rp \        P                  ! 4       p\        P                  ! \        P
                  ! 4       \        P                  \        P                  \        P                  ,          \        P                  R7      pVP                  V.^^ 4        Ve   VP                  4        R# R#   \         dm   pTP                  \        P                  \        P                  09   d    Rp?Te   TP                  4        R# R#  Rp?Te   TP                  4        R# R# Rp?ii ; i  Te   TP                  4        i i ; i)rP   c              3   B   "   T F  p\        \        V4      x  K  	  R # 5iN)r]   r@   ).0xs   & r   	<genexpr>!can_use_kqueue.<locals>.<genexpr>  s     15awvq!!5s   FTNrM   )rP   rS   rT   rR   rU   )allr@   rP   rQ   r   r^   rR   rS   rT   rU   rV   rE   r:   r;   r=   r>   )namesrY   rZ   rG   s       r   can_use_kqueueri     s   E 315133315111	B]]_mmIIK((""V%9%99&&	
 	

C5!Q >HHJ   99u||44 >HHJ  >HHJ  >HHJ s=   BC0 0E';/E"*E* 1E* E* E* "E''E* *Fc                     V ^ 8  g   Q hVe
   V^ 8  g   Q h\        4       '       d   \        W4      # \        4       '       d   \        W4      # \	        W4      # r#   )r_   rK   ri   r[   r5   )r   r+   s   &&r   wait_pidrk   (  sT     7N7!||"300			s,,c++r   c                   \         P                  ! V 4      pVP                  VP                  ,          pVP                  VP                  ,          pVP
                  VP                  ,          pW#,
          p\        '       d   \        P                  ! W4      pWT,           p\        WV^R7      p\        P                  ! W%WGR7      # )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.
)round_)totalusedfreepercent)r   statvfsf_blocksf_frsizef_bfreef_bavailr   r	   disk_usage_usedr   ntp
sdiskusage)pathstrn   avail_to_rootavail_to_userro   
total_userusage_percent_users   &       r   
disk_usager   :  s     
D	B KK"++%EJJ,MKK"++-M Du**46 %J 'tB
 >>] r   c                    / p \         P                   ! R4      \         P                   ! R4      ,           pV F3  pW 9  g   Q V4       h W \        P                  ! V4      P                  &   K5  	  V #   \         d     KG  i ; i)zFGet a map of device-id -> path as a dict.
Used by Process.terminal().
z	/dev/tty*z
/dev/pts/*)globr   statst_rdevFileNotFoundError)retlsnames      r   get_terminal_mapr   ^  st    
 C	;	$))L"9	9B$$	)-%%&  J ! 		s   "A//A>=A>)r   rk   r   r   rb   )(__doc__enumr;   r   r   r@   signaltime r   rx   _commonr   r   r   r   r   r	   __all__r   IntEnumSignalsr   valuer   r   r   r/   getattrminsleepr5   r1   rK   r[   r_   ri   rk   r   r   )rd   s   0r   <module>r      s#  
 ,    	      #   " G, LLFNN;Nq&&177("N;	
B ZZ4dii0	::A1H) F@ 	 	$ 	 	@, ")) !H 	 	W	 <s   3 D
