bpo-41818: Add os.login_tty() for *nix. (#29658)

* Add `os.login_tty(fd)` for Unix.

Reviewed-by: Christian Heimes <christian@python.org>
Signed-off-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
This commit is contained in:
Soumendra Ganguly 2022-05-05 11:04:44 -05:00 committed by GitHub
parent 42fee931d0
commit ae553b3561
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 184 additions and 14 deletions

View file

@ -1000,6 +1000,17 @@ as internal buffering of data.
.. versionadded:: 3.3
.. function:: login_tty(fd)
Prepare the tty of which fd is a file descriptor for a new login session.
Make the calling process a session leader; make the tty the controlling tty,
the stdin, the stdout, and the stderr of the calling process; close fd.
.. availability:: Unix.
.. versionadded:: 3.11
.. function:: lseek(fd, pos, how)
Set the current position of file descriptor *fd* to position *pos*, modified