+
     h:	  c                   sJ    R t ^ RIt^ RIt^ RIHtHtHtHt ^RIH	t	 R t
R tR# )z<Substitute for the forkpty system call, to support Solaris.
N)STDIN_FILENOSTDOUT_FILENOSTDERR_FILENOCHILD)PtyProcessErrorc                 s   \         P                  ! 4       w  rV ^ 8  g   V^ 8  d   \        R4      h\         P                  ! 4       pV\        8X  dv   \         P
                  ! V 4       \        V4       \         P                  ! V\        4       \         P                  ! V\        4       \         P                  ! V\        4       W 3# \         P
                  ! V4       W 3# )a  This implements a substitute for the forkpty system call. This
should be more portable than the pty.fork() function. Specifically,
this should work on Solaris.

Modified 10.06.05 by Geoff Marshall: Implemented __fork_pty() method to
resolve the issue with Python's pty.fork() not supporting Solaris,
particularly ssh. Based on patch to posixmodule.c authored by Noah
Spurrier::

    http://mail.python.org/pipermail/python-dev/2003-May/035281.html

zos.openpty() failed)osZopenptyOSErrorZforkr   closepty_make_controlling_ttyZdup2r    r   r   )Z	parent_fdZchild_fdZpids      9/usr/lib/python3.14/site-packages/ptyprocess/_fork_pty.pyfork_ptyr
   	   s     **,I1}1+,,
'')C
e|
 *
,'
-(
-( > 	>    c                s   \         P                  ! V 4      p \         P                  ! R\         P                  \         P                  ,          4      p\         P
                  ! V4       \         P                  ! 4         \         P                  ! R\         P                  \         P                  ,          4      p\         P
                  ! V4       \        R4      h  \         d+   pTP                  \        P                  8w  d   h  Rp?LRp?ii ; i  \         d+   pTP                  \        P                  8w  d   h  Rp?MRp?ii ; i\         P                  ! T\         P                  4      p\         P
                  ! T4       \         P                  ! R\         P                  4      p\         P
                  ! T4       R# )zThis makes the pseudo-terminal the controlling tty. This should be
more portable than the pty.fork() function. Specifically, this should
work on Solaris. z/dev/ttyNz(OSError of errno.ENXIO should be raised.)r   ZttynameZopenZO_RDWRZO_NOCTTYr   r   errnoZENXIOZsetsidr   ZO_WRONLY)Ztty_fdZ
child_nameZfdZerrs   &   r	   r   r   +   s   
 F#J
WWZR[[!89

 IIKWWZR[[!89
HII  99# $  99# $
 
RYY	'BHHRL 
R[[	)BHHRLs1   AC >AD D$ D		DE EE)Z__doc__r   r   Zptyr    r   r   r   Zutilr   r
   r   ) r   r	   <module>r      s$    	  C C ! D#r   