O_NDELAY flag on open system call on 4.2BSD
chris at mimsy.UUCP
chris at mimsy.UUCP
Fri Nov 28 04:57:50 AEST 1986
In article <3472 at sdcrdcf.UUCP>, davem at 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 <maj> <min>
where <maj> is the major device number that gets dmzoopen, and <min>
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 at mimsy.umd.edu
More information about the Comp.unix.questions
mailing list