feat: libc - add SYS_GETCHAR_NB and a non-blocking stdin readiness probe
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NQRTGoYgnZQsh7uCh6Jsxm
This commit is contained in:
@@ -189,6 +189,7 @@ extern "C" {
|
||||
#define MTK_SYS_WIFI_RESULTS 163
|
||||
#define MTK_SYS_WIFI_CONNECT_ASYNC 164
|
||||
#define MTK_SYS_NETIFS 165
|
||||
#define MTK_SYS_GETCHAR_NB 166
|
||||
/* @SYSCALLS-END */
|
||||
|
||||
#define MTK_SOCK_TCP 1
|
||||
|
||||
@@ -95,6 +95,17 @@ int ungetc(int c, FILE *stream);
|
||||
char *fgets(char *s, int size, FILE *stream);
|
||||
int fputs(const char *s, FILE *stream);
|
||||
|
||||
/* MontaukOS extension: non-blocking readiness probe for stdin.
|
||||
Returns 1 when a complete line is buffered, so a following fgets/fgetc on
|
||||
stdin returns without blocking; 0 otherwise. Partially typed input is kept.
|
||||
This is what a select()-style poll over stdin has to be built on -- stdio
|
||||
descriptors are not waitable kernel objects. */
|
||||
int montauk_stdin_ready(void);
|
||||
|
||||
/* Blocks until a complete line is buffered on stdin, then returns 1. Same
|
||||
buffer as montauk_stdin_ready(); nothing is consumed either way. */
|
||||
int montauk_stdin_wait(void);
|
||||
|
||||
void perror(const char *s);
|
||||
FILE *tmpfile(void);
|
||||
char *tmpnam(char *s);
|
||||
|
||||
Reference in New Issue
Block a user