From 621217ffeb9bddec866ad8895bd01973977f2848 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 2 Nov 2018 13:14:25 +0100 Subject: Add tcsetpgrp()+tcgetpgrp(). One more step on the path to being able to ^C a runaway process. :^) --- VirtualFileSystem/FileHandle.cpp | 7 +++++++ VirtualFileSystem/FileHandle.h | 1 + 2 files changed, 8 insertions(+) (limited to 'VirtualFileSystem') diff --git a/VirtualFileSystem/FileHandle.cpp b/VirtualFileSystem/FileHandle.cpp index 6f9354a143..49199f6b22 100644 --- a/VirtualFileSystem/FileHandle.cpp +++ b/VirtualFileSystem/FileHandle.cpp @@ -176,6 +176,13 @@ const TTY* FileHandle::tty() const return nullptr; } +TTY* FileHandle::tty() +{ + if (auto* device = m_vnode->characterDevice()) + return static_cast(device); + return nullptr; +} + int FileHandle::close() { return 0; diff --git a/VirtualFileSystem/FileHandle.h b/VirtualFileSystem/FileHandle.h index d5e0d1bf2d..bf6a842891 100644 --- a/VirtualFileSystem/FileHandle.h +++ b/VirtualFileSystem/FileHandle.h @@ -30,6 +30,7 @@ public: bool isTTY() const; const TTY* tty() const; + TTY* tty(); InodeMetadata metadata() const { return m_vnode->metadata(); } -- cgit v1.2.3