home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.sys5.r4:947 comp.unix.sys5.r3:151
- Path: sparky!uunet!ogicse!news.u.washington.edu!uw-beaver!micro-heart-of-gold.mit.edu!eddie.mit.edu!minya!jcsu
- From: jcsu@minya.UUCP (John Chambers)
- Newsgroups: comp.unix.sys5.r4,comp.unix.sys5.r3
- Subject: Can Sys/V force DTR low or high?
- Keywords: DTR
- Message-ID: <1406@minya.UUCP>
- Date: 22 Dec 92 22:43:34 GMT
- Article-I.D.: minya.1406
- Followup-To: poster
- Lines: 32
-
- The subject is probably self-explanatory. On BSD-like systems, you can
- make a call of:
- ioctl(dev,TIOCCDTR,0L);
- and DTR will instantly drop, telling a (sane ;-) modem to hang up.
- I've poked around in TFM for several Sys/V releases (both R3 and R4),
- and as near as I can tell, there is no (documented) equivalent of this
- operation in Sys/V.
-
- The manuals do say vaguely (without mentioning DTR) that the line will
- be closed when the last program closes the port, if HUPCL is set. But
- that isn't even close to what is needed. To use that, my program would
- have to first find out what processes have the port open, and this is
- known to be a very difficult problem in general. Then, if this could
- even be determined, my program would have to kill all the others,
- which means that I'd have to be running as root, which is quite
- unacceptable.
-
- In any case, even if doable by this method, it can potentially take
- many seconds (or minutes) to grovel around in the kernel for the
- information, and when you want to hang up on a caller, you want to do
- it NOW, not some time in the indefinite future that depends on the
- size and complexity of the kernel's process table.
-
- Another reason not to do it in such a byzantine fashion is that for my
- program to close the port would leave a short window when it isn't
- open, leaving it up for grabs by other programs. That's also
- unacceptable for the application, which is supposed to own the port.
-
- So is it possible for a Sys/V process that has a port open to forcibly
- drop DTR? (If not, I have yet another entry in my list of reasons that
- we should list variants of Sys/V as unacceptable for the project. ;-)
- Might it be documented anywhere?
-