From owner-freebsd-questions Thu Jun 29 19:56:31 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id TAA16685 for questions-outgoing; Thu, 29 Jun 1995 19:56:31 -0700 Received: from Starbase.NeoSoft.COM (root@starbase.NeoSoft.COM [198.64.6.26]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id TAA16679 for ; Thu, 29 Jun 1995 19:56:29 -0700 Received: from scooter-ppp-bd.NeoSoft.com (scooter-ppp-bd.NeoSoft.com [198.65.165.188]) by Starbase.NeoSoft.COM (8.6.10/8.6.10) with SMTP id VAA19157; Thu, 29 Jun 1995 21:56:24 -0500 Message-Id: <199506300256.VAA19157@Starbase.NeoSoft.COM> X-Provider: NeoSoft, Inc.: Internet Service Provider (713) 968-5800 X-Sender: rberndt@popmail.neosoft.com X-Mailer: Windows Eudora Version 2.1.1b4 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 29 Jun 1995 21:58:03 -0500 To: jleppek@suw2k.ess.harris.com (James Leppek), freebsd-questions@FreeBSD.ORG From: Randy Berndt Subject: Re: APC Backups 400 && ups daemon Sender: questions-owner@FreeBSD.ORG Precedence: bulk At 12:18 AM 6/29/95 EDT, James Leppek wrote: > >If you wire the status line to the DSR (RS232 pin 6) then this should >work: >fd=open("device_name", O_RDONLY,0); > >get status with >int tty_status; >ioctl(fd, TIOCMGET, &tty_status); > >check it with >if(tty_status & TIOCM_DSR) >bla bla bla > >loop as you see fit, but I would put a sleep(1) in there somewhere > > James, About an hour after I saw your message, I was faced with a problem of being able to detect a CD drop on a serial port. Without your message, I would have spent literally hours digging around trying to find (or steal from an existing program) something that would 'get me by' (I'm quite new to this). With your 4 lines of code, you made my life considerably easier. I just wanted to say "THANK YOU!" I think the "A tells B something, and it really helps C" is the BIG value of this mailing list. Thanks again. Randy Berndt [Signature, like every damned freeway in Houston, is "under construction".]