Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!ucla-cs!math.ucla.edu!dgc@euphemia.math.ucla.edu From: dgc@euphemia.math.ucla.edu (David G. Cantor) Newsgroups: comp.sys.next Subject: Testing for power at modem port. Keywords: /dev/cua, /dev/ttya, /dev/ttyda, powwer, shutdown Message-ID: <2518@sunset.MATH.UCLA.EDU> Date: 9 Apr 90 02:03:25 GMT Sender: news@MATH.UCLA.EDU Organization: UCLA Mathematics Dept. Lines: 30 I have a battery-powered backup emergency power supply for my NeXT. I want my NeXT to automatically initiate a shutdown sequence if the main power goes off. My problem is how to test if power is on. I can set my modem to always assert DCD (and of course power the modem from the main power). Then I can have a process running which opens /dev/ttyda when I boot. If DCD drops, the process will receive a sighup and initate the shutdown. The problem with this is (it appears) that this will be the only use I can make of this port, because of the @#$%!! NON-STANDARD, NON-UNIX interlocks on /dev/ttya, /dev/cua, and /dev/ttyda. These interlocks prevent two programs from simultaneously opening this port (under any combination of names). I can't have my (dial-out) modem software running on /dev/ttyda and also do the power checking because I don't have the source. All this applies to the other port, also. Since the NeXT has only two ports, I don't want to tie one up unnecessarily. Is there any reasonable way I can use one port for both a dial-out modem and for determining if power is on? Is there any hope that, in some future revision of its OS, the NeXT tty ports, under one of their aliases, will obey the usual Unix semantics? dgc David G. Cantor Department of Mathematics University of California at Los Angeles Internet: dgc@math.ucla.edu