⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

PtyMaster

Struct PtyMaster 

Source
pub struct PtyMaster { /* private fields */ }
Expand description

PTY Master side (controlled by terminal emulator)

Implementations§

Source§

impl PtyMaster

Source

pub fn new(id: u32) -> Self

Create a new PTY master

Source

pub fn id(&self) -> u32

Get PTY ID

Source

pub fn read(&self, buffer: &mut [u8]) -> Result<usize, KernelError>

Read from slave output (what the slave wrote)

Source

pub fn write(&self, data: &[u8]) -> Result<usize, KernelError>

Write to slave input (what the slave will read)

Source

pub fn set_winsize(&self, winsize: Winsize)

Set window size

Source

pub fn get_winsize(&self) -> Winsize

Get window size

Source

pub fn set_flags(&self, flags: TermiosFlags)

Set terminal flags

Source

pub fn get_flags(&self) -> TermiosFlags

Get terminal flags

Source

pub fn set_controller(&self, pid: ProcessId)

Set the controlling process for this PTY.

The controlling process receives signals (SIGINT, SIGTSTP, SIGWINCH) generated by special terminal characters (^C, ^Z) and window size changes.

Source

pub fn get_controller(&self) -> Option<ProcessId>

Get the controlling process ID, if any.

Source

pub fn set_foreground_pgid(&self, pgid: u64)

Set the foreground process group ID for this terminal.

The foreground process group receives keyboard-generated signals (SIGINT from ^C, SIGTSTP from ^Z). Processes in background groups that attempt to read from or write to this terminal receive SIGTTIN or SIGTTOU respectively.

Source

pub fn get_foreground_pgid(&self) -> u64

Get the foreground process group ID for this terminal.

Returns 0 if no foreground group has been set.

Auto Trait Implementations§

§

impl !Freeze for PtyMaster

§

impl !RefUnwindSafe for PtyMaster

§

impl Send for PtyMaster

§

impl Sync for PtyMaster

§

impl Unpin for PtyMaster

§

impl UnwindSafe for PtyMaster

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.