
    Jf                         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(  rJ e e	ej                  d	               \  ZZ e j                   ed
ez   dz           e j"                  e       yy)    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	            W/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/twisted/python/test/pullpipe.pyrecvfdr      s[     h8J8J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S!-.OBBHHR'+5>?BHHRL r   