Date: Fri, 22 Aug 2008 10:40:21 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern tty_pts.c Message-ID: <200808221040.m7MAeN4j033412@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
ed 2008-08-22 10:40:21 UTC
FreeBSD src repository
Modified files:
sys/kern tty_pts.c
Log:
SVN rev 182001 on 2008-08-22 10:40:21Z by ed
Fix pts(4) error codes when slave device is closed.
Unlike pre-MPSAFE TTY, the pts(4) driver always returned ENXIO when a
read() or write() was performed on a pseudo-terminal master device when
the slave device was not opened. The old implementation had different
semantics:
- When the slave device had not been opened yet, read() and write() just
blocked.
- When the slave device had been closed, a read() call would return 0
bytes length.
- When the slave device had been closed, a write() call would return
EIO.
Change the new implementation to return 0 and EIO as well. We don't
implement the first rule, but I suspect this is not needed, because
routines like openpty() also open the slave device node. posix_openpt()
users also do similar things.
Reported by: rink
Tested by: rink
Revision Changes Path
1.20 +2 -4 src/sys/kern/tty_pts.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808221040.m7MAeN4j033412>
