changeset 27706:ea4d20c43442

(BROKEN_PTY_READ_AFTER_EAGAIN): Define.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 15 Feb 2000 10:27:48 +0000
parents 2c53eb482802
children 5e2a599cda22
files src/s/freebsd.h
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/s/freebsd.h	Tue Feb 15 10:27:23 2000 +0000
+++ b/src/s/freebsd.h	Tue Feb 15 10:27:48 2000 +0000
@@ -151,3 +151,19 @@
    /usr/local/include or libs in /usr/local/lib by default.  */
 
 #define C_SWITCH_SYSTEM -I /usr/X11R6/include -I /usr/local/include -L /usr/local/lib
+
+/* Circumvent a bug in FreeBSD.  In the following sequence of
+   writes/reads on a PTY, read(2) returns bogus data:
+
+   write(2)  1022 bytes
+   write(2)   954 bytes, get EAGAIN
+   read(2)   1024 bytes in process_read_output
+   read(2)     11 bytes in process_read_output
+
+   That is, read(2) returns more bytes than have ever been written
+   successfully.  The 1033 bytes read are the 1022 bytes written
+   successfully after processing (for example with CRs added if the
+   terminal is set up that way which it is here).  The same bytes will
+   be seen again in a later read(2), without the CRs.  */
+
+#define BROKEN_PTY_READ_AFTER_EAGAIN 1