MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / slave_open

Function slave_open

tools/python-3.11.9-amd64/Lib/pty.py:66–82  ·  view source on GitHub ↗

slave_open(tty_name) -> slave_fd Open the pty slave and acquire the controlling terminal, returning opened filedescriptor. Deprecated, use openpty() instead.

(tty_name)

Source from the content-addressed store, hash-verified

64 raise OSError('out of pty devices')
65
66def 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
84def fork():
85 """fork() -> (pid, master_fd)

Callers 1

openptyFunction · 0.85

Calls 1

openMethod · 0.45

Tested by

no test coverage detected