+
    	4i:	                     J    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                    \         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)osopenptyOSErrorforkr   closepty_make_controlling_ttydup2r   r   r   )	parent_fdchild_fdpids      6/usr/lib/python3/dist-packages/ptyprocess/_fork_pty.pyfork_ptyr   	   s     **,I1}1+,,
'')C
e|
 *
,'
-(
-( > 	>    c                   \         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   ttynameopenO_RDWRO_NOCTTYr   r
   errnoENXIOsetsidr   O_WRONLY)tty_fd
child_namefd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)__doc__r   r   ptyr   r   r   r   utilr   r   r    r   r   <module>r&      s$    	  C C ! D#r   