403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.9/site-packages/pyudev/_os/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/pyudev/_os/__pycache__/pipe.cpython-39.pyc
a

8g+^��@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)�ERROR_CHECKERS)�FD_PAIR)�
SIGNATURES)�load_ctypes_library�	O_CLOEXECicCs"t�}|�||�|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�3/usr/lib/python3.9/site-packages/pyudev/_os/pipe.py�
_pipe2_ctypes2s	rcCsPt��}|tj@dkr,|D]}t|tj�q|t@dkrL|D]}t|t�q<|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_pipe@srcCsRttd�rtjSz&tdtt�}t|d�r2tt|�ntWSt	yLtYS0dS)z]Find the appropriate implementation for ``pipe2``.

Return a function implementing ``pipe2``.r
rN)
�hasattrrr
r
r	rrrr�ImportError)rrrr�_get_pipe2_implementationVs
��rcCs(t�|tjd�}t�|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�flagrrrrrhsrcCs(t�|tjd�}t�|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_SETFLrrrrrrsrc@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$t�|dd�|_t�|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__cCs*z|j��W|j��n|j��0dS)zCloses both sides of the pipe.N)r$�closer%)r*rrrr,�sz
Pipe.closeN)�__name__�
__module__�__qualname__�__doc__�classmethodr&r+r,rrrrr!|s


r!)r0Z
__future__rrrrrr�	functoolsrZpyudev._ctypeslib.libcrrr	Zpyudev._ctypeslib.utilsr
�getattrrrrrr"rr�objectr!rrrr�<module>s&


Youez - 2016 - github.com/yon3zu
LinuXploit