libcosmos
Linux C++ System Programming Library
|
#include <sys/ioctl.h>
#include <chrono>
#include <utility>
#include <optional>
#include <cosmos/fs/FileBase.hxx>
#include <cosmos/fs/FileDescriptor.hxx>
Go to the source code of this file.
Classes | |
struct | cosmos::TermDimension |
Represents a terminal dimension in characters. More... | |
class | cosmos::Terminal |
Access to Terminal information and ioctls. More... | |
Functions | |
std::pair< FileDescriptor, FileDescriptor > | cosmos::openPTY (const std::optional< TermDimension > initial_size={}) |
Creates a new pseudo terminal device and returns master/slave file descriptors for it. | |
This header contains types and helper concerned with terminal / TTY features of the operating system.
Definition in file Terminal.hxx.
COSMOS_API std::pair< cosmos::FileDescriptor, cosmos::FileDescriptor > cosmos::openPTY | ( | const std::optional< TermDimension > | initial_size = {} | ) |
Creates a new pseudo terminal device and returns master/slave file descriptors for it.
A pseudo terminal is a virtual terminal where the slave end behaves like an actual terminal device and can be passed to applications that expect one. The master end drives the application using the slave end.
Any writes to the master end will appear as input from a keyboard to the slave, any writes to the slave end will appear as output data from a program on the master end.
See openpty(2) and pty(7) man pages for more information.
[in] | initial_size | if provided then this will be the initial PTY dimension registered by the kernel. See Terminal::setSize(). |
Definition at line 63 of file Terminal.cxx.