Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!seismo!mimsy!chris From: chris@mimsy.UUCP Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: O_NDELAY flag on open system call on 4.2BSD Message-ID: <4547@mimsy.UUCP> Date: Thu, 27-Nov-86 13:57:50 EST Article-I.D.: mimsy.4547 Posted: Thu Nov 27 13:57:50 1986 Date-Received: Fri, 28-Nov-86 02:06:34 EST References: <3472@sdcrdcf.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 33 Xref: watmath comp.unix.questions:193 comp.unix.wizards:195 In article <3472@sdcrdcf.UUCP>, davem@sdcrdcf.UUCP (David Melman) writes: >I want to be able to check for carrier on a tty port without blocking. >I thought I would use the O_NDELAY flag in an open call, but I found >that the open still hangs, e.g > >>open (ttyline, O_WRONLY|O_NDELAY, 0); > >Specifically, the tty port is a DEC DMZ. The 4.2 and 4.3 kernels do not check O_NDELAY before waiting for carrier. It is easy to add to a kernel, but (I think) the wrong approach. >We are running 4.2bsd with Chris Torek's DMZ driver. Well, it is not `my' DMZ driver; I just edited it a bit. But if you have my version, you should have a `dmzoopen()' and a `dmzoclose()' in it as well. Configure these in (if you have not done so already) in /sys/vax/conf.c, and then # mknod /dev/dialNN c where is the major device number that gets dmzoopen, and is the minor device number of the appropriate tty. Opening the dial line will succeed if and only if there is no one actively using the tty line. If the tty line is in use (by, e.g., getty) the open will fail with EBUSY. The tty line opens will wait for carrier as usual; dial line opens never wait for carrier. (Exception: root can always open the dial line.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) UUCP: seismo!mimsy!chris ARPA/CSNet: chris@mimsy.umd.edu