
    \d                        d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ de	dee	e
f         fdZedk    rK e e	ej        d	                             \  ZZ e j        ed
ez   dz               e j        e           dS dS )    N)unpack)Tuple)recvmsgsocketfdreturnc                     t          j        | t           j        t           j                  }t	          |          \  }}}|\  \  }}}t          d|          \  }||fS )az  
    Receive a file descriptor from a L{sendmsg} message on the given C{AF_UNIX}
    socket.

    @param socketfd: An C{AF_UNIX} socket, attached to another process waiting
        to send sockets via the ancillary data mechanism in L{send1msg}.

    @param fd: C{int}

    @return: a 2-tuple of (new file descriptor, description).
    @rtype: 2-tuple of (C{int}, C{bytes})
    i)socketfromfdAF_UNIXSOCK_STREAMr   r   )	r   	ourSocketdata	ancillaryflags	cmsgLevelcmsgTypepackedFD
unpackedFDs	            <lib/python3.11/site-packages/twisted/python/test/pullpipe.pyrecvfdr      s]     h8JKKI$Y//D)U(1%$i8 #x((LZ    __main__   s   Test fixture data: s   .
)osr
   sysstructr   typingr   twisted.python.sendmsgr   intbytesr   __name__argvfddescriptionwriteclose r   r   <module>r)      s   
 
			  



             * * * * * *S U3:.    . zfSS!--..OBBHR'+5>???BHRLLLLL r   