From owner-freebsd-bugs@FreeBSD.ORG Thu Apr 24 16:50:01 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC4C4438 for ; Thu, 24 Apr 2014 16:50:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A714812A2 for ; Thu, 24 Apr 2014 16:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OGo1XI052057 for ; Thu, 24 Apr 2014 16:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s3OGo15q052055; Thu, 24 Apr 2014 16:50:01 GMT (envelope-from gnats) Date: Thu, 24 Apr 2014 16:50:01 GMT Message-Id: <201404241650.s3OGo15q052055@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: kern/188952: read after revoke giving error not eof X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Bruce Evans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 16:50:01 -0000 The following reply was made to PR kern/188952; it has been noted by GNATS. From: Bruce Evans To: Justin Cormack Cc: freebsd-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org Subject: Re: kern/188952: read after revoke giving error not eof Date: Fri, 25 Apr 2014 02:46:26 +1000 (EST) On Thu, 24 Apr 2014, Justin Cormack wrote: >> Description: > I have this ktrace of revoking a pty device: > ... > 43214 luajit-2.0.2 CALL revoke(0xfebc8) > 43214 luajit-2.0.2 NAMI "/dev/pts/1" > 43214 luajit-2.0.2 RET revoke 0 > 43214 luajit-2.0.2 CALL read(0x4,0xa4170,0x1000) > 43214 luajit-2.0.2 RET read -1 errno 6 Device not configured > > As you can see the revoke succeeds but the read is an error. The man page says: > > The revoke() system call invalidates all current open file descriptors in > the system for the file named by path. Subsequent operations on any such > descriptors fail, with the exceptions that a read() from a character > device file which has been revoked returns a count of zero (end of file), > ... > > So the read should be giving a count of zero not an error according to the docs (this happens eg in NetBSD), although maybe the sentence after is trying to tell me something else. deadfs and devfs still try to return EOF for dead ttys, though devfs still has a comment saying that this is redundant for it (it is obviously not redundant for devfs, since devfs is the only place that sets the flag VV_ISTTY used by deadfs). Bruce