
     f
                        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k    rej        dk    serJ 	 d d	lmZ d
eddfdZnU# e$ rM d dlZ ej                    Ze                    d           e                    d          j        Zd
eddfdZY nw xY w e
ej                  Zd
ededdfdZddZdS )    N)TYPE_CHECKING   )_core_subprocess)CapacityLimiterEvent)to_thread_run_syncwin32darwin)waitidpidreturnc                 j    t          t          j        | t          j        t          j        z             d S N)r   osP_PIDWEXITEDWNOWAIT)r   s    c/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/trio/_subprocess_platform/waitid.pysync_wait_reapabler      s%    rxbj2:56666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                              d          }t	          || |||z            dk     r?t          j        }|t
          j        k    r6t          |t          j	        |                    d S )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## !GG G..%fg.?@@1DD"(IEK'')R[%;%;<<<	 EDr   eventc                    K   	 t          t          | dt                     d{V  n# t          $ r Y nw xY w|                                 dS # |                                 w xY 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   s       t^
 
 
 	
 	
 	
 	
 	
 	
 	
 	
     	 					s!   #( A 
5A 5A A$process_subprocess.Processc                    K   | j         5t                      x| _         }t          j        t          | j        |           t          | j         t                    sJ | j                                          d {V  d S r   )_wait_for_exit_datar   r   spawn_system_taskr-   r   
isinstancewait)r.   r'   s     r   wait_child_exitingr5   _   s       "*.3gg5#e 3W[%HHHg1599999

%
*
*
,
,,,,,,,,,,r   )r.   r/   r   N)r!   mathr   r   typingr    r   r   _syncr   r   _threadsr	   r   r   intr   ImportErrorcffiFFIr   cdefdlopenr    infr+   r-   r5    r   r   <module>rC      s     				 



             ! ! ! ! ! ! ! ! * * * * * * * * ) ) ) ) ) )CLH$<$<]$<$<$<1=7 7 7 7 7 7 7  += += += KKKJ OO	   ##D))0K= = = = = = = =9+=b !**3 u     0- - - - - -s   A AB)(B)