From owner-freebsd-questions Thu Jan 16 6:48:48 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 35CFA37B401 for ; Thu, 16 Jan 2003 06:48:47 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FAC743E4A for ; Thu, 16 Jan 2003 06:48:44 -0800 (PST) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a123.otenet.gr [212.205.215.123]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id h0GEmIgM026347; Thu, 16 Jan 2003 16:48:20 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.6/8.12.6) with ESMTP id h0GEmIYK006261; Thu, 16 Jan 2003 16:48:18 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.6/8.12.6/Submit) id h0GEmIk4006257; Thu, 16 Jan 2003 16:48:18 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 16 Jan 2003 16:48:18 +0200 From: Giorgos Keramidas To: Paul Hamilton Cc: freebsd-questions@FreeBSD.ORG Subject: Re: How do I monitor the serial CTS line via C programmatically? Message-ID: <20030116144818.GA5678@gothmog.gr> References: <20030115112042.GA26041@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2003-01-16 15:44, Paul Hamilton wrote: > Thanks Giorgos! > > I needed to know the function used to access the Serial ports under FreeBSD. > Your program compiles, but generates the following error msg when run: > > test_prog: ioctl: Inappropriate ioctl for device > > Thanks to the ioctl 'tip', I researched around, and found that the > serial port needed opening, so this is the finished code (just in > case someone else needs it): Ah, of course. When I tested it, I used: % ./a.out < /dev/cuaa1 so the shell did the open() for me :) You're right, of course... > [snip C source] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message