Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jan 2024 12:33:18 -0600
From:      Kyle Evans <kevans@FreeBSD.org>
To:        "freebsd-hackers@FreeBSD.org" <freebsd-hackers@freebsd.org>
Subject:   tty reviews
Message-ID:  <1a2209c8-2b30-4ac2-a4a4-2cb064c30d10@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Hi,

I have a couple of tty reviews that I've just put up; not sure who's 
around that might be interested in reviewing them:

- https://reviews.freebsd.org/D43377 (kern: tty: fix ttyinq_read_uio 
assertion)
- https://reviews.freebsd.org/D43378 (kern: tty: fix EOF handling for 
canonical reads)

The former change is required for the latter, the latter is necessary to 
avoid returning a bogus EOF if the read(2) buffer is just one byte short 
of ^D (POSIX specifies that EOF is discarded if it's not at the 
beginning of the line, and it returns end-of-file indication otherwise).

If we are, say, two bytes short of ^D, then the first read(2) will 
return the filled buffer and the second will return the partial buffer 
with VEOF trimmed.  If we're just one byte short, we'll now trim the 
VEOF and if there's a second one, the next read(2) will signal end-of-file.

Thanks,

Kyle Evans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1a2209c8-2b30-4ac2-a4a4-2cb064c30d10>