Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: michal@gortel.phys.ualberta.ca (Michal Jaegermann)
Subject: Re: alpha newbie questions -> serial port naming
Date: 1999/10/09	[thread overview]
Message-ID: <7tm562$kd0$1@pulp.srv.ualberta.ca> (raw)
In-Reply-To: Pine.LNX.4.10.9910081703330.6342-100000@yok5174.oulu.fi

Harri Haataja (blades@yok5174.oulu.fi) wrote:
: On Thu, 7 Oct 1999, aj wrote:

: > > > 1:12345:respawn:/sbin/getty cua0 9600 vt100
: > > > 2:12345:respawn:/sbin/getty cua1 9600 vt100
: > >
: > > I think Linux users are urged to *only* use the ttyS<n> devices.
: > 
: > actually, that worked perfectly. now i can put the box in a corner without
: > kybd or monitor.

: I believe either works. I never said there'd be problems, but I hear this
: is the way you *should* do it. References ne1?

Ok, once again:

 From: "Theodore Y. Ts'o" <tytso@mit.edu>
 To: Tony Nugent <tonyn@sctnugen.ppp.gu.edu.au>
 Cc: linux-net@vger.rutgers.edu, linux-ppp@vger.rutgers.edu
 Subject: Re: /dev/cua? Vs /dev/ttyS? (was: Re: co-existance of pppd and mgetty ?
 )
 Date: Mon, 13 May 1996 19:51:04 +0200
 Status: ROr

    Date:        Mon, 13 May 1996 07:57:09 +1000
    From: Tony Nugent <tonyn@sctnugen.ppp.gu.edu.au>

    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-mondated 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

As you see from a date this was a while ago and Ted got tired
explaining this over and over again.  What is more important
a co-existence of cuaXX/ttySXX screws up very badly locking in more
complicated situations.  So with kernels from 2.2 series you will
get a warning logged if you try to use /dev/cuaXX.  In 2.4 kernels
this will simply not work.

A corrolary to the above is that with /dev/ttySXX devices only you
need a variant of 'stty' which can open device directly, not through
a shell, and with O_NONBLOCK or you can get stuck without a way of
adjusting flags. OTOH I am using /dev/ttySXX only for a long time
(I do have various programs competing for serial lines) and this was
never a real problem.

 Michal
 



  reply	other threads:[~1999-10-09  4:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-06  4:00 alpha newbie questions aj
1999-10-06  4:00 ` Marco Benton
1999-10-07  4:00   ` alpha newbie questions -> serial port naming Harri Haataja
1999-10-07  4:00     ` aj
1999-10-07  4:00       ` Marco Benton
1999-10-08  4:00       ` Harri Haataja
1999-10-09  4:00         ` Michal Jaegermann [this message]
1999-10-07  4:00 ` alpha newbie questions Eberhard Burr
1999-10-07  4:00   ` Michal Jaegermann
1999-10-07  4:00   ` Bill Zettler
1999-10-07  4:00     ` Eberhard Burr
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox