
    ,h0                        d dl Z d dlZd dlZd dlZd dlmZ ddlmZmZ ddl	m
Z
mZ ddlmZ ej                  dk7  rej                  dk7  serJ 	 d d	lmZ d
eddfdZ e
ej2                        Zd
ededdfdZddZy# e$ rL d dlZ ej(                         Zej-                  d       ej/                  d      j                  Zd
eddfdZY qw xY w)    N)TYPE_CHECKING   )_core_subprocess)CapacityLimiterEvent)to_thread_run_syncwin32darwin)waitidpidreturnc                 x    t        t        j                  | t        j                  t        j                  z         y N)r   osP_PIDWEXITEDWNOWAIT)r   s    b/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/trio/_subprocess_platform/waitid.pysync_wait_reapabler      s    rxxbjj2::56    z
typedef struct siginfo_s {
    int si_signo;
    int si_errno;
    int si_code;
    int si_pid;
    int si_uid;
    int si_status;
    int pad[26];
} siginfo_t;
int waitid(int idtype, int id, siginfo_t* result, int options);
c                    d}d}t         j                  dk(  rd}nd}t        j                  d      }t	        || |||z        dk  rCt        j
                  }|t
        j                  k(  r8t        |t        j                  |            y )N      r       i   zsiginfo_t *r   )
sysplatform
waitid_ffinewwaitid_cffierrnoEINTROSErrorr   strerror)r   r   r   r   result	got_errnos         r   r   r   /   s    <<8# !G G.%fg.?@1D"((IEKK')R[[%;<<	 Er   eventc                    K   	 t        t        | dt               d{    |j	                          y7 # t        $ r Y w xY w# |j	                          w xY ww)zdSpawn a thread that waits for ``pid`` to exit, then wake any tasks
    that were waiting on it.
    T)abandon_on_cancellimiterN)r	   r   waitid_limiterr#   set)r   r'   s     r   _waitid_system_taskr-   G   sZ      ""	
 	
 	
 				
   	 			s<   A6 46 A6 	AA AA AAc                   K   | j                   6t               x| _         }t        j                  t        | j
                  |       t        | j                   t              sJ | j                   j                          d {    y 7 wr   )_wait_for_exit_datar   r   spawn_system_taskr-   r   
isinstancewait)processr'   s     r   wait_child_exitingr4   b   se      ""*.3g5#e 3W[[%Hg11599

%
%
*
*
,,,s   A<B>B?B)r3   z_subprocess.Processr   N)r!   mathr   r   typingr    r   r   _syncr   r   _threadsr	   r   r   intr   ImportErrorcffiFFIr   cdefdlopenr    infr+   r-   r4    r   r   <module>rB      s      	 
   ! * )CLLH$<] R1=7 7 7h !*3 u  6-_  += J OO	 ##D)00K= = =9+=s   A? ?ACC