Vc(%HddlmZddlZddlZddlZddlZddlZddlZddlZddl m Z gdZ ej dkp(e edoe edoe ejd ZGd d ejZejZd*d Zej dkr*e gd z Z ddlZd+dddZdZdZdZGddeZn%e gdz Z ddlZej dkZdZdZdZdZdZdZGddZ ee!e j"ed Z#ee!e$j%e#ee!e&j'e#d!Z(d"Z)eej*e(ej dkrd#Z+d$Z,eeje+nd%Z+d&Z,eeje+Gd'd(e)Z-dS),)ABCMetaN)context) send_handle recv_handleForkingPicklerregisterdumpwin32CMSG_LEN SCM_RIGHTSsendmsgcpeZdZdZiZejZfdZe dZ e ddZ e j Z xZS)rz)Pickler subclass used by multiprocessing.ctj||j|_|j|jdSN)super__init___copyreg_dispatch_tablecopydispatch_tableupdate_extra_reducers)selfargs __class__s 2/usr/lib64/python3.11/multiprocessing/reduction.pyrzForkingPickler.__init__&sN$":??AA ""4#788888c||j|<dS)z&Register a reduce function for a type.N)r)clstypereduces rr zForkingPickler.register+s%+D!!!rNctj}|||||Sr)ioBytesIOr getbuffer)robjprotocolbufs rdumpszForkingPickler.dumps0s;jll C$$$}}rr)__name__ __module__ __qualname____doc__rcopyregrrr classmethodr r)pickleloads __classcell__)rs@rrr!s33O%499999 ++[+[ LEEEEErrcLt|||dS)z3Replacement for pickle.dump() using ForkingPickler.N)rr )r&filer's rr r :s&4""'',,,,,r) DupHandle duplicate steal_handleF)source_processc~tj}||}||}tj|||d|tjS)zsource_process_handles rr7r7Ss ' 3  &z!;!; 7*%v)++Q-0NNPP   5 6 6 6 6G  5 6 6 6 6s AA77B cft|tj|}||dSz&Send a handle over a local connection.N)r5r:r=send)connr>destination_piddhs rrr_s) vwaccesspidprocs rrzDupHandle.__init__js "ikk&w'A5#NND *&6-//D&% 4 4 #D))))#D))))!DLDIIIs /A;;Bcj|jtjkr|jSt jtjd|j} t j||jt j|j dtj t j |S#t j |wxYw)z1Get the handle. This should only be called once.F) rYrUrVrWr:rCrDr<r;rXrErF)rr\s rrRzDupHandle.detachysyBIKK' $|#&w'A5'+y22D *.$,(A(C(CL%)GII#D))))#D))))s =BB2r)r*r+r,r-rrRrrr5r5hs=--     * * * * *rr5)DupFdsendfdsrecvfdsdarwinc0tjd|}tt|dzg}||gtjtj|fgtr(|ddkrtddSdS)z,Send an array of fds over an AF_UNIX socket.irAz%did not receive acknowledgement of fdN) arraybyteslenrsocket SOL_SOCKETr ACKNOWLEDGErQ RuntimeError)sockfdsmsgs rr`r`sk#s##SXX^$%% cUf/1BCHIJJJ  H499Q<<4/ HFGG G H H H Hrc"tjd}|j|z}|dtj|\}}}}|s |st  t r|dt|dkrtdt|z|d\}} } |tj kr| tj krt| |jzdkrt| | t|dz|dkr6tdt||dt!|Sn#tt"f$rYnwxYwtd) z/Receive an array of fds over an AF_UNIX socket.rdrrfzreceived %d items of ancdatarrez Len is {0:n} but msg[0] is {1!r}zInvalid data received)rgitemsizerecvmsgrj CMSG_SPACEEOFErrorrlrKrirmrkr ValueError frombytesAssertionErrorformatlist IndexError) rnsizea bytes_sizerpancdataflagsaddr cmsg_level cmsg_type cmsg_datas rraras K  Z$& $(LLF4Ej4Q4Q$R$R!WeT 7 N   $7||q  1"#A#&w<<$0111/6qz ,J 9f// V.. y>>AJ.!3%$$ I&&&q66C<3q6)-(:AAFFCF,,---AwwJ'    D 2333sDE++E?>E?ctj|tjtj5}t ||gddddS#1swxYwYdSrJ)rjfromfdfilenoAF_UNIX SOCK_STREAMr`)rLr>rMss rrrs ]4;;==&.&:L M M !QR Ax  ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !sAA #A ctj|tjtj5}t |ddcdddS#1swxYwYdS)rPrrN)rjrrrrra)rLrs rrrs ]4;;==&.&:L M M $QR1a==# $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $sA  A$'A$ctj}|(|||Strddlm}||Std)zReturn a wrapper for an fd.Nr)resource_sharerz&SCM_RIGHTS appears not to be available)rget_spawning_popenr_duplicate_for_childHAVE_SEND_HANDLErrv)fd popen_objrs rr_r_sw.00  G??9#@#@#D#DEE E  G ) ) ) ) ) )"((,, ,EFF Frcx|jt|j|jjffSt|j|jjffSr)__self__getattrr__func__r*ms r_reduce_methodrs:z:aj&9:::QZ%8999rceZdZdZdS)_CcdSrr^)rs rfz_C.fs rN)r*r+r,rr^rrrrs#     rrc,t|j|jffSr)r __objclass__r*rs r_reduce_method_descriptorrs Q^QZ0 00rc<t|j|j|jpiffSr)_rebuild_partialfuncrkeywords)ps r_reduce_partialrs afafaj.>B? ??rc,tj|g|Ri|Sr) functoolspartial)rrrs rrrs#  T 5D 5 5 5H 5 55rc4ddlm}t||ffS)Nr) DupSocket)rr_rebuild_socket)rrs r_reduce_socketrs)......1//rc*|Sr)rR)dss rrrsyy{{rc|t|}t||j|j|jffSr)r_rrfamilyr proto)rdfs rrrs1 188::  QXqvqw ???rcZ|}tj||||S)N)r)rRrj)rrr rrs rrrs( YY[[}VT5<<<>>ck""$=>>>"O444/////rN)r*r+r,r-rr r rrsysplatformr7r6r5r`rar_rrrrrrr^rrrrs  $NH DKK |w#   #N 9'#N%O00000rr) metaclassr)NF).abcrr.rr#rUr0rjrrr__all__rhasattrrPicklerrr r r:r6r7rrobjectr5rgrlr`rar_rrr rrrzrrrrrrrrrr^rrrs  N N NLG+8WVZ007WV\227WV]I66V^.  "----<7FG 9999GNNN ;$( ; ; ; ; ; 7 7 7 $$$*****F****F ....GLLL,(*KHHH4448!!! $$$ G G G:::          bbddf~&&&111dk  5666ck  5666@@@666 O,,, <7,000 HV]N++++@@@=== HV]N+++00000000000r