From owner-freebsd-stable@FreeBSD.ORG Mon Feb 4 06:51:22 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E20C316A419 for ; Mon, 4 Feb 2008 06:51:22 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id CED5913C458 for ; Mon, 4 Feb 2008 06:51:22 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 931111CC033; Sun, 3 Feb 2008 22:51:22 -0800 (PST) Date: Sun, 3 Feb 2008 22:51:22 -0800 From: Jeremy Chadwick To: Ganbold Message-ID: <20080204065122.GA92674@eos.sc1.parodius.com> References: <47A69A66.2080109@micom.mng.net> <20080204063023.GA91789@eos.sc1.parodius.com> <47A6B2AB.2060308@micom.mng.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47A6B2AB.2060308@micom.mng.net> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: FreeBSD Stable Mailing List Subject: Re: /dev/cuad0: Device busy X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2008 06:51:23 -0000 On Mon, Feb 04, 2008 at 02:37:31PM +0800, Ganbold wrote: > Jeremy Chadwick wrote: >> On Mon, Feb 04, 2008 at 12:53:58PM +0800, Ganbold wrote: >> >>> Hi, >>> >>> I'm trying to use serial port but the system says device busy. >>> >>> daemon# cu -l /dev/cuad0 -s 9600 >>> /dev/cuad0: Device busy >>> link down >>> >> >> Does the same happen if you do `cu -l ttyd0 -s 9600`? >> > > It works and fstat shows: > > daemon# fstat /dev/cuad0 > USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME > daemon# fstat /dev/ttyd0 > USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME > root cu 5574 3 /dev 41 crw------- ttyd0 rw > /dev/ttyd0 > root cu 5573 3 /dev 41 crw------- ttyd0 rw > /dev/ttyd0 > daemon# > > Is it expected behaviour? As far as I know, yes. On all of our machines which utilise getty(8) on ttyd0 (as listed in /etc/ttys): $ grep ttyd0 /etc/ttys ttyd0 "/usr/libexec/getty std.115200" xterm on secure $ fstat /dev/ttyd0 USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME root getty 37376 0 /dev 36 crw------- ttyd0 rw /dev/ttyd0 root getty 37376 1 /dev 36 crw------- ttyd0 rw /dev/ttyd0 root getty 37376 2 /dev 36 crw------- ttyd0 rw /dev/ttyd0 Additionally, see Section 23.2.5 of the below document: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serial.html Personally, I never understood the concept of "dial-in" and "call-out" devices on FreeBSD. I ran BBS software for years on both Apple II hardware and PC hardware; there was no distinction between such devices. A serial port is a serial port. Chances are I'm not understanding why there's a distinction, but there doesn't appear to be any explanation of why there's a distinction within manpages or the handbook... -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |