feat: libc - add SYS_GETCHAR_NB and a non-blocking stdin readiness probe
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NQRTGoYgnZQsh7uCh6Jsxm
This commit is contained in:
@@ -197,6 +197,8 @@ namespace montauk {
|
||||
inline bool is_key_available() { return (bool)syscall0(montauk::abi::SYS_ISKEYAVAILABLE); }
|
||||
inline void getkey(montauk::abi::KeyEvent* out) { syscall1(montauk::abi::SYS_GETKEY, (uint64_t)out); }
|
||||
inline char getchar() { return (char)syscall0(montauk::abi::SYS_GETCHAR); }
|
||||
// Returns 0 rather than blocking when no character is pending.
|
||||
inline char getchar_nb() { return (char)syscall0(montauk::abi::SYS_GETCHAR_NB); }
|
||||
inline uint64_t input_wait(uint64_t observedSerial, uint64_t timeoutMs) {
|
||||
return (uint64_t)syscall2(montauk::abi::SYS_INPUT_WAIT, observedSerial, timeoutMs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user