9#ifndef LLDB_HOST_PSEUDOTERMINAL_H
10#define LLDB_HOST_PSEUDOTERMINAL_H
13#include "llvm/Support/Error.h"
69 llvm::Expected<lldb::pid_t>
Fork();
A pseudo terminal helper class.
PseudoTerminal()
Default constructor.
const PseudoTerminal & operator=(const PseudoTerminal &)=delete
int m_secondary_fd
The file descriptor for the secondary.
int ReleaseSecondaryFileDescriptor()
Release the secondary file descriptor.
llvm::Error OpenFirstAvailablePrimary(int oflag)
Open the first available pseudo terminal.
PseudoTerminal(const PseudoTerminal &)=delete
llvm::Error OpenSecondary(int oflag)
Open the secondary for the current primary pseudo terminal.
void ClosePrimaryFileDescriptor()
Close the primary file descriptor if it is valid.
int m_primary_fd
The file descriptor for the primary.
llvm::Expected< lldb::pid_t > Fork()
Fork a child process that uses pseudo terminals for its stdio.
int GetPrimaryFileDescriptor() const
The primary file descriptor accessor.
int ReleasePrimaryFileDescriptor()
Release the primary file descriptor.
std::string GetSecondaryName() const
Get the name of the secondary pseudo terminal.
void CloseSecondaryFileDescriptor()
Close the secondary file descriptor if it is valid.
int GetSecondaryFileDescriptor() const
The secondary file descriptor accessor.
@ invalid_fd
Invalid file descriptor value.
~PseudoTerminal()
Destructor.
A class that represents a running process on the host machine.