Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!ogicse!qiclab!onion!wiskit!herbw From: herbw@wiskit.rain.com (Herb Weiner) Newsgroups: comp.unix.aux Subject: How can a program (daemon) detect loss of carrier detect? Keywords: daemon, carrier detect, SLIP Message-ID: <1991May4.180739.9652@wiskit.rain.com> Date: 4 May 91 18:07:39 GMT Organization: Kitchen Wisdom Publishing Company, Portland, Oregon, USA Lines: 25 My mac is connected to a Portland area SLIP network over dial-up phone lines. Occasionally, the line gets dropped. What I'd like to do is write a daemon that detects the loss of carrier detect, and automatically redials the line and restarts SLIP. Note that this is NOT the same thing as the SLIP link going down. If the system at the other end of the SLIP link gets rebooted, the route is temporarily marked dead, but is automatically reactivated when the remote system comes back up. The line is not dropped in this case. Note that my daemon must NOT do reads or writes to the serial line, since the line is being used by SLIP. I need to be able to detect the loss of carrier detect in a passive fashion. If it would help, my daemon could fork and exec slattconf, so that it is a child of the daemon, but I don't think this solves the problem. I've checked out termio(7) and ioctl(2), specifically TCGETSTAT to see if input or output is currently blocked, but this appears to always return 0 regardless of the state of the line. Any hints would be appreciated. Note that I intend to make this daemon available to the net if and when I get it working. Herb