From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 27120 invoked from network); 17 Apr 1999 20:19:52 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 17 Apr 1999 20:19:52 -0000 Received: from ellpspace.math.ualberta.ca (michal@ellpspace.math.ualberta.ca [129.128.88.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id PAA17335 for ; Sat, 17 Apr 1999 15:55:29 -0400 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.8.8/8.8.8) id NAA08689 for axp-list@redhat.com; Sat, 17 Apr 1999 13:55:22 -0600 From: Michal Jaegermann Message-Id: <199904171955.NAA08689@ellpspace.math.ualberta.ca> Subject: Re: cuax vs ttySx To: axp-list@redhat.com Date: Sat, 17 Apr 1999 13:55:22 -0600 (MDT) In-Reply-To: from "Ron Farrer" at Apr 17, 99 11:12:22 am Content-Type: text Ron Farrer wrote: > > > now cuax has been obsoleted, so your only choice is ttySx. (which > > might become /dev/tts/x if devfs goes into 2.3) > > Could be, I alway's used cuax for modems/routers/etc. and ttysx for > terminals mostly because a few times cuax caused problems with some > terminals. 'cuax' devices are really obsolete for a long time. Mainly they provide some primitive form of locking with ttySx devices; this locking is more trouble than gain in any non-trivial situtation. Ted Tso, who wrote the whole serial handler, describe once 'cuax' devices as a "mistake" and tried quite hard to wean people from 'cuax'. Persuasions did not seem to work so, in 2.2 kernels, any use of 'cuax' logs an obnoxious message and these devices will be gone in future kernel versions. This should do it. :-) Myself I am using /dev/ttySx for a long time and never had any problems. We still probably need a slightly modified 'stty' which can open a serial port directly using O_NONBLOCK for situations when one got stuck and CLOCAL is not set. Normally 'stty' is used as "stty < /dev/ttyS1" and one cannot rely on a shell that it will do that. It might, but one never know. Below is a detailed explanation from Ted about differences and pitfals done better that I could have been able to. :-) Note dates. Michal Subject: Re: /dev/cua? Vs /dev/ttyS? Date: Mon, 13 May 1996 19:51:04 +0200 Status: ROr Date: Mon, 13 May 1996 07:57:09 +1000 From: Tony Nugent Can someone kindly explain the difference between the /dev/cua? and /dev/ttyS? devices? /dev/ttySxx devices are fully POSIX-compliant TTY devices. If you are only going to be using one set of tty devices, you should be using /dev/ttySxx. /dev/cuaXX devices are different from /dev/ttySXX in two ways --- first of all, they will allow you to open the device even if CLOCAL is not set and the O_NONBLOCK flag was not given to the open device. This allows programs that don't use the POSIX-mandated interface for opening /dev/ttySxx devices to be able to use /dev/cuaXX to make outgoing phone calls on their modem (cu stands for "callout", and is taken from SunOS). The second way in which /dev/cuaXX differs from /dev/ttySXX is that if they are used, they will trigger a simplistic kernel-based locking scheme: If /dev/ttySXX is opened by one or more processes, then an attempt to open /dev/cuaXX will return EAGAIN. If /dev/cuaXX is opened by one or more processes, then an attempt to open /dev/ttySXX will result the open blocking until /dev/cuaXX is closed, and the carrier detect line goes high. While this will allow for simple lockouts between a user using a modem for callout and a getty listening on the line for logins, it doesn't work if you need to arbitrate between multiple programs wanting to do dialout --- for example, users wanting to do dialout and UUCP. I originally implemented the cuaXX/ttySXX lockout mechanism back before FSSTND established a standard convention for the use of tty lock files. Now that it's there, people should use the tty lock files and not try using /dev/cuaXX. The only reason why /dev/cuaXX hasn't disappeared yet is for backwards compatibility reasons. - Ted