404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@13.59.218.229: ~ $
3

u1�W��@s�dZddlmZddlmZddlmZddlmZddlZddlZddlm	Z	ddl
mZdd	l
mZdd
l
m
Z
ddlmZeedd
�Zdd�Zdd�Zdd�Ze�Zdd�Zdd�ZGdd�de�ZdS)a#
    pyudev._os.pipe
    ===============

    Fallback implementations for pipe.

    1. pipe2 from python os module
    2. pipe2 from libc
    3. pipe from python os module

    The Pipe class wraps the chosen implementation.

    .. moduleauthor:: Sebastian Wiesner  <lunaryorn@gmail.com>
�)�absolute_import)�division)�print_function)�unicode_literalsN)�partial)�fd_pair)�ERROR_CHECKERS)�
SIGNATURES)�load_ctypes_library�	O_CLOEXECicCs"t�}|j||�|d|dfS)z�A ``pipe2`` implementation using ``pipe2`` from ctypes.

    ``libc`` is a :class:`ctypes.CDLL` object for libc.  ``flags`` is an
    integer providing the flags to ``pipe2``.

    Return a pair of file descriptors ``(r, w)``.

    r�)r�pipe2)�libc�flags�fds�r�/usr/lib/python3.6/pipe.py�
_pipe2_ctypes4s	rcCsXtj�}|tj@dkr0x|D]}t|tj�qW|t@dkrTx|D]}t|t�qBW|S)z�A ``pipe2`` implementation using :func:`os.pipe`.

    ``flags`` is an integer providing the flags to ``pipe2``.

    .. warning::

       This implementation is not atomic!

    Return a pair of file descriptors ``(r, w)``.

    r)�os�pipe�
O_NONBLOCK�set_fd_status_flagr�set_fd_flag)rr�fdrrr�_pipe2_by_pipeBs

rcCsNttd�rtjSy$tdtt�}t|d�r2tt|�StSt	k
rHtSXdS)z]Find the appropriate implementation for ``pipe2``.

Return a function implementing ``pipe2``.r
rN)
�hasattrrr
r
r	rrrr�ImportError)rrrr�_get_pipe2_implementationXs
rcCs(tj|tjd�}tj|tj||B�dS)zwSet a flag on a file descriptor.

    ``fd`` is the file descriptor or file object, ``flag`` the flag as integer.

    rN)�fcntlZF_GETFDZF_SETFD)r�flagrrrrrksrcCs(tj|tjd�}tj|tj||B�dS)z~Set a status flag on a file descriptor.

    ``fd`` is the file descriptor or file object, ``flag`` the flag as integer.

    rN)rZF_GETFLZF_SETFL)rrrrrrrusrc@s,eZdZdZedd��Zdd�Zdd�ZdS)	�Pipez�A unix pipe.

    A pipe object provides two file objects: :attr:`source` is a readable file
    object, and :attr:`sink` a writeable.  Bytes written to :attr:`sink` appear
    at :attr:`source`.

    Open a pipe with :meth:`open()`.

    cCsttjtB�\}}|||�S)zLOpen and return a new :class:`Pipe`.

        The pipe uses non-blocking IO.)�_PIPE2rrr)�cls�source�sinkrrr�open�sz	Pipe.opencCs$tj|dd�|_tj|dd�|_dS)z�Create a new pipe object from the given file descriptors.

        ``source_fd`` is a file descriptor for the readable side of the pipe,
        ``sink_fd`` is a file descriptor for the writeable side.�rbr�wbN)r�fdopenr#r$)�selfZ	source_fdZsink_fdrrr�__init__�sz
Pipe.__init__c
Cs z|jj�Wd|jj�XdS)zCloses both sides of the pipe.N)r#�closer$)r)rrrr+�sz
Pipe.closeN)�__name__�
__module__�__qualname__�__doc__�classmethodr%r*r+rrrrr s	r )r/Z
__future__rrrrrr�	functoolsrZpyudev._ctypeslib.libcrrr	Zpyudev._ctypeslib.utilsr
�getattrrrrrr!rr�objectr rrrr�<module> s&


Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 336 B 0644
__init__.cpython-36.pyc File 336 B 0644
pipe.cpython-36.opt-1.pyc File 3.92 KB 0644
pipe.cpython-36.pyc File 3.92 KB 0644
poll.cpython-36.opt-1.pyc File 3.28 KB 0644
poll.cpython-36.pyc File 3.28 KB 0644