aboutsummaryrefslogtreecommitdiffstats
path: root/libterminput_is_ready.3
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-02-19 19:53:53 +0100
committerMattias Andrée <m@maandree.se>2025-02-19 19:55:30 +0100
commita40d93ab5a064f8f2f9696acd1b57ef3603cd2fe (patch)
tree288671ad6f1b0d8c57a00b18b04f21b827eab24d /libterminput_is_ready.3
parentminor readability improvement (diff)
downloadlibterminput-a40d93ab5a064f8f2f9696acd1b57ef3603cd2fe.tar.gz
libterminput-a40d93ab5a064f8f2f9696acd1b57ef3603cd2fe.tar.bz2
libterminput-a40d93ab5a064f8f2f9696acd1b57ef3603cd2fe.tar.xz
misc cleanup, fixes, and clarifications, and escape sequence
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libterminput_is_ready.3')
-rw-r--r--libterminput_is_ready.330
1 files changed, 29 insertions, 1 deletions
diff --git a/libterminput_is_ready.3 b/libterminput_is_ready.3
index 08e6fd6..27b98f6 100644
--- a/libterminput_is_ready.3
+++ b/libterminput_is_ready.3
@@ -24,6 +24,33 @@ is buffered data but the library knows it
it not enough to return something they,
it will also return that there is nothing
buffered.
+.PP
+The
+.BR libterminput_is_ready ()
+function should only be used if using blocking
+read operations (terminal file descriptor configured with
+.I O_NONBLOCK
+cleared). The flag
+.I LIBTERMINPUT_ESC_ON_BLOCK
+is only meaningful for non-blocking reads. With non-blocking
+reads, the application should call
+.BR libterminput_read (3)
+and check for
+.I EAGAIN
+error rather than using the
+.BR libterminput_is_ready ()
+function, as
+.I EAGAIN
+errors on read can cause the
+.BR libterminput_read (3)
+function to output keypresses it would otherwise not output,
+but in doing so not report
+.I EAGAIN
+(although
+.I errno
+will still be set to
+.IR EAGAIN ,
+so the application can still check if this occurred).
.SH RETURN VALUE
The
@@ -57,4 +84,5 @@ None.
None.
.SH SEE ALSO
-.BR libterminput_read (3)
+.BR libterminput_read (3),
+.BR fcntl (3)