From owner-freebsd-hackers Tue Jul 25 07:14:06 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id HAA25548 for hackers-outgoing; Tue, 25 Jul 1995 07:14:06 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id HAA25542 for ; Tue, 25 Jul 1995 07:13:52 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id AAA32521; Wed, 26 Jul 1995 00:06:04 +1000 Date: Wed, 26 Jul 1995 00:06:04 +1000 From: Bruce Evans Message-Id: <199507251406.AAA32521@godzilla.zeta.org.au> To: ache@astral.msk.su, terry@cs.weber.edu Subject: Re: dial up at > 9600 baud Cc: bde@zeta.org.au, hackers@freebsd.org, harry@hgac.com, jkh@violet.berkeley.edu Sender: hackers-owner@freebsd.org Precedence: bulk >> >>Does EAGAIN allowed on open by POSIX? >> >> >No. "... opening a terminal device file with the O_NONBLOCK flag clear >> >shall cause the process to block until the terminal device is ready and >> >available. The CLOCAL flag can also affect open()." [Opening terminal >> >device files with O_NONBLOCK set is supposed to always work if the file >> >permissions allow it. We probably break this by returning EBUSY for >> >some exclusive access and bidirectional cases.] >A non-blocking open of the regular device when the calling unit >device is in use is to return EWOULDBLOCK. Not allowed by POSIX (apart from EWOULDBLOCK not existing in POSIX), but better than EBUSY. >A blocking open is to block until the calling unit is not busy Except blocking opens of the calling unit should block unit the non-calling unit is not busy. We currently return EBUSY. >It seems the interpretation of POSIX above is being used incorrectly. >The flag in question is on the tty struct, *not* on the open. The >O_NONBLOCK flag on the open is in a different section of the standard. No. No. Yesbut. :-) The flag is on the open and lives in the file struct, *not* in the tty struct. The 2 sections of the standard say much the same thing. The section on open() says that for cdevs that "support nonblocking opens": (1) O_NONBLOCK shall cause permissible opens to succeed immediately. (2) !O_NONBLOCK shall cause permissible opens to block. The section on opening "Terminal Devices Files" says (2). Apparently "Terminal Device Files" "support nonblocking opens" (although I don't know where if anywhere that is specified explicitly) so (1) should apply too. Bruce