feat: add is_terminal_attached syscall
This commit is contained in:
@@ -438,6 +438,11 @@ namespace montauk {
|
||||
return syscall1(montauk::abi::SYS_LOG_WRITE, (uint64_t)logMessage);
|
||||
}
|
||||
|
||||
// True when stdout is connected to a redirected userspace terminal.
|
||||
inline bool terminal_attached() {
|
||||
return syscall0(montauk::abi::SYS_TERMINAL_ATTACHED) != 0;
|
||||
}
|
||||
|
||||
// I/O redirection
|
||||
inline int spawn_redir(const char* path, const char* args = nullptr) {
|
||||
return (int)syscall2(montauk::abi::SYS_SPAWN_REDIR, (uint64_t)path, (uint64_t)args);
|
||||
|
||||
Reference in New Issue
Block a user