Vc(%csHddlmZddlZddlZddlZddlZddlZddlZddlZddl 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_handleForkingPicklerregisterdumpwin32ZCMSG_LEN SCM_RIGHTSsendmsgcspeZdZdZiZejZfdZe dZ e ddZ e j Z xZS)rz)Pickler subclass used by multiprocessing.cstj||j|_|j|jdSN)Zsuper__init___copyreg_dispatch_tableZcopydispatch_tableZupdate_extra_reducers)selfargs __class__s 2/usr/lib64/python3.11/multiprocessing/reduction.pyr zForkingPickler.__init__&sN$":??AA ""4#788888cs||j|<dS)z&Register a reduce function for a type.N)r)clstypeZreduce rrzForkingPickler.register+s%+D!!!rNcstj}|||||Sr )ioZBytesIOrZ getbuffer)robjprotocolZbuf rdumpszForkingPickler.dumps0s;jll C$$$}}rr )__name__ __module__ __qualname____doc__rcopyregrrr Z classmethodrrpickleZloadsZ __classcell__)rs@rrr!s33O%499999 ++[+[ LEEEEErrcsLt|||dS)z3Replacement for pickle.dump() using ForkingPickler.N)rr)rZfilerrrrr:s&4""'',,,,,r) DupHandle duplicate steal_handleF)source_processcs~tj}||}||}tj|||d|tjS)zr:r;r<r(r.r/r*r)r=r0r1)rr? rr8zDupHandle.detachysyBIKK' $|#&w'A5'+y22D *.$,(A(C(CL%)GII#D))))#D))))s =BB2r )rrr r!r r8rrr$r$hs=--     * * * * *rr$)DupFdsendfdsrecvfdsZdarwincs0tjd|}tt|dzg}||gtjtj|fgtr(|ddkrtddSdS)z,Send an array of fds over an AF_UNIX socket.irAz%did not receive acknowledgement of fdN) arrayZbyteslenr socket SOL_SOCKETr ACKNOWLEDGEr7 RuntimeError)sockZfdsmsgrrrCrCsk#s##SXX^$%% cUf/1BCHIJJJ  H499Q<<4/ HFGG G H H H Hrcs"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.rErrGzreceived %d items of ancdatarrFz Len is {0:n} but msg[0] is {1!r}zInvalid data received)rHZitemsizeZrecvmsgrJZ CMSG_SPACEZEOFErrorrLr3rIrMrKr ValueErrorZ frombytesZAssertionErrorZformatlistZ IndexError) rNZsizeZaZ bytes_sizerOZancdataZflagsZaddrZ cmsg_levelZ cmsg_typeZ cmsg_datas rrDrDs 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?cstj|tjtj5}t ||gddddS#1swxYwYdSr2)rJfromfdfilenoAF_UNIX SOCK_STREAMrC)r4r,r5srrrrs ]4;;==&.&:L M M !QR Ax  ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !sAA #A cstj|tjtj5}t |ddcdddS#1swxYwYdS)r6rrN)rJrRrSrTrUrD)r4rVr@rrrs ]4;;==&.&:L M M $QR1a==# $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $sA  A$'A$cstj}|(|||Strddlm}||Std)zReturn a wrapper for an fd.Nr)resource_sharerz&SCM_RIGHTS appears not to be available)rZget_spawning_popenrBZduplicate_for_childHAVE_SEND_HANDLErWrP)fdZ popen_objrWrrrBrBsw.00  G??9#@#@#D#DEE E  G ) ) ) ) ) )"((,, ,EFF Frcsx|jt|j|jjffSt|j|jjffSr )Z__self__getattrrZ__func__rZmr9r_reduce_methodr]s:z:aj&9:::QZ%8999rcseZdZdZdS)_CcsdSr rA)rr9rfz_C.fs rN)rrr r_rArrr^r^s#     rr^cs,t|j|jffSr )r[Z __objclass__rr\r9r_reduce_method_descriptorr`s Q^QZ0 00rcs<t|j|j|jpiffSr )_rebuild_partialfuncrkeywords)Zpr9r_reduce_partialrds afafaj.>B? ??rcs,tj|g|Ri|Sr ) functoolspartial)rbrrcrrraras#  T 5D 5 5 5H 5 55rcs4ddlm}t||ffS)Nr) DupSocket)rWrg_rebuild_socket)rVrgr@r_reduce_socketris)......1//rcs*|Sr )r8)Zdsr9rrhrhsyy{{rcs|t|}t||j|j|jffSr )rBrSrhfamilyrproto)rVdfr@rriris1 188::  QXqvqw ???rcsZ|}tj||||S)N)rS)r8rJ)rlrjrrkrZr-rrhrhs( YY[[}VT5<<<>>ck""$=>>>"O444/////rN)rrr r!rrrrrsysplatformr&r%r$rCrDrBr]r`rarirhr rArrrmrms  $NH DKK |w#   #N 9'#N%O00000rrm)Z metaclassr )NF).Zabcrr"rerr:r#rJrqrYrZ__all__rrZhasattrrXZPicklerrrrr(r%r&rrZobjectr$rHrLrCrDrBr]r^rr_r`rQrnrorprdrarfrirhrmrArrrss  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