slave_open(tty_name) -> slave_fd Open the pty slave and acquire the controlling terminal, returning opened filedescriptor. Deprecated, use openpty() instead.
(tty_name)
| 64 | raise OSError('out of pty devices') |
| 65 | |
| 66 | def slave_open(tty_name): |
| 67 | """slave_open(tty_name) -> slave_fd |
| 68 | Open the pty slave and acquire the controlling terminal, returning |
| 69 | opened filedescriptor. |
| 70 | Deprecated, use openpty() instead.""" |
| 71 | |
| 72 | result = os.open(tty_name, os.O_RDWR) |
| 73 | try: |
| 74 | from fcntl import ioctl, I_PUSH |
| 75 | except ImportError: |
| 76 | return result |
| 77 | try: |
| 78 | ioctl(result, I_PUSH, "ptem") |
| 79 | ioctl(result, I_PUSH, "ldterm") |
| 80 | except OSError: |
| 81 | pass |
| 82 | return result |
| 83 | |
| 84 | def fork(): |
| 85 | """fork() -> (pid, master_fd) |