+
    Big                      @   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	H
t
 ^ RIHt ]! R4      t]! R4      t ! R R]P                  4      t]P"                  ! ]! ]R	4      R
4       ! R R]P                  4      4       t]R8X  d   ]P*                  ! 4        R# R# )    N)support)	os_helperthreading_helper)import_modulefcntltermiosc                   r   a  ] tR t^t o ]R 4       tR tR tR tRR lt	RR lt
RR ltR	 tR
 tR tRtV tR# )IoctlTestsTtyc           
     
   \         P                  ! \        R 4      p \        RR4      pT;_uu_ 4        \        P                  Y!\        P                  ! R^ 4      4      pRRR4       \        P                  ! RX4      ^ ,          pT\        P                  ! 4       \        P                  ! ^ 4      39  d   \
        P                  ! R4      hR#   \         d    \
        P                  ! R4      hi ; i  + '       g   i     L; i)	TIOCGPGRP/dev/ttyrbzUnable to open /dev/ttyiNzBNeither the process group nor the session are attached to /dev/tty)r   get_attributer   openOSErrorunittestSkipTestr   ioctlstructpackunpackosgetpgrpgetsid)clsr   ttyrrpgrps   &    &/usr/lib/python3.14/test/test_ioctl.py
setUpClassIoctlTestsTty.setUpClass   s    ))';?		?z4(C SCFKKQ,?@A  c1%a(ryy|44## %? @ @ 5  	?##$=>>	?Ss   C ,C2"C/2D	c           	     f   \         P                  ! 4       \         P                  ! ^ 4      3p\        RR4      ;_uu_ 4       pRp\        P                  V\        P                  V4      pV P                  V\        4       \        V4      P                  R4      ^ ,          pV P                  WQ4       Rp\        P                  V\        P                  V4      pV P                  V\        4       \        V4      P                  R4      ^ ,          pV P                  WQ4       \        P                  V\        P                  \        V4      4      pV P                  V\        4       \        V4      P                  R4      ^ ,          pV P                  WQ4       RRR4       R#   + '       g   i     R# ; i)r   r   r   r   Nz                   )r   r   r   r   r   r   r   r   assertIsInstancebytes
memoryviewcastassertInselfidsr   bufr   r   s   &     r    test_ioctl_immutable_buf&IoctlTestsTty.test_ioctl_immutable_buf   s3    zz|RYYq\**d##sCC!2!2C8A!!!U+qM&&s+A.EMM%% CC!2!2C8A!!!U+qM&&s+A.EMM%% C!2!2JsODA!!!U+qM&&s+A.EMM%%' $###s    EFF0	c                   \         P                  ! 4       \         P                  ! ^ 4      3p\        RR4      ;_uu_ 4       p\	        R4      p\
        P                  V\        P                  V4      pV P                  V^ 4       \        V4      P                  R4      ^ ,          pV P                  WQ4       RRR4       R#   + '       g   i     R# ; i)r   r   r   r   Nr$   )r   r   r   r   	bytearrayr   r   r   r   assertEqualr'   r(   r)   r*   s   &     r    test_ioctl_mutable_buf$IoctlTestsTty.test_ioctl_mutable_buf6   s    zz|RYYq\**d##sF#CC!2!2C8AQ"sO((-a0EMM%% $###s    A5B??C	c                   \         P                  ! 4       \         P                  ! ^ 4      3p\        RR4      ;_uu_ 4       p\	        R4      p\        V4      p\        P                  V\        P                  VR4      pV P                  \        V4      V4       V P                  V\
        4       \        V4      P                  R4      ^ ,          pV P                  Wa4       RRR4       R#   + '       g   i     R# ; i)r   r   r   Fr   Nr$   )r   r   r   r   r1   r&   r   r   r   r   r2   r%   r'   r(   r)   )r+   r,   r   r-   save_bufr   r   s   &      r    test_ioctl_no_mutate_buf&IoctlTestsTty.test_ioctl_no_mutate_buf?   s    zz|RYYq\**d##sF#CSzHC!2!2C?AU3Z2!!!U+qM&&s+A.EMM%% $###s    B C**C;	Nc                    \         P                   ! R 4      pVP                  pRpVeD   VP                  V.W,          ,          4       V P                  \	        V4      V,          V4       V# VP                  V4       V# )r   i)arrayitemsizeextendr2   lenappend)r+   nbytesr-   intsizefills   &&   r    _create_int_bufIoctlTestsTty._create_int_bufJ   sm    kk#,,JJv!234SX/8 
 JJt
    c                   \         P                  ! 4       \         P                  ! ^ 4      3pV P                  V4      p\	        RR4      ;_uu_ 4       p\
        P                  V\        P                  V4      pRRR4       V^ ,          pV P                  X^ 4       V P                  Wb4       R#   + '       g   i     L>; i)r   r   r   N)r   r   r   rB   r   r   r   r   r   r2   r)   )r+   r?   r,   r-   r   r   r   s   &&     r    _check_ioctl_mutate_len%IoctlTestsTty._check_ioctl_mutate_lenW   s    zz|RYYq\*""6**d##sC!2!2C8A $AAe!	 $#s   &B--B=	c                   \         P                  ! 4       \         P                  ! ^ 4      3pV P                  V4      p\	        V4      p\        RR4      ;_uu_ 4       p\        P                  V\        P                  VR4      pRRR4       V P                  X\        4       V P                  \        V4      \        V4      4       V P                  \	        V4      V4       \        P                  ! RV4      ^ ,          p\        V4      P                  R4      ^ ,          pV P!                  Wr4       \	        V4      p\        RR4      ;_uu_ 4       p\        P                  V\        P                  VR4      pRRR4       V P                  V\        4       V P                  \        V4      \        V4      4       V P                  W44       \        P                  ! RV4      ^ ,          p\        V4      P                  R4      ^ ,          pV P!                  Wr4       R#   + '       g   i     EL; i  + '       g   i     L; i)r   r   r   FNr   T)r   r   r   rB   r&   r   r   r   r   r   r%   r2   r=   r:   r'   r(   r)   )r+   r?   r,   r-   r6   r   r   r   s   &&      r    _check_ioctl_not_mutate_len)IoctlTestsTty._check_ioctl_not_mutate_len`   s   zz|RYYq\*""6*:*d##sC!2!2C?A $a'QX/sX.C#A&1""3'*e!Cj*d##sC!2!2C>A $a'QX/'C#A&1""3'*e!# $## $#s   'H'H/H,	/H?	c                F    V P                  4        V P                  4        R # NrF   rI   r+   s   &r    test_ioctl_mutateIoctlTestsTty.test_ioctl_mutatew   s    $$&((*rD   c                J    V P                  R 4       V P                  R 4       R# )   NrM   rN   s   &r    test_ioctl_mutate_1024$IoctlTestsTty.test_ioctl_mutate_1024{   s      	$$T*((.rD   c                j    V P                  R 4       V P                  \        V P                  R 4       R# )i   N)rF   assertRaises
ValueErrorrI   rN   s   &r    test_ioctl_mutate_2048$IoctlTestsTty.test_ioctl_mutate_2048   s(    $$T**d&F&FMrD    rL   )__name__
__module____qualname____firstlineno__classmethodr!   r.   r3   r7   rB   rF   rI   rO   rS   rX   __static_attributes____classdictcell____classdict__s   @r    r
   r
      sM     @ @&2&	&"".+/N NrD   r
   openptyzneed os.openpty()c                   \  a  ] tR t^t o R t]P                  ! ]! ]R4      R4      R 4       t	]
P                  ! R4      ]P                  ! ]P                  R9   R4      ]P                  ! ]! ]R4      R4      R	 4       4       4       tR
 t]P                  ! ]! ]R4      R4      R 4       tRtV tR# )IoctlTestsPtyc                    \         P                  ! 4       w  V n        V n        V P	                  \         P
                  V P                  4       V P	                  \         P
                  V P                  4       R # rL   )r   rd   	master_fdslave_fd
addCleanupcloserN   s   &r    setUpIoctlTestsPty.setUp   sB    (*

%$--0$..1rD   TCFLSHzrequires termios.TCFLSHc                ^   V P                   pV P                  p\        P                  R9   p\        P
                  ! VR4       V P                  \        P                  ! V^4      R4       V'       d5   \        P                  V\        P                  \        P                  4       M3\        P                  V\        P                  \        P                  4       V P                  \        P                  ! V^4      R4       V'       d5   \        P                  V\        P                  \        P                  4       M3\        P                  V\        P                  \        P                  4       \        P
                  ! VR4       V P                  \        P                  ! VR4      R4       R# )linuxs   abcdefs   abs   cds   ABCDEFrR   Nrp   android)ri   rh   sysplatformr   writer2   readr   r   r   rn   TCOFLUSHTCIFLUSH)r+   wfdrfdinbufs   &   r     test_ioctl_clear_input_or_output.IoctlTestsPty.test_ioctl_clear_input_or_output   s   mmnn  44
i a%0KKW^^W-=-=> KKW^^W-=-=>a%0KKW^^W-=-=> KKW^^W-=-=>
i d+Y7rD   tcflowzonly works on LinuxTCXONCzrequires termios.TCXONCc           	       a aaa S P                   oS P                  p\        P                  ! 4       o\        P                  ! 4       oV VVV3R  lp\        P
                  ! \        P                  ! VR7      .4      ;_uu_ 4        S P                  \        P                  ! V^4      R4         \        P                  S\        P                  \        P                  4       SP                  4        S P!                  SP#                  R4      R4       \        P                  S\        P                  \        P$                  4       S P'                  SP#                  \(        P*                  4      R4       S P                  \        P                  ! VR4      R4       RRR4       R#   SP                  4        i ; i  \        P                  S\        P                  \        P$                  4       i ; i  + '       g   i     R# ; i)	c                     < \         P                  ! SR 4       S P                  SP                  \        P
                  4      4       \         P                  ! SR4       SP                  4        R# )   abc   defN)r   ru   
assertTruewaitr   SHORT_TIMEOUTset)r+   ry   write_finishedwrite_suspendeds   r    writerBIoctlTestsPty.test_ioctl_suspend_and_resume_output.<locals>.writer   sH    HHS&!OOO001F1FGHHHS&! rD   )targetr   g      ?zoutput was not suspendedzoutput was not resumedrR   r   N)ri   rh   	threadingEventr   start_threadsThreadr2   r   rv   r   r   r   r   TCOOFFr   assertFalser   TCOONr   r   r   )r+   rz   r   ry   r   r   s   f  @@@r    $test_ioctl_suspend_and_resume_output2IoctlTestsPty.test_ioctl_suspend_and_resume_output   sY    mmnn#//+"*	! 	! ++Y-=-=V-L,MNNRWWS!_f5@*KKW^^W^^D#'')  !4!4S!9!;= C?OON//0E0EF46RWWS$/8 ON $'') C? ONNs7   (G2.3F%!1F:B	G2%F77F::5G//G22H	c                    \         P                  ! R ^^(^ ^ 4      p\        P                  V P                  \
        P                  V4      p\         P                  ! R V4      pV P                  VR,          R4       R# )HHHH:N   NN)   (   )	r   r   r   r   rh   r   
TIOCSWINSZr   r2   )r+   	our_winszresult	new_winszs   &   r    test_ioctl_set_window_size(IoctlTestsPty.test_ioctl_set_window_size   sX    KKB15	T^^W-?-?KMM&&1	21rD   FICLONEzneed fcntl.FICLONEc                   \         P                  ! 4       pV P                  \        4      ;_uu_ 4        \        P                  V\        P                  V4       R R R 4       V P                  \        4      ;_uu_ 4        \        P                  V\        P                  R4       R R R 4       R #   + '       g   i     L]; i  + '       g   i     R # ; i)Ns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   )r   make_bad_fdrV   r   r   r   r   )r+   fds   & r    test_bad_fdIoctlTestsPty.test_bad_fd   s|     ""$w''KKEMM2. (w''KKEMM<8 (' (''''s   &B.>&C.B>	C	)rh   ri   Nrq   )r[   r\   r]   r^   rl   r   
skipUnlesshasattrr   r|   r   skip_android_selinuxrs   rt   r   r   r   r   r`   ra   rb   s   @r    rf   rf      s     2
 (35NO8 P82 !!(+)==?TU(35NO9 P V ,962 	24HI9 J9rD   rf   __main__)r:   r   r   rs   r   r   testr   test.supportr   r   test.support.import_helperr   r   r   TestCaser
   r   r   rf   r[   mainrZ   rD   r    <module>r      s     	  
    4 4g
	
"wNH%% wNt 
WR+-@AL9H%% L9 BL9^ zMMO rD   